OSDN Git Service

Correct sequence of installation/removal progress reporting.
authorKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 30 Apr 2012 20:10:23 +0000 (20:10 +0000)
committerKeith Marshall <keithmarshall@users.sourceforge.net>
Mon, 30 Apr 2012 20:10:23 +0000 (20:10 +0000)
ChangeLog
src/pkginst.cpp
src/pkgunst.cpp

index 0aaf243..a0b94cc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2012-04-30  Keith Marshall  <keithmarshall@users.sourceforge.net>
+
+       Correct sequence of installation/removal progress reporting.
+
+       * src/pkgunst.cpp (pkgRemove): Delay output of "removing package ..."
+       message, until after pre-remove hooks have run; this ensures that any
+       output from the pre-remove hook scripts appears in correct sequence.
+
+       * src/pkginst.cpp (pkgInstall): Likewise, for "installing package ..."
+       message, in relation to pre-install hooks.
+
 2012-04-26  Keith Marshall  <keithmarshall@users.sourceforge.net>
 
        mingw-get-0.5-beta-20120426-1 released.
index 84b0764..0ead650 100644 (file)
@@ -388,14 +388,7 @@ EXTERN_C void pkgInstall( pkgActionItem *current )
     if( current->HasAttribute( ACTION_DOWNLOAD ) == 0 )
     {
       /* ...and the required package has been successfully downloaded.
-       *
-       * FIXME: the notification here is somewhat redundant, but it
-       * does maintain symmetry with the "remove" operation, and will
-       * make "upgrade" notifications more logical; in any event, it
-       * should ultimately be made conditional on a "verbose" mode
-       * option selection.
        */
-      dmh_printf( " installing %s\n", pkg->GetPropVal( tarname_key, value_unknown ));
       if( current->Selection( to_remove ) == NULL )
       {
        /* The selected package has either not yet been installed,
@@ -410,7 +403,16 @@ EXTERN_C void pkgInstall( pkgActionItem *current )
        pkg->InvokeScript( "pre-install" );
 
        /* Now, we may proceed with package installation...
+        *
+        * FIXME: the notification here is somewhat redundant, but it
+        * does maintain symmetry with the "remove" operation, and will
+        * make "upgrade" notifications more logical; in any event, it
+        * should ultimately be made conditional on a "verbose" mode
+        * option selection.
         */
+       dmh_printf( " installing %s\n",
+           pkg->GetPropVal( tarname_key, value_unknown )
+         );
        if(  match_if_explicit( pkgfile = pkg->ArchiveName(), value_none )
        && ((tarname = pkg->GetPropVal( tarname_key, NULL )) != NULL)       )
        {
index 3b06a50..d2821ca 100644 (file)
@@ -312,13 +312,15 @@ EXTERN_C void pkgRemove( pkgActionItem *current )
     const char *tarname = pkg->GetPropVal( tarname_key, value_unknown );
     pkgXmlNode *sysroot = sysroot_lookup( pkg, tarname );
 
-    dmh_printf( " removing %s %s\n", pkg->GetName(), tarname );
-
     /* If the package we are about to remove has an associated
-     * pre-remove script, now is the time to invoke it.
+     * pre-remove script, now is the time to invoke it...
      */
     pkg->InvokeScript( "pre-remove" );
 
+    /* ...before we proceed to removal of actual package content.
+     */
+    dmh_printf( " removing %s %s\n", pkg->GetName(), tarname );
+
     /* Removal of virtual (meta) packages is comparitively simple;
      * identified by having an associated archive name of "none", they
      * have no associated archive file, no installed footprint on disk,