From 8d80ed4f9cf8051b5566aaf3f639c76fe7d6de7c Mon Sep 17 00:00:00 2001 From: drw Date: Tue, 25 Feb 2003 00:39:29 +0000 Subject: Fix for bug #707 - remove package from status file only if package removal was successful. --- (limited to 'noncore/settings') diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index 51eca8b..e66c02d 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp @@ -57,6 +57,7 @@ Ipkg :: ~Ipkg() // dir is the directory to run ipkg in (defaults to "") bool Ipkg :: runIpkg( ) { + error = false; bool ret = false; QStringList commands; @@ -168,12 +169,6 @@ bool Ipkg :: runIpkg( ) delete dependantPackages; - // Finally, if we are removing a package, remove its entry from the /usr/lib/ipkg/status file - // to workaround an ipkg bug which stops reinstall to a different location - if ( option == "remove" ) - removeStatusEntry(); - - emit outputText( "Finished" ); emit outputText( "" ); return ret; @@ -340,10 +335,16 @@ void Ipkg::commandStderr(OProcess*, char *buffer, int buflen) lineStr=lineStr.left( buflen ); emit outputText( lineStr ); buffer[0] = '\0'; + error = true; } void Ipkg::processFinished() { + // Finally, if we are removing a package, remove its entry from the /usr/lib/ipkg/status file + // to workaround an ipkg bug which stops reinstall to a different location + if ( !error && option == "remove" ) + removeStatusEntry(); + delete proc; proc = 0; finished = true; diff --git a/noncore/settings/aqpkg/ipkg.h b/noncore/settings/aqpkg/ipkg.h index f08667b..d49bb04 100644 --- a/noncore/settings/aqpkg/ipkg.h +++ b/noncore/settings/aqpkg/ipkg.h @@ -65,6 +65,7 @@ public slots: private: bool createLinks; bool aborted; + bool error; QString option; QString package; QString destination; -- cgit v0.9.0.2