diff options
author | Panu Matilainen <pmatilai@redhat.com> | 2010-09-03 16:57:50 +0300 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2010-09-03 17:13:10 +0300 |
commit | 9f68c7958f173a313d53abb4028164c37b6abf68 (patch) | |
tree | 7a0912363ba2ea2191753df5e293a54de6540c1e /rpmqv.c | |
parent | ada4dd18d590dc8eff7eac1a3f0f57c7243da539 (diff) | |
download | librpm-tizen-9f68c7958f173a313d53abb4028164c37b6abf68.tar.gz librpm-tizen-9f68c7958f173a313d53abb4028164c37b6abf68.tar.bz2 librpm-tizen-9f68c7958f173a313d53abb4028164c37b6abf68.zip |
Rip IAM_RPMDB, ie --initdb, --rebuilddb etc modes out of rpmqv.c and librpm
- Add popt exec aliases to rpmdb for backwards compatibility
- Change test-suite to use 'rpmdb --initdb' instead of 'rpm --initdb'
as popt exec aliases with absolute paths dont play very well
with the test-suite, duh...
Diffstat (limited to 'rpmqv.c')
-rw-r--r-- | rpmqv.c | 67 |
1 files changed, 2 insertions, 65 deletions
@@ -23,19 +23,13 @@ enum modes { MODE_ERASE = (1 << 2), #define MODES_IE (MODE_INSTALL | MODE_ERASE) - MODE_INITDB = (1 << 10), - MODE_REBUILDDB = (1 << 12), - MODE_VERIFYDB = (1 << 13), -#define MODES_DB (MODE_INITDB | MODE_REBUILDDB | MODE_VERIFYDB) - - MODE_UNKNOWN = 0 }; -#define MODES_FOR_DBPATH (MODES_IE | MODES_QV | MODES_DB) +#define MODES_FOR_DBPATH (MODES_IE | MODES_QV) #define MODES_FOR_NODEPS (MODES_IE | MODE_VERIFY) #define MODES_FOR_TEST (MODES_IE) -#define MODES_FOR_ROOT (MODES_IE | MODES_QV | MODES_DB) +#define MODES_FOR_ROOT (MODES_IE | MODES_QV) static int quiet; @@ -54,12 +48,6 @@ static struct poptOption optionsTable[] = { NULL }, #endif /* IAM_RPMQV */ -#ifdef IAM_RPMDB - { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmDatabasePoptTable, 0, - N_("Database options:"), - NULL }, -#endif /* IAM_RPMDB */ - #ifdef IAM_RPMEIU { NULL, '\0', POPT_ARG_INCLUDE_TABLE, rpmInstallPoptTable, 0, N_("Install/Upgrade/Erase options:"), @@ -90,10 +78,6 @@ int main(int argc, char *argv[]) struct rpmInstallArguments_s * ia = &rpmIArgs; #endif -#if defined(IAM_RPMDB) - struct rpmDatabaseArguments_s * da = &rpmDBArgs; -#endif - poptContext optCon; int ec = 0; #ifdef IAM_RPMEIU @@ -115,38 +99,12 @@ int main(int argc, char *argv[]) case MODE_VERIFY: qva->qva_mode = 'V'; break; case MODE_INSTALL: case MODE_ERASE: - case MODE_INITDB: - case MODE_REBUILDDB: - case MODE_VERIFYDB: case MODE_UNKNOWN: default: break; } #endif -#ifdef IAM_RPMDB - if (bigMode == MODE_UNKNOWN || (bigMode & MODES_DB)) { - if (da->init) { - if (bigMode != MODE_UNKNOWN) - argerror(_("only one major mode may be specified")); - else - bigMode = MODE_INITDB; - } else - if (da->rebuild) { - if (bigMode != MODE_UNKNOWN) - argerror(_("only one major mode may be specified")); - else - bigMode = MODE_REBUILDDB; - } else - if (da->verify) { - if (bigMode != MODE_UNKNOWN) - argerror(_("only one major mode may be specified")); - else - bigMode = MODE_VERIFYDB; - } - } -#endif /* IAM_RPMDB */ - #ifdef IAM_RPMQV if (bigMode == MODE_UNKNOWN || (bigMode & MODES_QV)) { switch (qva->qva_mode) { @@ -292,22 +250,6 @@ int main(int argc, char *argv[]) ts = rpmtsCreate(); (void) rpmtsSetRootDir(ts, rpmcliRootDir); switch (bigMode) { -#ifdef IAM_RPMDB - case MODE_INITDB: - ec = rpmtsInitDB(ts, 0644); - break; - - case MODE_REBUILDDB: - { rpmVSFlags vsflags = rpmExpandNumeric("%{_vsflags_rebuilddb}"); - rpmVSFlags ovsflags = rpmtsSetVSFlags(ts, vsflags); - ec = rpmtsRebuildDB(ts); - vsflags = rpmtsSetVSFlags(ts, ovsflags); - } break; - case MODE_VERIFYDB: - ec = rpmtsVerifyDB(ts); - break; -#endif /* IAM_RPMDB */ - #ifdef IAM_RPMEIU case MODE_ERASE: if (ia->noDeps) ia->installInterfaceFlags |= UNINSTALL_NODEPS; @@ -382,11 +324,6 @@ int main(int argc, char *argv[]) case MODE_QUERY: case MODE_VERIFY: #endif -#if !defined(IAM_RPMDB) - case MODE_INITDB: - case MODE_REBUILDDB: - case MODE_VERIFYDB: -#endif #if !defined(IAM_RPMEIU) case MODE_INSTALL: case MODE_ERASE: |