fixed noreplace handling
authorewt <devnull@localhost>
Wed, 17 Feb 1999 04:04:53 +0000 (04:04 +0000)
committerewt <devnull@localhost>
Wed, 17 Feb 1999 04:04:53 +0000 (04:04 +0000)
CVS patchset: 2801
CVS date: 1999/02/17 04:04:53

CHANGES
lib/transaction.c

diff --git a/CHANGES b/CHANGES
index 43c9726..f2e02e1 100644 (file)
--- 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
index 2f2a33f..f8c7db0 100644 (file)
@@ -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))