Browse Source

dpkg: Uppercase pkg_infodb_format enum values

Guillem Jover 10 years ago
parent
commit
cb6a768328
4 changed files with 15 additions and 15 deletions
  1. 2 2
      src/infodb-access.c
  2. 6 6
      src/infodb-format.c
  3. 2 2
      src/infodb-upgrade.c
  4. 5 5
      src/infodb.h

+ 2 - 2
src/infodb-access.c

@@ -3,7 +3,7 @@
  * infodb.c - package control information database
  * infodb.c - package control information database
  *
  *
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
- * Copyright © 2011 Guillem Jover <guillem@debian.org>
+ * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
  *
  *
  * This is free software; you can redistribute it and/or modify
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * it under the terms of the GNU General Public License as published by
@@ -68,7 +68,7 @@ pkg_infodb_foreach(struct pkginfo *pkg, struct pkgbin *pkgbin,
 	db_format = pkg_infodb_get_format();
 	db_format = pkg_infodb_get_format();
 
 
 	if (pkgbin->multiarch == multiarch_same &&
 	if (pkgbin->multiarch == multiarch_same &&
-	    db_format == pkg_infodb_format_multiarch)
+	    db_format == PKG_INFODB_FORMAT_MULTIARCH)
 		pkgname = pkgbin_name(pkg, pkgbin, pnaw_always);
 		pkgname = pkgbin_name(pkg, pkgbin, pnaw_always);
 	else
 	else
 		pkgname = pkgbin_name(pkg, pkgbin, pnaw_never);
 		pkgname = pkgbin_name(pkg, pkgbin, pnaw_never);

+ 6 - 6
src/infodb-format.c

@@ -2,7 +2,7 @@
  * dpkg - main program for package management
  * dpkg - main program for package management
  * infodb-format.c - package control information database format
  * infodb-format.c - package control information database format
  *
  *
- * Copyright © 2011 Guillem Jover <guillem@debian.org>
+ * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
  *
  *
  * This is free software; you can redistribute it and/or modify
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * it under the terms of the GNU General Public License as published by
@@ -35,7 +35,7 @@
 
 
 #include "infodb.h"
 #include "infodb.h"
 
 
-static enum pkg_infodb_format db_format = pkg_infodb_format_unknown;
+static enum pkg_infodb_format db_format = PKG_INFODB_FORMAT_UNKNOWN;
 static bool db_upgrading;
 static bool db_upgrading;
 
 
 static enum pkg_infodb_format
 static enum pkg_infodb_format
@@ -48,7 +48,7 @@ pkg_infodb_parse_format(const char *file)
 	if (fp == NULL) {
 	if (fp == NULL) {
 		/* A missing format file means legacy format (0). */
 		/* A missing format file means legacy format (0). */
 		if (errno == ENOENT)
 		if (errno == ENOENT)
-			return pkg_infodb_format_legacy;
+			return PKG_INFODB_FORMAT_LEGACY;
 		ohshite(_("error trying to open %.250s"), file);
 		ohshite(_("error trying to open %.250s"), file);
 	}
 	}
 
 
@@ -84,7 +84,7 @@ pkg_infodb_read_format(void)
 	atomic_file_free(file);
 	atomic_file_free(file);
 	free(filename);
 	free(filename);
 
 
-	if (db_format < 0 || db_format >= pkg_infodb_format_last)
+	if (db_format < 0 || db_format >= PKG_INFODB_FORMAT_LAST)
 		ohshit(_("info database format (%d) is bogus or too new; "
 		ohshit(_("info database format (%d) is bogus or too new; "
 		         "try getting a newer dpkg"), db_format);
 		         "try getting a newer dpkg"), db_format);
 
 
@@ -94,7 +94,7 @@ pkg_infodb_read_format(void)
 enum pkg_infodb_format
 enum pkg_infodb_format
 pkg_infodb_get_format(void)
 pkg_infodb_get_format(void)
 {
 {
-	if (db_format > pkg_infodb_format_unknown)
+	if (db_format > PKG_INFODB_FORMAT_UNKNOWN)
 		return db_format;
 		return db_format;
 	else
 	else
 		return pkg_infodb_read_format();
 		return pkg_infodb_read_format();
@@ -141,7 +141,7 @@ pkg_infodb_get_file(struct pkginfo *pkg, struct pkgbin *pkgbin,
 	varbuf_add_char(&vb, '/');
 	varbuf_add_char(&vb, '/');
 	varbuf_add_str(&vb, pkg->set->name);
 	varbuf_add_str(&vb, pkg->set->name);
 	if (pkgbin->multiarch == multiarch_same &&
 	if (pkgbin->multiarch == multiarch_same &&
-	    format == pkg_infodb_format_multiarch)
+	    format == PKG_INFODB_FORMAT_MULTIARCH)
 		varbuf_add_archqual(&vb, pkgbin->arch);
 		varbuf_add_archqual(&vb, pkgbin->arch);
 	varbuf_add_char(&vb, '.');
 	varbuf_add_char(&vb, '.');
 	varbuf_add_str(&vb, filetype);
 	varbuf_add_str(&vb, filetype);

+ 2 - 2
src/infodb-upgrade.c

@@ -3,7 +3,7 @@
  * infodb-upgrade.c - package control information database format upgrade
  * infodb-upgrade.c - package control information database format upgrade
  *
  *
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
  * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
- * Copyright © 2011 Guillem Jover <guillem@debian.org>
+ * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
  * Copyright © 2011 Linaro Limited
  * Copyright © 2011 Linaro Limited
  * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
  * Copyright © 2011 Raphaël Hertzog <hertzog@debian.org>
  *
  *
@@ -246,7 +246,7 @@ pkg_infodb_upgrade(void)
 	if (modstatdb_get_status() < msdbrw_write)
 	if (modstatdb_get_status() < msdbrw_write)
 		return;
 		return;
 
 
-	if (db_format < pkg_infodb_format_multiarch ||
+	if (db_format < PKG_INFODB_FORMAT_MULTIARCH ||
 	    pkg_infodb_is_upgrading())
 	    pkg_infodb_is_upgrading())
 		pkg_infodb_upgrade_to_multiarch();
 		pkg_infodb_upgrade_to_multiarch();
 }
 }

+ 5 - 5
src/infodb.h

@@ -2,7 +2,7 @@
  * dpkg - main program for package management
  * dpkg - main program for package management
  * infodb.h - package control information database
  * infodb.h - package control information database
  *
  *
- * Copyright © 2011 Guillem Jover <guillem@debian.org>
+ * Copyright © 2011-2014 Guillem Jover <guillem@debian.org>
  *
  *
  * This is free software; you can redistribute it and/or modify
  * This is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * it under the terms of the GNU General Public License as published by
@@ -26,10 +26,10 @@
 #include <dpkg/dpkg-db.h>
 #include <dpkg/dpkg-db.h>
 
 
 enum pkg_infodb_format {
 enum pkg_infodb_format {
-	pkg_infodb_format_unknown = -1,
-	pkg_infodb_format_legacy = 0,
-	pkg_infodb_format_multiarch = 1,
-	pkg_infodb_format_last,
+	PKG_INFODB_FORMAT_UNKNOWN = -1,
+	PKG_INFODB_FORMAT_LEGACY = 0,
+	PKG_INFODB_FORMAT_MULTIARCH = 1,
+	PKG_INFODB_FORMAT_LAST,
 };
 };
 
 
 enum pkg_infodb_format pkg_infodb_get_format(void);
 enum pkg_infodb_format pkg_infodb_get_format(void);