[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

misc dpkg changes(improvements)



Here's the changelog, of my minor improvements

dpkg (1.7.1.2) unstable; urgency=low

  * Decrease memory usage when building a deb(don't store normal filenames
    for later piping to tar, but send them right away).
  * Remove another exec(cat) from dpkg-deb/build.c.
  * debian/rules now uses the freshly built dpkg binaries and scripts
    to build itself.  You don't have to hand install dpkg to build dpkg
    now.

 -- Adam Heath <doogie@debian.org>  Fri, 10 Nov 2000 02:14:32 -0600

I built 1.7.1.2 dpkg debs, using dpkg itself, so I'm fairly sure the last item
above is correct.  The first item is mostly tested, but I haven't yet tested
it on a library, where it is most important.

----BEGIN GEEK CODE BLOCK----
Version: 3.12
GCS d- s: a-- c+++ UL++++ P+ L++++ !E W+ M o+ K- W--- !O M- !V PS--
PE++ Y+ PGP++ t* 5++ X+ tv b+ D++ G e h*! !r z?
-----END GEEK CODE BLOCK-----
----BEGIN PGP INFO----
Adam Heath <doogie@debian.org>        Finger Print | KeyID
67 01 42 93 CA 37 FB 1E    63 C9 80 1D 08 CF 84 0A | DE656B05 PGP
AD46 C888 F587 F8A3 A6DA  3261 8A2C 7DC2 8BD4 A489 | 8BD4A489 GPG
-----END PGP INFO-----
diff -ruN dpkg-1.7.1.1/debian/changelog dpkg-1.7.1.2/debian/changelog
--- dpkg-1.7.1.1/debian/changelog	Tue Nov  7 19:47:33 2000
+++ dpkg-1.7.1.2/debian/changelog	Fri Nov 10 02:14:41 2000
@@ -1,3 +1,14 @@
+dpkg (1.7.1.2) unstable; urgency=low
+
+  * Decrease memory usage when building a deb(don't store normal filenames
+    for later piping to tar, but send them right away).
+  * Remove another exec(cat) from dpkg-deb/build.c.
+  * debian/rules now uses the freshly built dpkg binaries and scripts
+    to build itself.  You don't have to hand install dpkg to build dpkg
+    now.
+
+ -- Adam Heath <doogie@debian.org>  Fri, 10 Nov 2000 02:14:32 -0600
+
 dpkg (1.7.1.1) unstable; urgency=medium
 
   * Archtable did not contain powerpc-linux-gnu.  This messed up
diff -ruN dpkg-1.7.1.1/debian/rules dpkg-1.7.1.2/debian/rules
--- dpkg-1.7.1.1/debian/rules	Sun Nov  5 10:47:45 2000
+++ dpkg-1.7.1.2/debian/rules	Fri Nov 10 01:54:12 2000
@@ -2,13 +2,19 @@
 # vim: nowrap ts=8
 
 # Build locations
-BUILD		:= $(shell pwd)/build
-TMP		:= $(shell pwd)/debian/tmp
+pwd		:= $(shell pwd)
+BUILD		:= $(pwd)/build
+TMP		:= $(pwd)/debian/tmp
 TMP_DPKG	:= $(TMP)-dpkg
 TMP_DPKG_DEV	:= $(TMP)-dpkg-dev
 TMP_DPKG_DOC	:= $(TMP)-dpkg-doc
 DIR		:= $(shell pwd)
 
+DPKG-DEB	:= $(BUILD)/dpkg-deb/dpkg-deb
+SHLIPDEPS	:= perl -I $(BUILD)/scripts $(BUILD)/scripts/dpkg-shlibdeps
+DISTADDFILE	:= perl -I $(BUILD)/scripts $(BUILD)/scripts/dpkg-distaddfile
+GENCONTROL	:= perl -I $(pwd)/scripts $(pwd)/scripts/dpkg-gencontrol.pl
+
 # We should really get this in a different way...
 DEB_BUILD_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE 2> /dev/null || true)
 DEB_HOST_GNU_TYPE	:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE 2> /dev/null || true)
