Sfoglia il codice sorgente

Added new PROCNOERR flag, which disabled the error message that is
displayed when a process has an error return.

Adam Heath 25 anni fa
parent
commit
68b56dc4ed
5 ha cambiato i file con 19 aggiunte e 6 eliminazioni
  1. 6 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 1 0
      include/dpkg.h.in
  4. 6 4
      lib/mlib.c
  5. 4 2
      main/archives.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Mon Apr 23 16:09:38 CDT 2001 Adam Heath <doogie@debian.org>
+
+  * include/dpkg.h.in, lib/mlib.c, main/archives.c, debian/changelog: Added
+    new PROCNOERR flag, which disabled the error message that is displayed
+    when a process has an error return.
+
 Mon Apr 23 22:26:23 CEST 2001 Wichert Akkerman <wakkerma@debian.org>
 
   * main/dpkg.8: note that force-overwrite is not enabled per default

+ 2 - 0
debian/changelog

@@ -94,6 +94,8 @@ dpkg (1.9.0) unstable; urgency=low
     files. Closes: Bug#75562
   * Change dpkg manpage to reflect that --force-statoveride is no enabled
     by default. Closes: Bug#95023
+  * Handle dangling symlinks, by ignoring error code 1 from find, when
+    processing --recursive. Closes: Bug#4784
 
  -- Wichert Akkerman <wakkerma@debian.org>  Sat, 13 Jan 2001 08:52:11 -0500
 

+ 1 - 0
include/dpkg.h.in

@@ -197,6 +197,7 @@ void m_pipe(int fds[2]);
 
 #define PROCPIPE 1
 #define PROCWARN 2
+#define PROCNOERR 4
 int checksubprocerr(int status, const char *description, int flags);
 int waitsubproc(pid_t pid, const char *description, int flags);
 

+ 6 - 4
lib/mlib.c

@@ -107,10 +107,12 @@ int checksubprocerr(int status, const char *description, int flags) {
   int n;
   if (WIFEXITED(status)) {
     n= WEXITSTATUS(status); if (!n) return n;
-    if(flags & PROCWARN)
-      fprintf(stderr, _("dpkg: warning - %s returned error exit status %d\n"),description,n);
-    else
-      ohshit(_("subprocess %s returned error exit status %d"),description,n);
+    if(!(flags & PROCNOERR)) {
+      if(flags & PROCWARN)
+        fprintf(stderr, _("dpkg: warning - %s returned error exit status %d\n"),description,n);
+      else
+        ohshit(_("subprocess %s returned error exit status %d"),description,n);
+    }
   } else if (WIFSIGNALED(status)) {
     n= WTERMSIG(status); if (!n || ((flags & PROCPIPE) && n==SIGPIPE)) return 0;
     if (flags & PROCWARN)

+ 4 - 2
main/archives.c

@@ -759,7 +759,7 @@ void archivefiles(const char *const *argv) {
   const char *volatile thisarg;
   const char *const *volatile argp;
   jmp_buf ejbuf;
-  int pi[2], fc, nfiles, c, i;
+  int pi[2], fc, nfiles, c, i, r;
   FILE *pf;
   static struct varbuf findoutput;
   const char **arglist;
@@ -819,7 +819,9 @@ void archivefiles(const char *const *argv) {
     }
     if (ferror(pf)) ohshite(_("error reading find's pipe"));
     if (fclose(pf)) ohshite(_("error closing find's pipe"));
-    waitsubproc(fc,"find",0);
+    r= waitsubproc(fc,"find",PROCNOERR);
+    if(!(r==0 || r==1))
+      ohshit(_("find for --recurisve returned unhandled error %i"),r);
 
     if (!nfiles)
       ohshit(_("searched, but found no packages (files matching *.deb)"));