From a856972cc62dd84f7c6061625f2286d68bdadf6f Mon Sep 17 00:00:00 2001 From: ewt Date: Sun, 14 Jan 1996 23:07:54 +0000 Subject: [PATCH] modified to be standalone program CVS patchset: 208 CVS date: 1996/01/14 23:07:54 --- convertdb.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/convertdb.c b/convertdb.c index eb4e09b..179887b 100644 --- a/convertdb.c +++ b/convertdb.c @@ -13,9 +13,9 @@ #include "rpmerr.h" #include "rpmlib.h" -/****/ +int convertDB(void); -int convertDB(char * dbprefix) { +int convertDB(void) { struct oldrpmdb olddb; rpmdb db; struct oldrpmdbLabel * packageLabels, * label; @@ -73,7 +73,7 @@ int convertDB(char * dbprefix) { for (label = packageLabels; label; label = label->next) { if (oldrpmdbGetPackageInfo(&olddb, *label, &package)) { - printf("oldrpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n", &olddb, olddb.packages); + fprintf(stderr, "oldrpmdbGetPackageInfo failed &olddb = %p olddb.packages = %p\n", &olddb, olddb.packages); exit(1); } @@ -99,12 +99,10 @@ int convertDB(char * dbprefix) { addEntry(dbentry, RPMTAG_GROUP, STRING_TYPE, group, 1); if (preun) { - printf("found preun for %s\n", package.name); addEntry(dbentry, RPMTAG_PREUN, STRING_TYPE, preun, 1); free(preun); } if (postun) { - printf("found postun for %s\n", package.name); addEntry(dbentry, RPMTAG_POSTUN, STRING_TYPE, postun, 1); free(postun); } @@ -202,3 +200,15 @@ int convertDB(char * dbprefix) { return 1; } + +int main(int argc, char ** argv) { + if (argc != 1) { + fprintf(stderr, "rpmconvert: no arguments expected"); + exit(1); + } + + printf("rpmconvert 1.0 - convering database in /var/lib/rpm\n"); + convertDB(); + + exit(0); +} -- 2.7.4