@@ -131,12 +137,12 @@
 	install -p -m 755 -o root -g root debian/dpkg.prerm $(TMP_DPKG)/DEBIAN/prerm
 	install -p -m 755 -o root -g root debian/dpkg.postinst $(TMP_DPKG)/DEBIAN/postinst
 
-	dpkg-shlibdeps -dPre-Depends -Tdebian/dpkg.substvars \
+	$(SHLIPDEPS) -dPre-Depends -Tdebian/dpkg.substvars \
 		$(TMP_DPKG)/usr/bin/dpkg $(TMP_DPKG)/usr/bin/dselect \
 		$(TMP_DPKG)/sbin/start-stop-daemon
-	perl -I `pwd`/scripts scripts/dpkg-gencontrol.pl -isp \
+	$(GENCONTROL) -isp \
 		-Tdebian/dpkg.substvars -pdpkg -P$(TMP_DPKG)
-	dpkg --build $(TMP_DPKG) ..
+	$(DPKG-DEB) --build $(TMP_DPKG) ..
 
 binary-dpkg-dev: stamp-binary
 	rm -rf $(TMP_DPKG_DEV)
@@ -198,9 +204,9 @@
 	install -p -m 755 -o root -g root debian/dpkg-dev.prerm $(TMP_DPKG_DEV)/DEBIAN/prerm
 	install -p -m 755 -o root -g root debian/dpkg-dev.postinst $(TMP_DPKG_DEV)/DEBIAN/postinst
 
-	perl -I `pwd`/scripts scripts/dpkg-gencontrol.pl -isp \
+	$(GENCONTROL) -isp \
 		-Tdebian/dpkg-dev.substvars -pdpkg-dev -P$(TMP_DPKG_DEV)
-	dpkg --build $(TMP_DPKG_DEV) ..
+	$(DPKG-DEB) --build $(TMP_DPKG_DEV) ..
 
 binary-dpkg-doc: stamp-binary
 	rm -rf $(TMP_DPKG_DOC)
@@ -226,9 +232,9 @@
 	install -p -m 755 -o root -g root debian/dpkg-doc.prerm $(TMP_DPKG_DOC)/DEBIAN/prerm
 	install -p -m 755 -o root -g root debian/dpkg-doc.postinst $(TMP_DPKG_DOC)/DEBIAN/postinst
 
-	perl -I `pwd`/scripts scripts/dpkg-gencontrol.pl -isp \
+	$(GENCONTROL) -isp \
 		-Tdebian/dpkg-dev.substvars -pdpkg-doc -P$(TMP_DPKG_DOC)
-	dpkg --build $(TMP_DPKG_DOC) ..
+	$(DPKG-DEB) --build $(TMP_DPKG_DOC) ..
 
 binary-arch: binary-dpkg
 	set -e ; \
@@ -236,15 +242,15 @@
 	f=dpkg-$${v}_$(arch).nondebbin.tar ; \
 	tar -C $(TMP_DPKG) -cf $(DIR)/../$$f usr var ; \
 	gzip -9f ../$$f ; \
-	dpkg-distaddfile -fdebian/files $$f.gz byhand -
+	$(DISTADDFILE) -fdebian/files $$f.gz byhand -
 
 binary-indep: binary-dpkg-dev binary-dpkg-doc
 	set -e ; set -x ; \
 	v=`sed -n 's/^Version: //p' $(TMP_DPKG_DEV)/DEBIAN/control`; \
 	f=dpkg-$${v}.tar.gz ; \
 	if [ -f ../dpkg_$${v}.tar.gz ] ; then \
-	    	cp ../dpkg_$${v}.tar.gz ../$$f ; \
-		dpkg-distaddfile -fdebian/files  $$f byhand - ; \
+		cp ../dpkg_$${v}.tar.gz ../$$f ; \
+		$(DISTADDFILE) -fdebian/files  $$f byhand - ; \
 	fi
 
 define checkdir
