Просмотр исходного кода

* Removed references to dpkg(5) which seems to not exist anymore
* Fixed `dpkg-deb --help' and dpkg-deb(1) from reporting --no-check
when it's actually --nocheck (went with the hardcoded option, so
this is just a documentation fix).
* Added better check in disk.setup for a working NFS server. Makes
it compatible with other non-Linux servers.
* Corrected dpkg(8)'s example of using dpkg -i (showed it used with
a .tar.gz instead of a .deb)
* Applied patch to correct improper TMPDIR handling in dpkg-deb
* When encountering an error in extracting the tar archives in the
packages, we should abort the install, not simply give an error
and continue.
* Make dpkg give the builtin arch if there was an error while exec()'ing
the C compiler with --print-architecture. We still fail if the
output from gcc was bad in some way, since they may be of importance.

Ben Collins лет назад: 27
Родитель
Сommit
21a3526cac
8 измененных файлов с 59 добавлено и 12 удалено
  1. 11 0
      ChangeLog
  2. 12 1
      debian/changelog
  3. 17 4
      dpkg-deb/build.c
  4. 4 2
      dpkg-deb/info.c
  5. 1 1
      main/dpkg.8
  6. 11 1
      main/enquiry.c
  7. 2 2
      main/processarc.c
  8. 1 1
      methods/disk.setup

+ 11 - 0
ChangeLog

@@ -4,6 +4,17 @@ Sun Oct 17 13:40:46 EDT 1999 Ben Collins <bcollins.debian.org>
   * Fixed `dpkg-deb --help' and dpkg-deb(1) from reporting --no-check
     when it's actually --nocheck (went with the hardcoded option, so
     this is just a documentation fix).
+  * Added better check in disk.setup for a working NFS server. Makes
+    it compatible with other non-Linux servers.
+  * Corrected dpkg(8)'s example of using dpkg -i (showed it used with
+    a .tar.gz instead of a .deb)
+  * Applied patch to correct improper TMPDIR handling in dpkg-deb
+  * When encountering an error in extracting the tar archives in the
+    packages, we should abort the install, not simply give an error
+    and continue.
+  * Make dpkg give the builtin arch if there was an error while exec()'ing
+    the C compiler with --print-architecture. We still fail if the
+    output from gcc was bad in some way, since they may be of importance.
 
 Sun Oct 17 11:51:36 CEST 1999 Wichert Akkerman <wakkerma@debian.org>
 

+ 12 - 1
debian/changelog

@@ -8,11 +8,22 @@ dpkg (1.4.1.17) unstable; urgency=low
   * Updated the deb-control(5) man page with all the current fields
     and uses
   * Made the large info screen show 5 lines of the pkglist so that
