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

dpkg (1.1.5); priority=MEDIUM (HIGH for diversions users)

  * Fixed coredump when using diversions.  (Bug#2603.)
  * Fixed typo in dpkg-divert which could lose diversions.  (Bug#2662.)

  * diversions.text provides better examples.

 -- Ian Jackson <ian@chiark.chu.cam.ac.uk>  Wed, 10 Apr 1996 13:59:30 +0100
Ian Jackson лет назад: 30
Родитель
Сommit
b51c2b656d
8 измененных файлов с 34 добавлено и 16 удалено
  1. 9 0
      debian.Changelog
  2. 1 1
      debian.rules
  3. 10 5
      doc/diversions.text
  4. 6 2
      main/filesdb.c
  5. 3 3
      main/filesdb.h
  6. 1 1
      main/main.c
  7. 3 3
      scripts/dpkg-divert.pl
  8. 1 1
      version.h

+ 9 - 0
debian.Changelog

@@ -1,3 +1,12 @@
+dpkg (1.1.5); priority=MEDIUM (HIGH for diversions users)
+
+  * Fixed coredump when using diversions.  (Bug#2603.)
+  * Fixed typo in dpkg-divert which could lose diversions.  (Bug#2662.)
+
+  * diversions.text provides better examples.
+
+ -- Ian Jackson <ian@chiark.chu.cam.ac.uk>  Wed, 10 Apr 1996 13:59:30 +0100
+
 dpkg (1.1.4); priority=MEDIUM
 
   * Allow overwriting of conflicting packages being removed.  (Bug#2614.)

+ 1 - 1
debian.rules

@@ -1,7 +1,7 @@
 #!/usr/bin/make -f
 
 package=dpkg
-version=1.1.4
+version=1.1.5
 
 archi=$(shell dpkg --print-architecture)
 DIR:=$(shell pwd)

+ 10 - 5
doc/diversions.text

@@ -1,5 +1,6 @@
 (These messages have been edited to conform to the terminology
-eventually decided on.)
+eventually decided on, and to make them give better and clearer
+examples.)
 
 ------- start of digest (2 messages) (RFC 934 encapsulation) -------
 Resent-Message-Id: <m0tcceI-0002c6C@chiark.chu.cam.ac.uk>
@@ -100,12 +101,16 @@ diagrammatically:
      |  ...              |                 \____________________/
      |...................|
      |preinst:           |
-     | dpkg-divert --divert /bin/ls.mono \
-     |   --package colour-ls /bin/ls
+     | case "$1" in install)
+     |  dpkg-divert --rename --divert /bin/ls.mono \
+     |              --package colour-ls /bin/ls ;;
+     | esac              |
      |...................|
      |postrm:            |
-     | dpkg-divert --remove --divert /bin/ls.mono \
-     |   --package colour-ls /bin/ls
+     | case "$1" in remove|abort-install)
+     |   dpkg-divert --remove --rename --divert /bin/ls.mono \
+     |               --package colour-ls /bin/ls ;;
+     | esac              |
      |___________________|
 
 We need a name that applies to `/usr/sbin/smail.real' and

+ 6 - 2
main/filesdb.c

@@ -338,9 +338,10 @@ void ensure_diversions(void) {
   diversionsfile= file;
 
   for (ov= diversions; ov; ov= ov->next) {
+    ov->useinstead->divert->camefrom->divert= 0;
     ov->useinstead->divert= 0;
-    ov->camefrom->divert= 0;
   }
+  diversions= 0;
   if (!file) { onerr_abort--; return; }
 
   while (fgets(linebuf,sizeof(linebuf),file)) {
@@ -375,10 +376,13 @@ void ensure_diversions(void) {
 
     if (oialtname->camefrom->divert || oicontest->useinstead->divert)
       ohshit("conflicting diversions involving `%.250s' or `%.250s'",
-             oicontest->camefrom->name, oicontest->useinstead->name);
+             oialtname->camefrom->name, oicontest->useinstead->name);
 
     oialtname->camefrom->divert= oicontest;
     oicontest->useinstead->divert= oialtname;
+
+    oicontest->next= diversions;
+    diversions= oicontest;
   }
   if (ferror(file)) ohshite("read error in diversions [i]");
 

+ 3 - 3
main/filesdb.h

@@ -75,15 +75,15 @@ struct diversion {
    * instead.  Both files have entries in the filesdb database, and
    * they refer to each other via these diversion structures.
    *
-   * The contended filename's filenamenode has an diversion entry
+   * The contested filename's filenamenode has an diversion entry
    * with useinstead set to point to the redirected filename's
    * filenamenode; the redirected filenamenode has camefrom set to the
-   * contended filenamenode.  Both sides' diversion entries will
+   * contested filenamenode.  Both sides' diversion entries will
    * have pkg set to the package (if any) which is allowed to use the
    * contended filename.
    *
    * Packages that contain either version of the file will all
-   * refer to the contended filenamenode in their per-file package lists
+   * refer to the contested filenamenode in their per-file package lists
    * (both in core and on disk).  References are redirected to the other
    * filenamenode's filename where appropriate.
    */

+ 1 - 1
main/main.c

@@ -90,7 +90,7 @@ const struct cmdinfo *cipaction= 0;
 int f_pending=0, f_recursive=0, f_alsoselect=1, f_skipsame=0, f_noact=0;
 int f_autodeconf=0, f_largemem=0;
 unsigned long f_debug=0;
-int fc_downgrade=1, fc_configureany=0, fc_hold=0, fc_removereinstreq=0, fc_overwrite= 0;
+int fc_downgrade=1, fc_configureany=0, fc_hold=0, fc_removereinstreq=0, fc_overwrite=1;
 int fc_removeessential=0, fc_conflicts=0, fc_depends=0, fc_dependsversion=0;
 int fc_autoselect=1, fc_badpath=0, fc_overwritediverted=0, fc_architecture=0;
 

+ 3 - 3
scripts/dpkg-divert.pl

@@ -133,11 +133,11 @@ if ($mode eq 'add') {
         $orgfile= $contest[$i];
         $orgdivertto= $altname[$i];
         @contest= (($i > 0 ? @contest[0..$i-1] : ()),
-                   ($i < $#contest ? @contest[$i+1,$#contest] : ()));
+                   ($i < $#contest ? @contest[$i+1..$#contest] : ()));
         @altname= (($i > 0 ? @altname[0..$i-1] : ()),
-                   ($i < $#altname ? @altname[$i+1,$#altname] : ()));
+                   ($i < $#altname ? @altname[$i+1..$#altname] : ()));
         @package= (($i > 0 ? @package[0..$i-1] : ()),
-                   ($i < $#package ? @package[$i+1,$#package] : ()));
+                   ($i < $#package ? @package[$i+1..$#package] : ()));
         &checkrename($orgdivertto,$orgfile);
         &dorename($orgdivertto,$orgfile);
         &save;

+ 1 - 1
version.h

@@ -1 +1 @@
-#define DPKG_VERSION "1.1.4" /* This line modified by Makefile */
+#define DPKG_VERSION "1.1.5" /* This line modified by Makefile */