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

libdpkg: Rename struct versionrevision to dpkg_version

Guillem Jover лет назад: 14
Родитель
Сommit
b9d2ac6beb
9 измененных файлов с 38 добавлено и 36 удалено
  1. 2 2
      dselect/pkglist.cc
  2. 10 10
      lib/dpkg/dpkg-db.h
  3. 1 1
      lib/dpkg/parsedump.h
  4. 4 4
      lib/dpkg/parsehelp.c
  5. 3 3
      lib/dpkg/test/t-version.c
  6. 6 4
      lib/dpkg/vercmp.c
  7. 2 2
      lib/dpkg/version.c
  8. 3 3
      lib/dpkg/version.h
  9. 7 7
      src/enquiry.c

+ 2 - 2
dselect/pkglist.cc

@@ -159,8 +159,8 @@ void packagelist::sortinplace() {
 }
 
 void packagelist::ensurestatsortinfo() {
-  const struct versionrevision *veri;
-  const struct versionrevision *vera;
+  const struct dpkg_version *veri;
+  const struct dpkg_version *vera;
   struct pkginfo *pkg;
   int index;
 

+ 10 - 10
lib/dpkg/dpkg-db.h

@@ -79,7 +79,7 @@ struct deppossi {
   struct pkgset *ed;
   struct deppossi *next, *rev_next, *rev_prev;
   const struct dpkg_arch *arch;
-  struct versionrevision version;
+  struct dpkg_version version;
   enum depverrel verrel;
   bool arch_is_implicit;
   bool cyclebreak;
@@ -131,7 +131,7 @@ struct pkgbin {
   const char *installedsize;
   const char *origin;
   const char *bugs;
-  struct versionrevision version;
+  struct dpkg_version version;
   struct conffile *conffiles;
   struct arbitraryfield *arbs;
 };
@@ -201,7 +201,7 @@ struct pkginfo {
   } priority;
   const char *otherpriority;
   const char *section;
-  struct versionrevision configversion;
+  struct dpkg_version configversion;
   struct filedetails *files;
   struct pkgbin installed;
   struct pkgbin available;
@@ -341,11 +341,11 @@ extern const struct namevalue wantinfos[];
 #include <dpkg/error.h>
 
 enum versiondisplayepochwhen { vdew_never, vdew_nonambig, vdew_always };
-void varbufversion(struct varbuf*, const struct versionrevision*,
+void varbufversion(struct varbuf *, const struct dpkg_version *,
                    enum versiondisplayepochwhen);
-int parseversion(struct versionrevision *rversion, const char *,
+int parseversion(struct dpkg_version *version, const char *,
                  struct dpkg_error *err);
-const char *versiondescribe(const struct versionrevision*,
+const char *versiondescribe(const struct dpkg_version *,
                             enum versiondisplayepochwhen);
 
 enum pkg_name_arch_when {
@@ -388,11 +388,11 @@ void varbufdependency(struct varbuf *vb, struct dependency *dep);
 
 /*** from vercmp.c ***/
 
-bool versionsatisfied3(const struct versionrevision *it,
-                       const struct versionrevision *ref,
+bool versionsatisfied3(const struct dpkg_version *it,
+                       const struct dpkg_version *ref,
                        enum depverrel verrel);
-int versioncompare(const struct versionrevision *version,
-                   const struct versionrevision *refversion);
+int versioncompare(const struct dpkg_version *version,
+                   const struct dpkg_version *refversion);
 
 /*** from depcon.c ***/
 

+ 1 - 1
lib/dpkg/parsedump.h

@@ -115,7 +115,7 @@ struct fieldinfo {
 };
 
 void parse_db_version(struct parsedb_state *ps,
-                      struct versionrevision *version, const char *value,
+                      struct dpkg_version *version, const char *value,
                       const char *fmt, ...) DPKG_ATTR_PRINTF(4);
 
 void parse_error(struct parsedb_state *ps, const char *fmt, ...)

+ 4 - 4
lib/dpkg/parsehelp.c

@@ -147,7 +147,7 @@ pkg_name_is_illegal(const char *p)
 
 void varbufversion
 (struct varbuf *vb,
- const struct versionrevision *version,
+ const struct dpkg_version *version,
  enum versiondisplayepochwhen vdew)
 {
   switch (vdew) {
@@ -173,7 +173,7 @@ void varbufversion
 }
 
 const char *versiondescribe
-(const struct versionrevision *version,
+(const struct dpkg_version *version,
  enum versiondisplayepochwhen vdew)
 {
   static struct varbuf bufs[10];
@@ -205,7 +205,7 @@ const char *versiondescribe
  * @retval -1 On failure, and err is set accordingly.
  */
 int
-parseversion(struct versionrevision *rversion, const char *string,
+parseversion(struct dpkg_version *rversion, const char *string,
              struct dpkg_error *err)
 {
   char *hyphen, *colon, *eepochcolon;
@@ -276,7 +276,7 @@ parseversion(struct versionrevision *rversion, const char *string,
  * @param fmt The error format string.
  */
 void
-parse_db_version(struct parsedb_state *ps, struct versionrevision *version,
+parse_db_version(struct parsedb_state *ps, struct dpkg_version *version,
                  const char *value, const char *fmt, ...)
 {
   struct dpkg_error err;

+ 3 - 3
lib/dpkg/test/t-version.c

@@ -28,12 +28,12 @@
 #include <dpkg/dpkg-db.h>
 
 #define version(epoch, version, revision) \
-	(struct versionrevision) { (epoch), (version), (revision) }
+	(struct dpkg_version) { (epoch), (version), (revision) }
 
 static void
 test_version_compare(void)
 {
-	struct versionrevision a, b;
+	struct dpkg_version a, b;
 
 	dpkg_version_blank(&a);
 	dpkg_version_blank(&b);
@@ -78,7 +78,7 @@ static void
 test_version_parse(void)
 {
 	struct dpkg_error err;
-	struct versionrevision a, b;
+	struct dpkg_version a, b;
 	const char *p;
 	char *verstr;
 

+ 6 - 4
lib/dpkg/vercmp.c

@@ -72,8 +72,10 @@ static int verrevcmp(const char *val, const char *ref) {
   return 0;
 }
 
-int versioncompare(const struct versionrevision *version,
-                   const struct versionrevision *refversion) {
+int
+versioncompare(const struct dpkg_version *version,
+               const struct dpkg_version *refversion)
+{
   int r;
 
   if (version->epoch > refversion->epoch) return 1;
@@ -83,8 +85,8 @@ int versioncompare(const struct versionrevision *version,
 }
 
 bool
-versionsatisfied3(const struct versionrevision *it,
-                  const struct versionrevision *ref,
+versionsatisfied3(const struct dpkg_version *it,
+                  const struct dpkg_version *ref,
                   enum depverrel verrel)
 {
   int r;

+ 2 - 2
lib/dpkg/version.c

@@ -24,7 +24,7 @@
 #include <dpkg/version.h>
 
 void
-dpkg_version_blank(struct versionrevision *version)
+dpkg_version_blank(struct dpkg_version *version)
 {
 	version->epoch = 0;
 	version->version = NULL;
@@ -32,7 +32,7 @@ dpkg_version_blank(struct versionrevision *version)
 }
 
 bool
-dpkg_version_is_informative(const struct versionrevision *version)
+dpkg_version_is_informative(const struct dpkg_version *version)
 {
 	return (version->epoch ||
 	        (version->version && *version->version) ||

+ 3 - 3
lib/dpkg/version.h

@@ -33,14 +33,14 @@ DPKG_BEGIN_DECLS
  * @{
  */
 
-struct versionrevision {
+struct dpkg_version {
 	unsigned long epoch;
 	const char *version;
 	const char *revision;
 };
 
-void dpkg_version_blank(struct versionrevision *version);
-bool dpkg_version_is_informative(const struct versionrevision *version);
+void dpkg_version_blank(struct dpkg_version *version);
+bool dpkg_version_is_informative(const struct dpkg_version *version);
 
 /** @} */
 

+ 7 - 7
src/enquiry.c

@@ -338,7 +338,7 @@ unpackchk(const char *const *argv)
 
 static int
 assert_version_support(const char *const *argv,
-                       struct versionrevision *version,
+                       struct dpkg_version *version,
                        const char *feature_name)
 {
   struct pkginfo *pkg;
@@ -371,7 +371,7 @@ assert_version_support(const char *const *argv,
 int
 assertpredep(const char *const *argv)
 {
-  struct versionrevision version = { 0, "1.1.0", NULL };
+  struct dpkg_version version = { 0, "1.1.0", NULL };
 
   return assert_version_support(argv, &version, _("Pre-Depends field"));
 }
@@ -379,7 +379,7 @@ assertpredep(const char *const *argv)
 int
 assertepoch(const char *const *argv)
 {
-  struct versionrevision version = { 0, "1.4.0.7", NULL };
+  struct dpkg_version version = { 0, "1.4.0.7", NULL };
 
   return assert_version_support(argv, &version, _("epoch"));
 }
@@ -387,7 +387,7 @@ assertepoch(const char *const *argv)
 int
 assertlongfilenames(const char *const *argv)
 {
-  struct versionrevision version = { 0, "1.4.1.17", NULL };
+  struct dpkg_version version = { 0, "1.4.1.17", NULL };
 
   return assert_version_support(argv, &version, _("long filenames"));
 }
@@ -395,7 +395,7 @@ assertlongfilenames(const char *const *argv)
 int
 assertmulticonrep(const char *const *argv)
 {
-  struct versionrevision version = { 0, "1.4.1.19", NULL };
+  struct dpkg_version version = { 0, "1.4.1.19", NULL };
 
   return assert_version_support(argv, &version,
                                 _("multiple Conflicts and Replaces"));
@@ -404,7 +404,7 @@ assertmulticonrep(const char *const *argv)
 int
 assertmultiarch(const char *const *argv)
 {
-  struct versionrevision version = { 0, "1.16.2", NULL };
+  struct dpkg_version version = { 0, "1.16.2", NULL };
 
   return assert_version_support(argv, &version, _("multi-arch"));
 }
@@ -609,7 +609,7 @@ cmpversions(const char *const *argv)
   };
 
   const struct relationinfo *rip;
-  struct versionrevision a, b;
+  struct dpkg_version a, b;
   struct dpkg_error err;
   int r;