Forráskód Böngészése

Added a --force-all option.

Adam Heath 25 éve
szülő
commit
c2e5a59bcb
5 módosított fájl, 25 hozzáadás és 8 törlés
  1. 4 0
      ChangeLog
  2. 1 0
      debian/changelog
  3. 3 0
      main/dpkg.8
  4. 11 3
      main/main.c
  5. 6 5
      po/dpkg.pot

+ 4 - 0
ChangeLog

@@ -1,3 +1,7 @@
+Sun Dec 24 05:10:29 CST 2000 Adam Heath <doogie@debian.org>
+
+  * main/main.c: Added a --force-all option.
+
 Sun Dec 24 04:32:34 CST 2000 Adam Heath <doogie@debian.org>
 
   * main/main.c: Format help string for --abort-after like other

+ 1 - 0
debian/changelog

@@ -1,5 +1,6 @@
 dpkg (1.8.0) unstable; urgency=low
 
+  * Added a --force-all option.  Closes: #61354.
   * Format help string for --abort-after like other option help strings.
     Closes: #62464.
   * Fix dselect methods to pass admindir to dpkg from dselect.

+ 3 - 0
main/dpkg.8

@@ -331,6 +331,9 @@ Things marked with (*) are forced by default.
 only. Using them without fully understanding their effects may break
 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.
 

+ 11 - 3
main/main.c

@@ -254,7 +254,7 @@ static void setinteger(const struct cmdinfo *cip, const char *value) {
   *cip->iassignto= v;
 }
 
-static void setforce(const struct cmdinfo *cip, const char *value) {
+void setforce(const struct cmdinfo *cip, const char *value) {
   const char *comma;
   int l;
   const struct forceinfo *fip;
@@ -264,6 +264,7 @@ static void setforce(const struct cmdinfo *cip, const char *value) {
   warn but continue:  --force-<thing>,<thing>,...\n\
   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\
@@ -299,11 +300,18 @@ Forcing options marked [*] are enabled by default.\n"),
     for (fip=forceinfos; fip->name; fip++)
       if (!strncmp(fip->name,value,l) && strlen(fip->name)==l) break;
     if (!fip->name)
-      badusage(_("unknown force/refuse option `%.*s'"), l<250 ? l : 250, value);
-    *fip->opt= cip->arg;
+      if(!strncmp("all",value,l))
+	for (fip=forceinfos; fip->name; fip++)
+	  *fip->opt= cip->arg;
+      else
+	badusage(_("unknown force/refuse option `%.*s'"), l<250 ? l : 250, value);
+    else
+      *fip->opt= cip->arg;
     if (!comma) break;
     value= ++comma;
   }
+  for (fip=forceinfos; fip->name; fip++)
+    fprintf(stderr, "%s=%c\n", fip->name, *fip->opt);
 }
 
 static const char *const passlongopts[]= {

+ 6 - 5
po/dpkg.pot

@@ -6,7 +6,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2000-12-23 20:46-0600\n"
+"POT-Creation-Date: 2000-12-24 05:07-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"
@@ -2098,7 +2098,7 @@ msgid ""
 "  --ignore-depends=<package>,... Ignore dependencies involving <package>\n"
 "  --force-...                    Override problems - see --force-help\n"
 "  --no-force-...|--refuse-...    Stop when problems encountered\n"
-"  --abort-after <n>              abort after encountering <n> errors\n"
+"  --abort-after <n>              Abort after encountering <n> errors\n"
 "\n"
 "Comparison operators for --compare-versions are:\n"
 " lt le eq ne ge gt       (treat no version as earlier than any version);\n"
@@ -2174,6 +2174,7 @@ msgid ""
 "  warn but continue:  --force-<thing>,<thing>,...\n"
 "  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"
@@ -2205,16 +2206,16 @@ msgid ""
 "Forcing options marked [*] are enabled by default.\n"
 msgstr ""
 
-#: main/main.c:302
+#: main/main.c:307
 #, c-format
 msgid "unknown force/refuse option `%.*s'"
 msgstr ""
 
-#: main/main.c:381
+#: main/main.c:389
 msgid "failed to exec dpkg-deb"
 msgstr ""
 
-#: dpkg-deb/main.c:155 main/main.c:418 split/main.c:163
+#: dpkg-deb/main.c:155 main/main.c:426 split/main.c:163
 msgid "need an action option"
 msgstr ""