summaryrefslogtreecommitdiff
path: root/convertdb.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1995-12-27 20:05:14 +0000
committerewt <devnull@localhost>1995-12-27 20:05:14 +0000
commitfcf578890e222e6485fe372e06db63fff028cc0c (patch)
treebfb1c9bfbc038e964737c7dccfeae966a2bfecee /convertdb.c
parent574b4da356896d57f2820f4ad65a5aeb140e81d0 (diff)
downloadlibrpm-tizen-fcf578890e222e6485fe372e06db63fff028cc0c.tar.gz
librpm-tizen-fcf578890e222e6485fe372e06db63fff028cc0c.tar.bz2
librpm-tizen-fcf578890e222e6485fe372e06db63fff028cc0c.zip
changed to use oldrpmdb names insteaed of rpmdb ones
CVS patchset: 106 CVS date: 1995/12/27 20:05:14
Diffstat (limited to 'convertdb.c')
-rw-r--r--convertdb.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/convertdb.c b/convertdb.c
index b48566b51..40360ab20 100644
--- a/convertdb.c
+++ b/convertdb.c
@@ -47,11 +47,11 @@ int addIndexEntry(dbIndex * idx, char * index, unsigned int offset,
}
int convertDB(char * dbprefix) {
- struct rpmdb olddb;
+ struct oldrpmdb olddb;
dbIndex * nameIndex, * fileIndex, * groupIndex;
faFile pkgs;
- struct rpmdbLabel * packageLabels, * label;
- struct rpmdbPackageInfo package;
+ struct oldrpmdbLabel * packageLabels, * label;
+ struct oldrpmdbPackageInfo package;
Header dbentry;
unsigned int dboffset;
char * group;
@@ -70,7 +70,7 @@ int convertDB(char * dbprefix) {
char * fileStatesList;
int i;
- if (rpmdbOpen(&olddb)) {
+ if (oldrpmdbOpen(&olddb)) {
error(RPMERR_OLDDBMISSING, "");
return 0;
}
@@ -91,30 +91,30 @@ int convertDB(char * dbprefix) {
pkgs = faOpen("/var/lib/rpm/packages.rpm", O_RDWR | O_CREAT, 0644);
if (!pkgs) {
- rpmdbClose(&olddb);
+ oldrpmdbClose(&olddb);
error(RPMERR_DBOPEN, "failed to create /var/lib/rpm/packages.rpm");
return 0;
}
nameIndex = fileIndex = groupIndex = NULL;
nameIndex = openDBIndex("/var/lib/rpm/nameindex.rpm",
- O_RDWR | O_CREAT, 0644);
+ O_RDWR | O_CREAT | O_EXCL, 0644);
groupIndex = openDBIndex("/var/lib/rpm/groupindex.rpm",
- O_RDWR | O_CREAT, 0644);
+ O_RDWR | O_CREAT | O_EXCL, 0644);
fileIndex = openDBIndex("/var/lib/rpm/fileindex.rpm",
- O_RDWR | O_CREAT, 0644);
+ O_RDWR | O_CREAT | O_EXCL, 0644);
if (!nameIndex || !groupIndex || !fileIndex) {
nameIndex ? closeDBIndex(nameIndex) : 0;
groupIndex ? closeDBIndex(groupIndex) : 0;
fileIndex ? closeDBIndex(fileIndex) : 0;
- rpmdbClose(&olddb);
+ oldrpmdbClose(&olddb);
error(RPMERR_DBOPEN, "failed to create index files in /var/lib/rpm");
return 0;
}
- packageLabels = rpmdbGetAllLabels(&olddb);
+ packageLabels = oldrpmdbGetAllLabels(&olddb);
if (!packageLabels) {
error(RPMERR_OLDDBCORRUPT, "");
faClose(pkgs);
@@ -122,17 +122,17 @@ int convertDB(char * dbprefix) {
closeDBIndex(groupIndex);
closeDBIndex(fileIndex);
unlink("/var/lib/rpm/packages.rpm");
- rpmdbClose(&olddb);
+ oldrpmdbClose(&olddb);
return 0;
}
for (label = packageLabels; label; label = label->next) {
- if (rpmdbGetPackageInfo(&olddb, *label, &package)) {
- printf("rpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n", &olddb, olddb.packages);
+ if (oldrpmdbGetPackageInfo(&olddb, *label, &package)) {
+ printf("oldrpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n", &olddb, olddb.packages);
exit(1);
}
- group = rpmdbGetPackageGroup(&olddb, *label);
+ group = oldrpmdbGetPackageGroup(&olddb, *label);
dbentry = newHeader();
addEntry(dbentry, RPMTAG_NAME, STRING_TYPE, package.name, 1);
@@ -151,7 +151,7 @@ int convertDB(char * dbprefix) {
addEntry(dbentry, RPMTAG_COPYRIGHT, STRING_TYPE, package.copyright, 1);
addEntry(dbentry, RPMTAG_GROUP, STRING_TYPE, group, 1);
- gif = rpmdbGetPackageGif(&olddb, *label, &gifSize);
+ gif = oldrpmdbGetPackageGif(&olddb, *label, &gifSize);
if (gif) {
/*addEntry(dbentry, RPMTAG_GIF, BIN_TYPE, gif, gifSize);*/
free(gif);
@@ -250,10 +250,10 @@ int convertDB(char * dbprefix) {
free(group);
freeHeader(dbentry);
- rpmdbFreePackageInfo(package);
+ oldrpmdbFreePackageInfo(package);
}
- rpmdbClose(&olddb);
+ oldrpmdbClose(&olddb);
faClose(pkgs);
closeDBIndex(nameIndex);