summaryrefslogtreecommitdiff
path: root/rpm.c
diff options
context:
space:
mode:
authorewt <devnull@localhost>1996-02-25 22:11:24 +0000
committerewt <devnull@localhost>1996-02-25 22:11:24 +0000
commitb0d4b33c9216f50fab4a64bbe02ce2f5ee1109a7 (patch)
tree8069d62fa48143414876c7b8ac45ff28f9413363 /rpm.c
parent45061be267a55c9a6062c406fcd1fb1772213bf3 (diff)
downloadrpm-b0d4b33c9216f50fab4a64bbe02ce2f5ee1109a7.tar.gz
rpm-b0d4b33c9216f50fab4a64bbe02ce2f5ee1109a7.tar.bz2
rpm-b0d4b33c9216f50fab4a64bbe02ce2f5ee1109a7.zip
added support for --oldpackage
CVS patchset: 422 CVS date: 1996/02/25 22:11:24
Diffstat (limited to 'rpm.c')
-rwxr-xr-xrpm.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/rpm.c b/rpm.c
index a814ffb1a..86488c890 100755
--- a/rpm.c
+++ b/rpm.c
@@ -53,7 +53,8 @@ void printUsage(void) {
puts(" [--replacepkgs] [--replacefiles] [--search]");
puts(" [--root <dir>] file1.rpm ... filen.rpm");
puts(" rpm {--upgrage -U} [-v] [--hash -h] [--percent] [--force] [--test]");
- puts(" [--search] [--root <dir>] file1.rpm ... fileN.rpm");
+ puts(" [--search] [--oldpackage] [--root <dir>]");
+ puts(" file1.rpm ... fileN.rpm");
puts(" rpm {--query -q} [-afFpP] [-i] [-l] [-s] [-d] [-c] [-v] ");
puts(" [--root <dir>] [targets]");
puts(" rpm {--verify -V -y] [-afFpP] [--root <dir>] [targets]");
@@ -108,7 +109,9 @@ void printHelp(void) {
puts(" --root <dir> - use <dir> as the top level directory");
puts("");
puts(" --upgrade <packagefile>");
- puts(" -U <packagefile> - upgrade package (same options as --install)");
+ puts(" -U <packagefile> - upgrade package (same options as --install, plus)");
+ puts(" --oldpackage - upgrade to an old version of the package (--force");
+ puts(" on upgrades does this automatically)");
puts("");
puts(" --uninstall <package>");
puts(" -u <package> - uninstall package");
@@ -199,6 +202,7 @@ int main(int argc, char ** argv) {
int installFlags = 0;
int interfaceFlags = 0;
int buildAmount = 0;
+ int oldPackage = 0;
int clean = 0;
int signIt = 0;
char * prefix = "/";
@@ -220,6 +224,7 @@ int main(int argc, char ** argv) {
{ "info", 0, 0, 'i' },
{ "install", 0, 0, 'i' },
{ "list", 0, 0, 'l' },
+ { "oldpackage", 0, &oldPackage, 0 },
{ "package", 0, 0, 'p' },
{ "percent", 0, &showPercents, 0 },
{ "query", 0, 0, 'q' },
@@ -447,7 +452,7 @@ int main(int argc, char ** argv) {
argerror("unexpected query source");
if (bigMode != MODE_INSTALL && force)
- argerror("only installation may be forced");
+ argerror("only installation and upgrading may be forced");
if (bigMode != MODE_INSTALL && showHash)
argerror("--hash (-h) may only be specified during package installation");
@@ -473,6 +478,12 @@ int main(int argc, char ** argv) {
if (bigMode != MODE_BUILD && clean)
argerror("--clean may only be used during package building");
+ if (oldPackage && !(installFlags & INSTALL_UPGRADE))
+ argerror("--oldpackage may only be used during upgrades");
+
+ if (oldPackage || (force && (installFlags & INSTALL_UPGRADE)))
+ installFlags |= INSTALL_UPGRADETOOLD;
+
if (signIt) {
if (bigMode == MODE_REBUILD || bigMode == MODE_BUILD) {
if ((optind != argc) && (sigLookupType() == RPMSIG_PGP262_1024)) {