-    it scrolled properly, and still showed the cursor
+    it scrolled properly, and still showed the cursor in dselect
   * Removed references to dpkg(5) which seems to not exist anymore
   * Fixed `dpkg-deb --help' and dpkg-deb(1) from reporting --no-check
     when it's actually --nocheck (went with the hardcoded option, so
     this is just a documentation fix).
+  * Added better check in disk.setup for a working NFS server. Makes
+    it compatible with other non-Linux servers.
+  * Corrected dpkg(8)'s example of using dpkg -i (showed it used with
+    a .tar.gz instead of a .deb)
+  * Applied patch to correct improper TMPDIR handling in dpkg-deb
+  * When encountering an error in extracting the tar archives in the
+    packages, we should abort the install, not simply give an error
+    and continue.
+  * Make dpkg give the builtin arch if there was an error while exec()'ing
+    the C compiler with --print-architecture. We still fail if the
+    output from gcc was bad in some way, since they may be of importance.
 
  -- Wichert Akkerman <wakkerma@debian.org>  UNRELEASED
 

+ 17 - 4
dpkg-deb/build.c

@@ -57,13 +57,13 @@ void do_build(const char *const *argv) {
     PREINSTFILE, POSTINSTFILE, PRERMFILE, POSTRMFILE, 0
   };
   
-  char *m;
+  char *m, *tmpd, *tmpf;
   const char *debar, *directory, *const *mscriptp, *versionstring, *arch;
   char *controlfile;
   struct pkginfo *checkedinfo;
   struct arbitraryfield *field;
   FILE *ar, *gz, *cf;
-  int p1[2],p2[2], warns, errs, n, c, subdir;
+  int p1[2],p2[2], warns, errs, n, c, subdir, gzfd;
   pid_t c1,c2,c3,c4,c5;
   struct stat controlstab, datastab, mscriptstab, debarstab;
   char conffilename[MAXCONFFILENAME+1];
@@ -209,7 +209,16 @@ void do_build(const char *const *argv) {
     execlp(TAR,"tar","-cf","-",".",(char*)0); ohshite(_("failed to exec tar -cf"));
   }
   close(p1[1]);
-  if (!(gz= tmpfile())) ohshite(_("failed to make tmpfile (control)"));
+
+  if (!(tmpd = getenv("TMPDIR")))
+    tmpd= "/tmp";
+  tmpf= malloc(strlen(tmpd) + strlen("/dpkg.XXXXXX"));
+  strcpy(tmpf, tmpd);
+  strcat(tmpf, "/dpkg.XXXXXX");
+  if (!(gzfd= mkstemp(tmpf)) || !(gz= fdopen(gzfd, "r+")))
+    ohshite(_("failed to make tmpfile (control)"));
+
+
   if (!(c2= m_fork())) {
     m_dup2(p1[0],0); m_dup2(fileno(gz),1); close(p1[0]);
     execlp(GZIP,"gzip","-9c",(char*)0); ohshite(_("failed to exec gzip -9c"));
@@ -246,8 +255,12 @@ void do_build(const char *const *argv) {
   
   if (!oldformatflag) {
     fclose(gz);
-    if (!(gz= tmpfile())) ohshite(_("failed to make tmpfile (data)"));
+    strcpy(tmpf, tmpd);
+    strcat(tmpf, "/dpkg.XXXXXX");
+    if (!(gzfd= mkstemp(tmpf)) || !(gz= fdopen(gzfd, "r+")))
+      ohshite(_("failed to make tmpfile (data)"));
   }
+  free(tmpf);
   m_pipe(p2);
   if (!(c4= m_fork())) {
     m_dup2(p2[1],1); close(p2[0]); close(p2[1]);

+ 4 - 2
dpkg-deb/info.c

@@ -59,12 +59,13 @@ static void info_prepare(const char *const **argvp,
                          const char **debarp,
                          const char **directoryp,
                          int admininfo) {
-  static char dbuf[L_tmpnam];
+  char *dbuf;
   pid_t c1;
   
   *debarp= *(*argvp)++;
   if (!*debarp) badusage(_("--%s needs a .deb filename argument"),cipaction->olong);
-  if (!tmpnam(dbuf)) ohshite(_("failed to make temporary filename"));
+  dbuf = tempnam(NULL, "dpkg");
+  if (!dbuf) ohshite(_("failed to make temporary filename"));
   *directoryp= dbuf;
 
   if (!(c1= m_fork())) {
@@ -73,6 +74,7 @@ static void info_prepare(const char *const **argvp,
   waitsubproc(c1,"rm -rf",0);
   push_cleanup(cu_info_prepare,-1, 0,0, 1, (void*)dbuf);
   extracthalf(*debarp, dbuf, "mx", admininfo);
+  free(dbuf);
 }
 
 static int ilist_select(const struct dirent *de) {

+ 1 - 1
main/dpkg.8

@@ -516,7 +516,7 @@ CDROM.  The "available" file shows that the vim package is in section
 "editors":
 .br
 \fB     cd /cdrom/hamm/hamm/binary/editors\fP
-\fB     dpkg -i vim_4.5-3.tar.gz\fP
+\fB     dpkg -i vim_4.5-3.deb\fP
 .br
 
 To make a local copy of the package selection states:

+ 11 - 1
main/enquiry.c

@@ -634,7 +634,17 @@ void printarch(const char *const *argv) {
   if (!(c1= m_fork())) {
     m_dup2(p1[1],1); close(p1[0]); close(p1[1]);
     execlp(ccompiler,ccompiler,"--print-libgcc-file-name",(char*)0);
-    ohshite(_("failed to exec C compiler `%.250s'"),ccompiler);
+    /* if we have a problem excuting the C compiler, we don't
+     * want to fail. If there is a problem with the compiler,
+     * like not being installed, or CC being set incorrectly,
+     * then important problems will show up elsewhere, not in
+     * dpkg. If a C compiler is not important to the reason we
+     * are being called, then we should just give them the built
+     * in arch.
+     */
+    if (printf("%s\n",architecture) == EOF) werr("stdout");
+    if (fflush(stdout)) werr("stdout");
+    exit 0;
   }
   close(p1[1]);
   while ((c= getc(ccpipe)) != EOF) varbufaddc(&vb,c);

+ 2 - 2
main/processarc.c

@@ -533,9 +533,9 @@ void process_archive(const char *filename) {
       ohshite(_("error reading dpkg-deb tar output"));
     } else if (feof(tc.backendpipe)) {
       waitsubproc(c1,BACKEND " --fsys-tarfile (EOF)",1);
-      ohshit(_("unexpected EOF in filesystem tarfile - corrupted package archive"));
+      ohshite(_("unexpected EOF in filesystem tarfile - corrupted package archive"));
     } else {
-      ohshit(_("corrupted filesystem tarfile - corrupted package archive"));
+      ohshite(_("corrupted filesystem tarfile - corrupted package archive"));
     }
   }
   tmpf= tc.backendpipe;

+ 1 - 1
methods/disk.setup

@@ -236,7 +236,7 @@ then
 		if [ -z "$response" ]; then continue; fi
 		if [ -x /usr/bin/rpcinfo ]
 		then
-			if rpcinfo -u "$response" mountd >/dev/null
+			if rpcinfo -u "$response" mountd | grep -q 'ready'
 			then
 				nfsserver="$response"
 			else