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

libdpkg: Fix field names on error messages

Either capitalize or rename them to match reality.
Guillem Jover лет назад: 13
Родитель
Сommit
81cf72aeb0
3 измененных файлов с 15 добавлено и 13 удалено
  1. 2 0
      debian/changelog
  2. 11 11
      lib/dpkg/fields.c
  3. 2 2
      lib/dpkg/parse.c

+ 2 - 0
debian/changelog

@@ -27,6 +27,8 @@ dpkg (1.17.2) UNRELEASED; urgency=low
     debian/control does not exist. Closes: #667008
   * Pass the package reference count (i.e. number of present instances) to
     maintainer scripts via the new variable DPKG_MAINTSCRIPT_PACKAGE_REFCOUNT.
+  * Fix field names on error messages in libdpkg, by either capitalizing them
+    or by renaming them to match reality.
 
   [ Updated programs translations ]
   * Vietnamese (Trần Ngọc Quân).

+ 11 - 11
lib/dpkg/fields.c

@@ -4,7 +4,7 @@
  *
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
  * Copyright © 2001 Wichert Akkerman
- * Copyright © 2006-2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2006-2013 Guillem Jover <guillem@debian.org>
  * Copyright © 2009 Canonical Ltd.
  * Copyright © 2011 Linaro Limited
  * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
@@ -205,7 +205,7 @@ f_priority(struct pkginfo *pkg, struct pkgbin *pkgbin,
            const char *value, const struct fieldinfo *fip)
 {
   if (!*value) return;
-  pkg->priority = parse_nv_last(ps, _("word in `priority' field"),
+  pkg->priority = parse_nv_last(ps, _("word in 'Priority' field"),
                                 priorityinfos, value);
   if (pkg->priority == pri_other)
     pkg->otherpriority = nfstrsave(value);
@@ -218,15 +218,15 @@ f_status(struct pkginfo *pkg, struct pkgbin *pkgbin,
 {
   if (ps->flags & pdb_rejectstatus)
     parse_error(ps,
-                _("value for `status' field not allowed in this context"));
+                _("value for 'Status' field not allowed in this context"));
   if (ps->flags & pdb_recordavailable)
     return;
 
-  pkg->want = parse_nv_next(ps, _("first (want) word in `status' field"),
+  pkg->want = parse_nv_next(ps, _("first (want) word in 'Status' field"),
                             wantinfos, &value);
-  pkg->eflag = parse_nv_next(ps, _("second (error) word in `status' field"),
+  pkg->eflag = parse_nv_next(ps, _("second (error) word in 'Status' field"),
                              eflaginfos, &value);
-  pkg->status = parse_nv_last(ps, _("third (status) word in `status' field"),
+  pkg->status = parse_nv_last(ps, _("third (status) word in 'Status' field"),
                               statusinfos, value);
 }
 
@@ -266,7 +266,7 @@ f_configversion(struct pkginfo *pkg, struct pkgbin *pkgbin,
 {
   if (ps->flags & pdb_rejectstatus)
     parse_error(ps,
-                _("value for `config-version' field not allowed in this context"));
+                _("value for 'Config-Version' field not allowed in this context"));
   if (ps->flags & pdb_recordavailable)
     return;
 
@@ -297,7 +297,7 @@ static void conffvalue_lastword(const char *value, const char *from,
 
 malformed:
   parse_error(ps,
-              _("value for `conffiles' has malformatted line `%.*s'"),
+              _("value for 'Conffiles' field has malformatted line '%.*s'"),
               (int)min(endent - value, 250), value);
 }
 
@@ -319,7 +319,7 @@ f_conffiles(struct pkginfo *pkg, struct pkgbin *pkgbin,
     if (c == '\n') continue;
     if (c != ' ')
       parse_error(ps,
-                  _("value for `conffiles' has line starting with non-space `%c'"),
+                  _("value for 'Conffiles' has line starting with non-space '%c'"),
                   c);
     for (endent = value; (c = *endent) != '\0' && c != '\n'; endent++) ;
     conffvalue_lastword(value, endent, endent,
@@ -613,7 +613,7 @@ f_trigpend(struct pkginfo *pend, struct pkgbin *pkgbin,
 
   if (ps->flags & pdb_rejectstatus)
     parse_error(ps,
-                _("value for `triggers-pending' field not allowed in "
+                _("value for 'Triggers-Pending' field not allowed in "
                   "this context"));
 
   while ((word = scan_word(&value))) {
@@ -638,7 +638,7 @@ f_trigaw(struct pkginfo *aw, struct pkgbin *pkgbin,
 
   if (ps->flags & pdb_rejectstatus)
     parse_error(ps,
-                _("value for `triggers-awaited' field not allowed in "
+                _("value for 'Triggers-Awaited' field not allowed in "
                   "this context"));
 
   while ((word = scan_word(&value))) {

+ 2 - 2
lib/dpkg/parse.c

@@ -3,7 +3,7 @@
  * parse.c - database file parsing, main package/field loop
  *
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
- * Copyright © 2006,2008-2012 Guillem Jover <guillem@debian.org>
+ * Copyright © 2006,2008-2013 Guillem Jover <guillem@debian.org>
  *
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -229,7 +229,7 @@ pkg_parse_verify(struct parsedb_state *ps,
     if (pkg->configversion.version) {
       if (pkg->status == stat_installed || pkg->status == stat_notinstalled)
         parse_error(ps,
-                    _("Configured-Version for package with inappropriate Status"));
+                    _("Config-Version for package with inappropriate Status"));
     } else {
       if (pkg->status == stat_installed)
         pkg->configversion = pkgbin->version;