This is the mail archive of the cygwin@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: setup.exe ==> source directory mess (?)


Yesterday, DJ Delorie wrote:
> OK, then /oss/src/cygwin/src/configure should have been correct.  A
> plain "make" there should have built libiberty, newlib, and winsup.

yeah, I'll chalk it up to a learning experience... never try to short
cut the process - I've no idea what the difference was but the
first time I did it libiberty wasn't configured... I nuked it all and
started over... no problems this time.

Here then is the patch to accomplish the /usr/src change this thread
started. In testing this I did observe two things: one that some
packages have src/ in the front of the source paths... crypt is one,
such that you end up with /usr/src/src/crypt-1.0/*... I don't think
this is "normal" source packaging... but if it is a solution similar
to what is used for /usr/bin and /usr/lib can be put in. The second
item I noticed is that the source package sizes are not included in
the total download or install totals, making the progress bars finish
way too soon.  I fixed those in this patch as well.


2001-03-10  Chris Abbey  <chris_abbey@yahoo.com>

	* install.cc: install sources into /usr/src instead
	  of /, also include the sizes of source tarballs
	  in total_bytes.
	* download.cc: include sizes of source tarballs in
	  total_download_bytes.

-- 
now the forces of openness have a powerful and
  unexpected new ally - http://ibm.com/linux
Index: install.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/install.cc,v
retrieving revision 2.9
diff -u -b -r2.9 install.cc
--- install.cc	2000/11/09 01:40:15	2.9
+++ install.cc	2001/03/10 09:08:06
@@ -174,6 +174,7 @@
   "/usr",
   "/usr/bin",
   "/usr/lib",
+  "/usr/src",
   "/usr/local",
   "/usr/local/bin",
   "/usr/local/etc",
@@ -208,17 +209,18 @@
 }
 
 char *
-map_filename (char *fn)
+map_filename (char *fn, const char *extra = 0)
 {
   char *dest_file;
+  char *root_dir_with_extra = concat (root_dir, extra, 0);
   while (*fn == '/' || *fn == '\\')
     fn++;
   if (strncmp (fn, "usr/bin/", 8) == 0)
-    dest_file = concat (root_dir, "/bin/", fn+8, 0);
+    dest_file = concat (root_dir_with_extra, "/bin/", fn+8, 0);
   else if (strncmp (fn, "usr/lib/", 8) == 0)
-    dest_file = concat (root_dir, "/lib/", fn+8, 0);
+    dest_file = concat (root_dir_with_extra, "/lib/", fn+8, 0);
   else
-    dest_file = concat (root_dir, "/", fn, 0);
+    dest_file = concat (root_dir_with_extra, "/", fn, 0);
   return dest_file;
 }
 
@@ -284,7 +286,7 @@
 
 	  
 static int
-install_one (char *name, char *file, int file_size, int action)
+install_one (char *name, char *file, int file_size, int action, BOOL isSrc)
 {
   int errors = 0;
   char *local = file, *cp, *fn, *base;
@@ -328,7 +330,7 @@
       if (lst)
 	gzprintf (lst, "%s\n", fn);
 
-      dest_file = map_filename (fn);
+      dest_file = map_filename (fn, isSrc?"/usr/src":NULL);
 
       SetWindowText (ins_filename, dest_file);
       log (LOG_BABBLE, "Installing file %s", dest_file);
@@ -394,6 +396,8 @@
   LOOP_PACKAGES
     {
       total_bytes += pi.install_size;
+      if (package[i].srcaction == SRCACTION_YES)
+        total_bytes += pi.source_size;
     }
 
   for (i=0; i<npackages; i++)
@@ -409,10 +413,10 @@
 	   || package[i].action == ACTION_UPGRADE)
 	  && pi.install)
 	{
-	  int e = install_one (package[i].name, pi.install, pi.install_size, package[i].action);
+	  int e = install_one (package[i].name, pi.install, pi.install_size, package[i].action, FALSE);
 	  if (package[i].srcaction == SRCACTION_YES && pi.source)
 	    e += install_one (concat (package[i].name, "-src", 0), pi.source, pi.source_size,
-			      package[i].action);
+			      package[i].action, TRUE);
 	  if (e)
 	    {
 	      package[i].action = ACTION_ERROR;
Index: download.cc
===================================================================
RCS file: /cvs/src/src/winsup/cinstall/download.cc,v
retrieving revision 2.9
diff -u -b -r2.9 download.cc
--- download.cc	2001/03/06 18:32:15	2.9
+++ download.cc	2001/03/10 09:08:06
@@ -103,6 +103,8 @@
     if (package[i].action == ACTION_NEW || package[i].action == ACTION_UPGRADE)
       {
         total_download_bytes += pi.install_size;
+        if (package[i].srcaction == SRCACTION_YES)
+          total_download_bytes += pi.source_size;
       }
 
   for (i=0; i<npackages; i++)
--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]