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

Obsolete force/refuse 'auto-select' dpkg option.

Guillem Jover лет назад: 20
Родитель
Сommit
03d44cac22
6 измененных файлов с 30 добавлено и 13 удалено
  1. 8 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 0 3
      man/C/dpkg.1
  4. 5 0
      man/ChangeLog
  5. 15 9
      src/main.c
  6. 1 1
      src/main.h

+ 8 - 0
ChangeLog

@@ -1,3 +1,11 @@
+2006-04-10  Guillem Jover  <guillem@debian.org>
+
+	* src/main.h (fc_autoselect): Remove.
+	* src/main.c (fc_autoselect): Likewise.
+	(forceinfos): Mark 'auto-select' as obsolete.
+	(setforce): Remove mention of 'auto-select' from the help text.
+	Handle obsolete options, and display a warning.
+
 2006-04-09  Guillem Jover  <guillem@debian.org>
 
 	* scripts/dpkg-shlibdeps.pl: Support system library directories

+ 1 - 0
debian/changelog

@@ -38,6 +38,7 @@ dpkg (1.13.18~) UNRELEASED; urgency=low
     '/lib/ldconfig'. Closes: #356452
   * Document that 'dpkg --get-selections' and 'dpkg-query -l' without a
     pattern will not list packages in state purge. Closes: #355633
+  * Obsolete force/refuse 'auto-select' dpkg option.
 
   [ Christian Perrier ]
   * 

+ 0 - 3
man/C/dpkg.1

@@ -333,9 +333,6 @@ your whole system.\fP
 \fBall\fP:
 Turns on(or off) all force options.
 
-\fBauto\-select\fP(*):
-Select packages to install them, and deselect packages to remove them.
-
 \fBdowngrade\fP(*):
 Install a package, even if newer version of it is already installed.
 

+ 5 - 0
man/ChangeLog

@@ -1,3 +1,8 @@
+2006-04-10  Guillem Jover  <guillem@debian.org>
+
+	* C/dpkg.1: Remove mention of obsolete force/refuse 'auto-select'
+	option.
+
 2006-04-09  Guillem Jover  <guillem@debian.org>
 
 	* C/dpkg.1: Document that '--get-selections' without a pattern will

+ 15 - 9
src/main.c

@@ -135,7 +135,7 @@ unsigned long f_debug=0;
 /* Change fc_overwrite to 1 to enable force-overwrite by default */
 int fc_downgrade=1, fc_configureany=0, fc_hold=0, fc_removereinstreq=0, fc_overwrite=0;
 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;
+int fc_badpath=0, fc_overwritediverted=0, fc_architecture=0;
 int fc_nonroot=0, fc_overwritedir=0, fc_conff_new=0, fc_conff_miss=0;
 int fc_conff_old=0, fc_conff_def=0;
 int fc_badverify = 0;
@@ -161,7 +161,6 @@ static const struct forceinfo {
   { "confmiss",            &fc_conff_miss               },
   { "depends",             &fc_depends                  },
   { "depends-version",     &fc_dependsversion           },
-  { "auto-select",         &fc_autoselect               },
   { "bad-path",            &fc_badpath                  },
   { "not-root",            &fc_nonroot                  },
   { "overwrite",           &fc_overwrite                },
@@ -169,6 +168,8 @@ static const struct forceinfo {
   { "overwrite-dir",       &fc_overwritedir             },
   { "architecture",        &fc_architecture             },
   { "bad-verify",          &fc_badverify                },
+  /* FIXME: obsolete options, remove in the future. */
+  { "auto-select",         NULL                         },
   {  0                                                  }
 };
 
@@ -296,7 +297,6 @@ static void setforce(const struct cmdinfo *cip, const char *value) {
   stop with error:    --refuse-<thing>,<thing>,... | --no-force-<thing>,...\n\
  Forcing things:\n\
   all [!]                Set all force options\n\
-  auto-select [*]        (De)select packages to install (remove) them\n\
   downgrade [*]          Replace a package with a lower version\n\
   configure-any          Configure any package which may help this one\n\
   hold                   Process incidental packages even when on hold\n\
@@ -331,14 +331,20 @@ Forcing options marked [*] are enabled by default.\n"),
     l= comma ? (int)(comma-value) : strlen(value);
     for (fip=forceinfos; fip->name; fip++)
       if (!strncmp(fip->name,value,l) && strlen(fip->name)==l) break;
-    if (!fip->name)
-      if(!strncmp("all",value,l))
+    if (!fip->name) {
+      if (strncmp("all", value, l) == 0) {
 	for (fip=forceinfos; fip->name; fip++)
-	  *fip->opt= cip->arg;
-      else
+	  if (fip->opt)
+	    *fip->opt= cip->arg;
+      } else
 	badusage(_("unknown force/refuse option `%.*s'"), l<250 ? (int)l : 250, value);
-    else
-      *fip->opt= cip->arg;
+    } else {
+      if (fip->opt)
+	*fip->opt= cip->arg;
+      else
+	fprintf(stderr, _("Warning: obsolete force/refuse option `%s'\n"),
+		fip->name);
+    }
     if (!comma) break;
     value= ++comma;
   }

+ 1 - 1
src/main.h

@@ -85,7 +85,7 @@ extern int f_autodeconf, f_largemem, f_nodebsig;
 extern unsigned long f_debug;
 extern int fc_downgrade, fc_configureany, fc_hold, fc_removereinstreq, fc_overwrite;
 extern int fc_removeessential, fc_conflicts, fc_depends, fc_dependsversion;
-extern int fc_autoselect, fc_badpath, fc_overwritediverted, fc_architecture;
+extern int fc_badpath, fc_overwritediverted, fc_architecture;
 extern int fc_nonroot, fc_overwritedir, fc_conff_new, fc_conff_miss;
 extern int fc_conff_old, fc_conff_def;
 extern int fc_badverify;