diff -ruN dpkg-1.7.1.1/dpkg-deb/build.c dpkg-1.7.1.2/dpkg-deb/build.c
--- dpkg-1.7.1.1/dpkg-deb/build.c	Tue Aug 22 16:21:59 2000
+++ dpkg-1.7.1.2/dpkg-deb/build.c	Fri Nov 10 02:09:24 2000
@@ -153,8 +153,8 @@
   struct pkginfo *checkedinfo;
   struct arbitraryfield *field;
   FILE *ar, *gz, *cf;
-  int p1[2],p2[2], warns, errs, n, c, subdir, gzfd;
-  pid_t c1,c2,c3,c4,c5;
+  int p1[2],p2[2],p3[2], warns, errs, n, c, subdir, gzfd;
+  pid_t c1,c2,c3;
   struct stat controlstab, datastab, mscriptstab, debarstab;
   char conffilename[MAXCONFFILENAME+1];
   time_t thetime= 0;
@@ -381,30 +381,11 @@
     strcpy(tfbuf,envbuf);
     strcat(tfbuf,"/dpkg.XXXXXX");
   }
-  /* We need to reorder the files so we can make sure that symlinks
-   * will not appear before their target.
-   */
-  m_pipe(p2);
-  if (!(c4= m_fork())) {
-    m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
-    if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
-    execlp(FIND,"find",".","-path","./" BUILDCONTROLDIR,"-prune","-o","-print0",(char*)0);
-    ohshite(_("failed to exec find"));
-  }
-  close(p2[1]);
-  while ((fi=getfi(directory, p2[0]))!=NULL)
-    if (S_ISLNK(fi->st.st_mode))
-      add_to_filist(fi,&symlist,&symlist_end);
-    else
-      add_to_filist(fi,&nosymlist,&nosymlist_end);
-  close(p2[0]);
-  waitsubproc(c4,"find",0);
-
   /* Fork off a tar. We will feed it a list of filenames on stdin later.
    */
   m_pipe(p1);
   m_pipe(p2);
