OSDN Git Service

Maintain consistent internal vs. external installation records.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 29 Nov 2012 09:14:25 +0000 (09:14 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Thu, 29 Nov 2012 09:14:25 +0000 (09:14 +0000)
ChangeLog
src/pkginst.cpp
src/pkgunst.cpp

index ef67e21..3a7e261 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-11-29  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Maintain consistent internal vs. external installation records.
+
+       * src/pkginst.cpp (pkgInstall): Set "installed" attribute on internal
+       package reference, to "yes", after installation; CLI didn't need this,
+       but GUI will do so, for any package revisited in a single session.
+
+       * src/pkgunst.cpp (pkgRemove): Similarly, negate "installed" attribute
+       after package removal.
+
 2012-11-17  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        Refactor to consolidate three instances of duplicate code.
index 0ead650..d2ddc93 100644 (file)
@@ -431,8 +431,7 @@ EXTERN_C void pkgInstall( pkgActionItem *current )
            pkgRegister( sysroot, pkg, tarname, pkgfile );
        }
        else
-       {
-         /* Here we have a "real" (physical) package to install;
+       { /* Here we have a "real" (physical) package to install;
           * for the time being, we assume it is packaged in our
           * standard "tar" archive format.
           */
@@ -440,6 +439,14 @@ EXTERN_C void pkgInstall( pkgActionItem *current )
          if( install.IsOk() )
            install.Process();
        }
+       /* Update the internal record of installed state; although no
+        * running CLI instance will return to any point where it needs
+        * this, we may have been called from the GUI, and it requires
+        * consistency here, if the user revisits this package within
+        * any single active session.
+        */
+       pkg->SetAttribute( installed_key, value_yes );
+
        /* Whether we just installed a virtual package or a real package,
         * we may now run its post-install script, (if any).
         */
index d2821ca..bd63ade 100644 (file)
@@ -524,6 +524,14 @@ EXTERN_C void pkgRemove( pkgActionItem *current )
        sysroot->SetAttribute( modified_key, value_yes );
       }
     }
+    /* Update the internal record of installed state; although no
+     * running CLI instance will return to any point where it needs
+     * this, we may have been called from the GUI, and it requires
+     * consistency here, if the user revisits this package within
+     * any single active session.
+     */
+    pkg->SetAttribute( installed_key, value_no );
+
     /* After package removal has been completed, we invoke any
      * post-remove script which may be associated with the package.
      */