Restore previous vsflags on return from rpmInstall() and rpmErase()
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 19 Apr 2011 07:09:22 +0000 (10:09 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 19 Apr 2011 07:09:22 +0000 (10:09 +0300)
- Nobody is going to care really but since we bother remembering
  them we might as well restore them too, silencing another two
  set-but-unused warnings (this time semi-meaningful even)

lib/rpminstall.c

index ef34a74..7569bbf 100644 (file)
@@ -377,6 +377,9 @@ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv)
     int rc;
     int i;
 
+    vsflags = setvsFlags(ia);
+    ovsflags = rpmtsSetVSFlags(ts, (vsflags | RPMVSF_NEEDPAYLOAD));
+
     if (fileArgv == NULL) goto exit;
 
     rpmcliPackagesTotal = 0;
@@ -385,9 +388,6 @@ int rpmInstall(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_t fileArgv)
 
     relocations = ia->relocations;
 
-    vsflags = setvsFlags(ia);
-    ovsflags = rpmtsSetVSFlags(ts, (vsflags | RPMVSF_NEEDPAYLOAD));
-
     setNotifyFlag(ia, ts); 
 
     if ((eiu->relocations = relocations) != NULL) {
@@ -606,6 +606,7 @@ exit:
     free(eiu);
 
     rpmtsEmpty(ts);
+    rpmtsSetVSFlags(ts, ovsflags);
 
     return rc;
 }
@@ -676,6 +677,7 @@ int rpmErase(rpmts ts, struct rpmInstallArguments_s * ia, ARGV_const_t argv)
     numFailed = rpmcliTransaction(ts, ia, numPackages);
 exit:
     rpmtsEmpty(ts);
+    rpmtsSetVSFlags(ts, ovsflags);
 
     return numFailed;
 }