From 784a8eeb8ad9494a40d09ade64ef6372fb18dbaa Mon Sep 17 00:00:00 2001 From: ewt Date: Wed, 17 Feb 1999 04:04:53 +0000 Subject: [PATCH] fixed noreplace handling CVS patchset: 2801 CVS date: 1999/02/17 04:04:53 --- CHANGES | 1 + lib/transaction.c | 9 ++++----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGES b/CHANGES index 43c9726..f2e02e1 100644 --- a/CHANGES +++ b/CHANGES @@ -12,6 +12,7 @@ - augment linux provides/requires for glibc 2.1 backward compatibility. - fixed --noscript, --notriggers, --excludedocs, and a bunch of other install/remove flags + - fixed noreplace handling 2.5.x -> 2.90 - added --excludepath diff --git a/lib/transaction.c b/lib/transaction.c index 2f2a33f..f8c7db0 100644 --- a/lib/transaction.c +++ b/lib/transaction.c @@ -655,6 +655,7 @@ static enum fileActions decideFileFate(char * filespec, short dbMode, enum fileTypes dbWhat, newWhat, diskWhat; struct stat sb; int i, rc; + int save = (newFlags & RPMFILE_NOREPLACE) ? ALTNAME : SAVE; if (lstat(filespec, &sb)) { /* the file doesn't exist on the disk create it unless the new @@ -677,9 +678,9 @@ static enum fileActions decideFileFate(char * filespec, short dbMode, return CREATE; if (diskWhat != newWhat) { - return SAVE; + return save; } else if (newWhat != dbWhat && diskWhat != dbWhat) { - return SAVE; + return save; } else if (dbWhat != newWhat) { return CREATE; } else if (dbWhat != LINK && dbWhat != REG) { @@ -728,7 +729,7 @@ static enum fileActions decideFileFate(char * filespec, short dbMode, be nice if RPM was smart enough to at least try and merge the difference ala CVS, but... */ - return SAVE; + return save; } enum fileTypes whatis(short mode) { @@ -905,8 +906,6 @@ void handleOverlappedFiles(struct fileInfo * fi, hashTable ht, } if (fi->type == ADDED && otherPkgNum < 0) { - /* If it isn't in the database, install it. - FIXME: check for config files here for .rpmorig purporses! */ if (fi->actions[i] == UNKNOWN) { if ((fi->fflags[i] & RPMFILE_CONFIG) && !lstat(fi->fl[i], &sb)) -- 2.7.4