-  if (!(c4= m_fork())) {
+  if (!(c1= m_fork())) {
     m_dup2(p1[0],0); close(p1[0]); close(p1[1]);
     m_dup2(p2[1],1); close(p2[0]); close(p2[1]);
     if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
@@ -414,7 +395,7 @@
   close(p1[0]);
   close(p2[1]);
   /* Of course we should not forget to compress the archive as well.. */
-  if (!(c5= m_fork())) {
+  if (!(c2= m_fork())) {
     char *combuf;
     close(p1[1]);
     m_dup2(p2[0],0); close(p2[0]);
@@ -431,19 +412,39 @@
     ohshite(_("failed to exec gzip %s from tar -cf"), combuf);
   }
   close(p2[0]);
-  /* All the pipes are set, lets feed tar its filenames */
-  for (fi= nosymlist;fi;fi= fi->next)
-    if (write(p1[1], fi->fn, strlen(fi->fn)+1) ==- 1)
-      ohshite(_("failed to write filename to tar pipe (data)"));
+  /* All the pipes are set, now lets run find, and start feeding
+   * filenames to tar.
+   */
+
+  m_pipe(p3);
+  if (!(c3= m_fork())) {
+    m_dup2(p3[1],1); close(p3[0]); close(p3[1]);
+    if (chdir(directory)) ohshite(_("failed to chdir to `%.255s'"),directory);
+    execlp(FIND,"find",".","-path","./" BUILDCONTROLDIR,"-prune","-o","-print0",(char*)0);
+    ohshite(_("failed to exec find"));
+  }
+  close(p3[1]);
+  /* We need to reorder the files so we can make sure that symlinks
+   * will not appear before their target.
+   */
+  while ((fi=getfi(directory, p3[0]))!=NULL)
+    if (S_ISLNK(fi->st.st_mode))
+      add_to_filist(fi,&symlist,&symlist_end);
+    else {
+      if (write(p1[1], fi->fn, strlen(fi->fn)+1) ==- 1)
+	ohshite(_("failed to write filename to tar pipe (data)"));
+    }
+  close(p3[0]);
+  waitsubproc(c3,"find",0);
+
   for (fi= symlist;fi;fi= fi->next)
     if (write(p1[1], fi->fn, strlen(fi->fn)+1) == -1)
       ohshite(_("failed to write filename to tar pipe (data)"));
   /* All done, clean up wait for tar and gzip to finish their job */
   close(p1[1]);
-  free_filist(nosymlist);
   free_filist(symlist);
-  waitsubproc(c5,"gzip -9c from tar -cf",0);
-  waitsubproc(c4,"tar -cf",0);
+  waitsubproc(c2,"gzip -9c from tar -cf",0);
+  waitsubproc(c1,"tar -cf",0);
   /* Okay, we have data.tar.gz as well now, add it to the ar wrapper */
   if (!oldformatflag) {
     if (fstat(gzfd,&datastab)) ohshite("_(failed to fstat tmpfile (data))");
@@ -456,11 +457,7 @@
       werr(debar);
 
     if (lseek(gzfd,0,SEEK_SET)) ohshite(_("failed to rewind tmpfile (data)"));
-    if (!(c3= m_fork())) {
-      m_dup2(gzfd,0); m_dup2(fileno(ar),1);
-      execlp(CAT,"cat",(char*)0); ohshite(_("failed to exec cat (data)"));
-    }
-    waitsubproc(c3,"cat (data)",0);
+    do_fd_copy(gzfd, fileno(ar), _("cat (data)"));
 
     if (datastab.st_size & 1)
       if (putc('\n',ar) == EOF)
diff -ruN dpkg-1.7.1.1/po/dpkg.pot dpkg-1.7.1.2/po/dpkg.pot
--- dpkg-1.7.1.1/po/dpkg.pot	Mon Nov  6 18:16:50 2000
+++ dpkg-1.7.1.2/po/dpkg.pot	Fri Nov 10 02:10:44 2000
@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-11-07 01:16+0100\n"
+"POT-Creation-Date: 2000-11-10 02:10-0600\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -2756,7 +2756,7 @@
 msgid "unable to unbuffer `%.255s'"
 msgstr ""
 
-#: dpkg-deb/build.c:318 dpkg-deb/build.c:390 dpkg-deb/build.c:410
+#: dpkg-deb/build.c:318 dpkg-deb/build.c:391 dpkg-deb/build.c:422
 #, c-format
 msgid "failed to chdir to `%.255s'"
 msgstr ""
@@ -2765,7 +2765,7 @@
 msgid "failed to chdir to .../DEBIAN"
 msgstr ""
 
-#: dpkg-deb/build.c:320 dpkg-deb/build.c:412
+#: dpkg-deb/build.c:320 dpkg-deb/build.c:393
 msgid "failed to exec tar -cf"
 msgstr ""
 
@@ -2818,29 +2818,29 @@
 msgid "failed to unlink tmpfile (data), %s"
 msgstr ""
 
-#: dpkg-deb/build.c:392
-msgid "failed to exec find"
-msgstr ""
-
-#: dpkg-deb/build.c:425
+#: dpkg-deb/build.c:406
 msgid "no compression copy loop"
 msgstr ""
 
-#: dpkg-deb/build.c:431
+#: dpkg-deb/build.c:412
 #, c-format
 msgid "failed to exec gzip %s from tar -cf"
 msgstr ""
 
-#: dpkg-deb/build.c:437 dpkg-deb/build.c:440
+#: dpkg-deb/build.c:424
+msgid "failed to exec find"
+msgstr ""
+
+#: dpkg-deb/build.c:435 dpkg-deb/build.c:442
 msgid "failed to write filename to tar pipe (data)"
 msgstr ""
 
-#: dpkg-deb/build.c:458
+#: dpkg-deb/build.c:459
 msgid "failed to rewind tmpfile (data)"
 msgstr ""
 
-#: dpkg-deb/build.c:461
-msgid "failed to exec cat (data)"
+#: dpkg-deb/build.c:460
+msgid "cat (data)"
 msgstr ""
 
 #: dpkg-deb/extract.c:48

Reply to: