Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /src/pkgunst.cpp [ef6073] .. [940fb5] Maximize Restore

  Switch to side-by-side view

--- a/src/pkgunst.cpp
+++ b/src/pkgunst.cpp
@@ -77,11 +77,11 @@
   return reftag->GetPropVal( pathname_key, fallback );
 }
 
-int pkgActionItem::SetAuthorities( pkgActionItem *current )
+unsigned long pkgActionItem::SetAuthorities( pkgActionItem *current )
 {
   /* Helper method to either grant or revoke authority for removal of
    * any package, either permanently when the user requests that it be
-   * removed, or temporarily in preparation for replacement be a newer
+   * removed, or temporarily in preparation for replacement by a newer
    * version, when scheduled for upgrade.
    *
    * This is a multiple pass method, iterating over the entire list
@@ -302,7 +302,8 @@
   /* Common handler for all package removal tasks...
    */
   pkgXmlNode *pkg;
-  if( (pkg = current->Selection( to_remove )) != NULL )
+  if( ((pkg = current->Selection( to_remove )) != NULL)
+  &&  (current->HasAttribute( ACTION_DOWNLOAD_OK ) == ACTION_REMOVE_OK)  )
   {
     /* We've identified a candidate package for removal;
      * first, identify the canonical tarname for the package,
@@ -517,6 +518,18 @@
       }
     }
   }
+  else if( (pkg != NULL) && current->HasAttribute( ACTION_DOWNLOAD ) )
+  {
+    /* This condition arises only when an upgrade has been requested,
+     * but the package archive for the new version is not available in
+     * the local package cache, and all attempts to download it have
+     * been unsuccessful; diagnose, and otherwise ignore it.
+     */
+    dmh_notify( DMH_WARNING, "not removing installed %s\n", pkg->GetName() );
+    dmh_notify( DMH_WARNING, "%s is still installed\n",
+	pkg->GetPropVal( tarname_key, value_unknown )
+      );
+  }
 }
 
 /* $RCSfile$: end of file */