diff options
author | ewt <devnull@localhost> | 1996-07-03 02:55:03 +0000 |
---|---|---|
committer | ewt <devnull@localhost> | 1996-07-03 02:55:03 +0000 |
commit | 30b58fb9bdbd9848c946da2b86ea59dbc186aaaf (patch) | |
tree | f562e103b8fa035d7c8ecacb70a2eac89be137b2 /lib/install.c | |
parent | ece66fbc5cf60680a595feebc5c9e6cf0a58be9d (diff) | |
download | rpm-30b58fb9bdbd9848c946da2b86ea59dbc186aaaf.tar.gz rpm-30b58fb9bdbd9848c946da2b86ea59dbc186aaaf.tar.bz2 rpm-30b58fb9bdbd9848c946da2b86ea59dbc186aaaf.zip |
added handling for arch strings, INSTALL_NOARCH flag
CVS patchset: 723
CVS date: 1996/07/03 02:55:03
Diffstat (limited to 'lib/install.c')
-rw-r--r-- | lib/install.c | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/lib/install.c b/lib/install.c index 50da446da..e66de56a9 100644 --- a/lib/install.c +++ b/lib/install.c @@ -114,7 +114,8 @@ int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags, dbIndexSet matches; int * oldVersions; int * intptr; - int_8 thisArch, * pkgArch; + int_8 * pkgArchNum; + void * pkgArch; int scriptArg; oldVersions = alloca(sizeof(int)); @@ -144,14 +145,27 @@ int rpmInstallPackage(char * prefix, rpmdb db, int fd, int flags, getEntry(h, RPMTAG_VERSION, &type, (void **) &version, &fileCount); getEntry(h, RPMTAG_RELEASE, &type, (void **) &release, &fileCount); - /* make sure we're trying to install this on the proper architecture */ - thisArch = getArchNum(); - getEntry(h, RPMTAG_ARCH, &type, (void **) &pkgArch, &fileCount); - if (thisArch != *pkgArch) { - error(RPMERR_BADARCH, "package %s-%s-%s is for a different " - "architecture", name, version, release); - freeHeader(h); - return 2; + if (!(flags & INSTALL_NOARCH)) { + /* make sure we're trying to install this on the proper architecture */ + getEntry(h, RPMTAG_ARCH, &type, (void **) &pkgArch, &fileCount); + if (type == INT8_TYPE) { + /* old arch handling */ + pkgArchNum = pkgArch; + if (getArchNum() != *pkgArchNum) { + error(RPMERR_BADARCH, "package %s-%s-%s is for a different " + "architecture", name, version, release); + freeHeader(h); + return 2; + } + } else { + /* new arch handling */ + if (!rpmArchScore(pkgArch)) { + error(RPMERR_BADARCH, "package %s-%s-%s is for a different " + "architecture", name, version, release); + freeHeader(h); + return 2; + } + } } if (labelFormat) { |