diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-03-19 16:55:27 +0200 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-03-19 16:55:27 +0200 |
commit | 89b3b386123ae81b31a07400b02eae2e779985cf (patch) | |
tree | e0f824948676d1bcd83756e059a7da39778a7eef | |
parent | 061d045d296ce6d02f5ee9b96a090ab1414826ae (diff) | |
download | rpm-89b3b386123ae81b31a07400b02eae2e779985cf.tar.gz rpm-89b3b386123ae81b31a07400b02eae2e779985cf.tar.bz2 rpm-89b3b386123ae81b31a07400b02eae2e779985cf.zip |
Lose unused temporary/pseudo rpmdbi tags
- we haven't had any temporary dbis since rpm 4.8.0 where Depends
got axed, the rest were just nonexistent fluff anyway
-rw-r--r-- | lib/backend/dbconfig.c | 1 | ||||
-rw-r--r-- | lib/rpmdb.c | 53 | ||||
-rw-r--r-- | lib/rpmtag.h | 4 | ||||
-rw-r--r-- | lib/tagname.c | 24 | ||||
-rw-r--r-- | macros.in | 5 |
5 files changed, 8 insertions, 79 deletions
diff --git a/lib/backend/dbconfig.c b/lib/backend/dbconfig.c index 989e6b541..749605ca7 100644 --- a/lib/backend/dbconfig.c +++ b/lib/backend/dbconfig.c @@ -371,7 +371,6 @@ dbiIndex dbiNew(rpmdb rpmdb, rpmTag rpmtag) */ switch (rpmtag) { case RPMDBI_PACKAGES: - case RPMDBI_DEPENDS: dbi->dbi_jlen = 1 * sizeof(int32_t); break; default: diff --git a/lib/rpmdb.c b/lib/rpmdb.c index ba36eb0bf..ae5a011f5 100644 --- a/lib/rpmdb.c +++ b/lib/rpmdb.c @@ -112,7 +112,7 @@ static int dbiTagToDbix(rpmTag rpmtag) static void dbiTagsInit(void) { static const char * const _dbiTagStr_default = - "Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:ObsoleteName:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Depends:Pubkeys"; + "Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:ObsoleteName:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Pubkeys"; char * dbiTagStr = NULL; char * o, * oe; rpmTag rpmtag; @@ -643,22 +643,6 @@ static struct rpmdb_s const dbTemplate = { _DB_MAJOR, _DB_ERRPFX }; -static int isTemporaryDB(rpmTag rpmtag) -{ - int rc = 0; - switch (rpmtag) { - case RPMDBI_AVAILABLE: - case RPMDBI_ADDED: - case RPMDBI_REMOVED: - case RPMDBI_DEPENDS: - rc = 1; - break; - default: - break; - } - return rc; -} - rpmop rpmdbOp(rpmdb rpmdb, rpmdbOpX opx) { rpmop op = NULL; @@ -708,9 +692,6 @@ int rpmdbOpenAll(rpmdb db) for (dbix = 0; dbix < dbiTags.max; dbix++) { if (db->_dbi[dbix] != NULL) continue; - /* Filter out temporary databases */ - if (isTemporaryDB(dbiTags.tags[dbix])) - continue; (void) dbiOpen(db, dbiTags.tags[dbix], db->db_flags); } return rc; @@ -894,14 +875,9 @@ static int openDatabase(const char * prefix, rc = 0; if (dbiTags.tags != NULL) for (dbix = 0; rc == 0 && dbix < dbiTags.max; dbix++) { - dbiIndex dbi; - rpmTag rpmtag; - - /* Filter out temporary databases */ - if (isTemporaryDB((rpmtag = dbiTags.tags[dbix]))) - continue; + rpmTag rpmtag = dbiTags.tags[dbix]; + dbiIndex dbi = dbiOpen(db, rpmtag, 0); - dbi = dbiOpen(db, rpmtag, 0); if (dbi == NULL) { rc = -2; break; @@ -2446,10 +2422,6 @@ int rpmdbRemove(rpmdb db, int rid, unsigned int hdrNum, dbi = NULL; rpmtag = dbiTags.tags[dbix]; - /* Filter out temporary databases */ - if (isTemporaryDB(rpmtag)) - continue; - if (rpmtag == RPMDBI_PACKAGES) { dbi = dbiOpen(db, rpmtag, 0); if (dbi == NULL) /* XXX shouldn't happen */ @@ -2692,10 +2664,6 @@ int rpmdbAdd(rpmdb db, int iid, Header h, dbi = NULL; rpmtag = dbiTags.tags[dbix]; - /* Filter out temporary databases */ - if (isTemporaryDB(rpmtag)) - continue; - switch (rpmtag) { case RPMDBI_PACKAGES: dbi = dbiOpen(db, rpmtag, 0); @@ -2943,17 +2911,10 @@ static int rpmdbMoveDatabase(const char * prefix, case 3: if (dbiTags.tags != NULL) for (i = 0; i < dbiTags.max; i++) { - const char * base; - char *src, *dest; - rpmTag rpmtag; - - /* Filter out temporary databases */ - if (isTemporaryDB((rpmtag = dbiTags.tags[i]))) - continue; - - base = rpmTagGetName(rpmtag); - src = rpmGetPath(prefix, "/", olddbpath, "/", base, NULL); - dest = rpmGetPath(prefix, "/", newdbpath, "/", base, NULL); + rpmTag rpmtag = dbiTags.tags[i]; + const char *base = rpmTagGetName(rpmtag); + char *src = rpmGetPath(prefix, "/", olddbpath, "/", base, NULL); + char *dest = rpmGetPath(prefix, "/", newdbpath, "/", base, NULL); if (access(src, F_OK) != 0) goto cont; diff --git a/lib/rpmtag.h b/lib/rpmtag.h index 32b249599..204ee5f20 100644 --- a/lib/rpmtag.h +++ b/lib/rpmtag.h @@ -11,11 +11,7 @@ extern "C" { * Pseudo-tags used by the rpmdb and rpmgi iterator API's. */ #define RPMDBI_PACKAGES 0 /* Installed package headers. */ -#define RPMDBI_DEPENDS 1 /* Dependency resolution cache. */ #define RPMDBI_LABEL 2 /* Fingerprint search marker. */ -#define RPMDBI_ADDED 3 /* Added package headers. */ -#define RPMDBI_REMOVED 4 /* Removed package headers. */ -#define RPMDBI_AVAILABLE 5 /* Available package headers. */ #define RPMDBI_ARGLIST 6 /* (rpmgi) Argument list. */ /** diff --git a/lib/tagname.c b/lib/tagname.c index 593098938..c578b323a 100644 --- a/lib/tagname.c +++ b/lib/tagname.c @@ -129,18 +129,6 @@ static const char * _tagName(rpmTag tag) case RPMDBI_PACKAGES: name = "Packages"; break; - case RPMDBI_DEPENDS: - name = "Depends"; - break; - case RPMDBI_ADDED: - name = "Added"; - break; - case RPMDBI_REMOVED: - name = "Removed"; - break; - case RPMDBI_AVAILABLE: - name = "Available"; - break; case RPMDBI_ARGLIST: name = "Arglist"; break; @@ -195,10 +183,6 @@ static rpmTagType _tagType(rpmTag tag) switch (tag) { case RPMDBI_PACKAGES: - case RPMDBI_DEPENDS: - case RPMDBI_ADDED: - case RPMDBI_REMOVED: - case RPMDBI_AVAILABLE: case RPMDBI_ARGLIST: break; default: @@ -238,14 +222,6 @@ static rpmTag _tagValue(const char * tagstr) if (!rstrcasecmp(tagstr, "Packages")) return RPMDBI_PACKAGES; - if (!rstrcasecmp(tagstr, "Depends")) - return RPMDBI_DEPENDS; - if (!rstrcasecmp(tagstr, "Added")) - return RPMDBI_ADDED; - if (!rstrcasecmp(tagstr, "Removed")) - return RPMDBI_REMOVED; - if (!rstrcasecmp(tagstr, "Available")) - return RPMDBI_AVAILABLE; if (!rstrcasecmp(tagstr, "Arglist")) return RPMDBI_ARGLIST; @@ -647,14 +647,11 @@ print (t)\ %{nil} # The list of tags for which indices will be built. -%_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Obsoletename:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Depends:Pubkeys +%_dbi_tags Packages:Name:Basenames:Group:Requirename:Providename:Conflictname:Obsoletename:Triggername:Dirnames:Requireversion:Provideversion:Installtid:Sigmd5:Sha1header:Filedigests:Pubkeys # "Packages" should have shared/exclusive fcntl(2) lock using "lockdbfd". %_dbi_config_Packages %{_dbi_htconfig} lockdbfd -# "Depends" is a per-transaction cache of known dependency resolutions. -%_dbi_config_Depends %{_dbi_htconfig} temporary private - %_dbi_config_Dirnames %{_dbi_btconfig} %_dbi_config_Requireversion %{_dbi_btconfig} %_dbi_config_Provideversion %{_dbi_btconfig} |