]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
2002-01-22 Robert Collins <rbtcollins@hotmail.com>
authorRobert Collins <rbtcollins@hotmail.com>
Tue, 22 Jan 2002 11:35:10 +0000 (11:35 +0000)
committerRobert Collins <rbtcollins@hotmail.com>
Tue, 22 Jan 2002 11:35:10 +0000 (11:35 +0000)
        * archive.cc (extract_file): Separate out the prefix and the URL scheme.
        * archive.h (archive::extract_file): Ditto.
        * install.cc (install_one_source): Ditto.
        Use the new archive::extract_file syntax.
        (replace_one): Use the new syntax.
        (io_stream.cc): Add some log info for links.

ChangeLog
archive.cc
archive.h
install.cc
io_stream.cc

index ef71356f5779becacc94325c0879a68dc6e50604..ca5e9ffadbe36af3d1cfecbc777f1d7e5e7960d0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2002-01-22  Robert Collins  <rbtcollins@hotmail.com>
+
+       * archive.cc (extract_file): Separate out the prefix and the URL scheme.
+       * archive.h (archive::extract_file): Ditto.
+       * install.cc (install_one_source): Ditto.
+       Use the new archive::extract_file syntax.
+       (replace_one): Use the new syntax.
+       (io_stream.cc): Add some log info for links.
+
 2002-01-22  Robert Collins  <rbtcollins@hotmail.com>
 
        * PickCategoryLine.cc (PickCategoryLine::actiontext): Remove.
index 0b464692c8920f6454e1da75470f2377906bdea8..b857f69c8a3cdd6a855f31605fb033c5eb0b17ee 100644 (file)
@@ -78,11 +78,11 @@ archive::extract (io_stream * original)
 }
 
 int
-archive::extract_file (archive * source, const char *prefix, const char *suffix)
+archive::extract_file (archive * source, const char *prefixURL, const char *prefixPath, const char *suffix)
 {
   if (!source)
     return 1;
-  const char *destfilename = concat (prefix, source->next_file_name (), suffix, 0);
+  const char *destfilename = concat (prefixURL,prefixPath, source->next_file_name (), suffix, 0);
   switch (source->next_file_type ())
     {
     case ARCHIVE_FILE_REGULAR:
@@ -127,7 +127,7 @@ archive::extract_file (archive * source, const char *prefix, const char *suffix)
        io_stream::remove (destfilename);
        int ok =
          io_stream::mklink (destfilename,
-                            concat (prefix, source->linktarget (), 0),
+                            concat (prefixURL, source->linktarget (), 0),
                             IO_STREAM_SYMLINK);
        /* FIXME: check what tar's filelength is set to for symlinks */
        source->skip_file ();
@@ -141,7 +141,7 @@ archive::extract_file (archive * source, const char *prefix, const char *suffix)
        io_stream::remove (destfilename);
        int ok =
          io_stream::mklink (destfilename,
-                            concat (prefix, source->linktarget (), 0),
+                            concat (prefixURL, source->linktarget (), 0),
                             IO_STREAM_HARDLINK);
        /* FIXME: check what tar's filelength is set to for hardlinks */
        source->skip_file ();
index 22d2d2fd795df3bffcae122335918e9ac6aa1653..dbf4c7afd3e36be979bcb3698470915bc685878b 100644 (file)
--- a/archive.h
+++ b/archive.h
@@ -50,11 +50,11 @@ public:
    * The stream is not taken over - it will not be automatically deleted
    */
   virtual io_stream *extract_file () = NULL;
-  /* extract the next file to the given prefix in one step, and name it with the
+  /* extract the next file to the given prefixURL+Path in one step, and name it with the
    * given suffix.
    * returns 1 on failure.
    */
-  static int extract_file (archive *, const char *, const char * = NULL);
+  static int extract_file (archive *, const char *, const char *, const char * = NULL);
 
   /* 
    * To create a stream that will be compressed, you should open the url, and then get a new stream
index 895d0fa2c684a1f91db16421d310976aa0ef9c2a..5b460f6a0a0cf3b641486f71beea75f5f864d4dd 100644 (file)
@@ -114,7 +114,7 @@ static int num_installs, num_replacements, num_uninstalls;
 static void uninstall_one (packagemeta &);
 static int replace_one (packagemeta &);
 static int install_one_source (packagemeta &, packagesource &, char const *,
-                              package_type_t);
+                              char const *, package_type_t);
 static bool rebootneeded;
 
 /* FIXME: upgrades should be a method too */
@@ -144,7 +144,7 @@ replace_one (packagemeta & pkg)
   pkg.uninstall ();
 
   errors +=
-    install_one_source (pkg, pkg.desired->bin, "cygfile:///", package_binary);
+    install_one_source (pkg, pkg.desired->bin, "cygfile://","/", package_binary);
   if (!errors)
     pkg.installed = pkg.desired;
   num_replacements++;
@@ -155,7 +155,7 @@ replace_one (packagemeta & pkg)
 /* install one source at a given prefix. */
 static int
 install_one_source (packagemeta & pkgm, packagesource & source,
-                   char const *prefix, package_type_t type)
+                   char const *prefixURL, char const *prefixPath, package_type_t type)
 {
   int errors = 0;
   Progress.SetText2 (source.Base ());
@@ -205,14 +205,14 @@ install_one_source (packagemeta & pkgm, packagesource & source,
            lst->write (concat (fn, "\n", 0), strlen (fn) + 1);
 
          /* FIXME: concat leaks memory */
-         Progress.SetText3 (concat (prefix, fn, 0));
-         log (LOG_BABBLE, "Installing file %s%s", prefix, fn);
-         if (archive::extract_file (thefile, prefix) != 0)
+         Progress.SetText3 (concat (prefixPath, fn, 0));
+         log (LOG_BABBLE, "Installing file %s%s%s", prefixURL,prefixPath, fn);
+         if (archive::extract_file (thefile, prefixURL, prefixPath) != 0)
            {
              //extract to temp location
-             if (archive::extract_file (thefile, prefix, ".new") != 0)
+             if (archive::extract_file (thefile, prefixURL, prefixPath, ".new") != 0)
                {
-                 log (0, "Unable to install file %s%s", prefix, fn);
+                 log (0, "Unable to install file %s%s%s", prefixURL,prefixPath, fn);
                  errors++;
                }
              else
@@ -321,14 +321,14 @@ install_one (packagemeta & pkg)
   if (pkg.installed != pkg.desired && pkg.desired->binpicked)
     {
       errors +=
-       install_one_source (pkg, pkg.desired->bin, "cygfile:///",
+       install_one_source (pkg, pkg.desired->bin, "cygfile://","/",
                            package_binary);
       if (!errors)
        pkg.installed = pkg.desired;
     }
   if (pkg.desired->srcpicked)
     errors +=
-      install_one_source (pkg, pkg.desired->src, "cygfile:///usr/src",
+      install_one_source (pkg, pkg.desired->src, "cygfile://","/usr/src",
                          package_source);
 
   /* FIXME: make a upgrade method and reinstate this */
index 3ab1baae6036a146a621e5bd064363d791f3ab2f..2e3ab5af21ee689a3c10211bbcb81b92a8938c4d 100644 (file)
@@ -111,6 +111,7 @@ int
 io_stream::mklink (const char *from, const char *to,
                   io_stream_link_t linktype)
 {
+  log (LOG_BABBLE, "io_stream::mklink (%s->%s)", from, to);
   if (!from || IsBadStringPtr (from, MAX_PATH) ||
       !to || IsBadStringPtr (to, MAX_PATH))
     {
This page took 0.04595 seconds and 5 git commands to generate.