summaryrefslogtreecommitdiff
path: root/noncore/settings/aqpkg/ipkg.cpp
authorandyq <andyq>2002-10-17 22:58:36 (UTC)
committer andyq <andyq>2002-10-17 22:58:36 (UTC)
commitcd48ed3935f1baa6392afee5764d0927abcf62cc (patch) (side-by-side diff)
tree54423b7242c59457ded23ce0dd1e89ce05b630b1 /noncore/settings/aqpkg/ipkg.cpp
parent4ce3fb5c10a50aece4ef8a78d07ed116ad754c27 (diff)
downloadopie-cd48ed3935f1baa6392afee5764d0927abcf62cc.zip
opie-cd48ed3935f1baa6392afee5764d0927abcf62cc.tar.gz
opie-cd48ed3935f1baa6392afee5764d0927abcf62cc.tar.bz2
Changed so that installings/removing and upgrading from/to multiple destinations
works better
Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index 6d0edad..02d4258 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -41,7 +41,7 @@ Ipkg :: ~Ipkg()
{
}
-// Option is what we are going to do - install, upgrade, download
+// Option is what we are going to do - install, upgrade, download, reinstall
// package is the package name to install - either a fully qualified path and ipk
// file (if stored locally) or just the name of the package (for a network package)
// packageName is the package name - (for a network package this will be the same as
@@ -89,7 +89,6 @@ bool Ipkg :: runIpkg( )
if ( destDir == "/" )
flags ^= MAKE_LINKS;
}
-
}
#ifdef X86
@@ -97,16 +96,23 @@ bool Ipkg :: runIpkg( )
cmd += IPKG_CONF;
#endif
- cmd += " " + option;
+
+ if ( option == "reinstall" )
+ cmd += " install";
+ else
+ cmd += " " + option;
if ( option != "upgrade" )
cmd += " " + package;
cmd += " 2>&1";
+
+ emit outputText( QString( "Dealing with package " ) + package );
+
qApp->processEvents();
// If we are removing packages and make links option is selected
// create the links
- if ( option == "remove" )
+ if ( option == "remove" || option == "reinstall" )
{
createLinks = false;
if ( flags & MAKE_LINKS )
@@ -125,7 +131,7 @@ bool Ipkg :: runIpkg( )
ret = executeIpkgCommand( cmd, option );
- if ( option == "install" )
+ if ( option == "install" || option == "reinstall" )
{
// If we are not removing packages and make links option is selected
// create the links
@@ -153,6 +159,7 @@ bool Ipkg :: runIpkg( )
delete dependantPackages;
emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") );
+ emit outputText( "" );
return ret;
}
@@ -182,7 +189,7 @@ int Ipkg :: executeIpkgCommand( QString &cmd, const QString option )
if ( lineStr != lineStrOld )
{
//See if we're finished
- if ( option == "install" )
+ if ( option == "install" || option == "reinstall" )
{
// Need to keep track of any dependant packages that get installed
// so that we can create links to them as necessary
@@ -242,11 +249,11 @@ QStringList* Ipkg :: getList( const QString &packageFilename, const QString &des
QString packageFileDir = destDir+"/usr/lib/ipkg/info/"+packageFilename+".list";
QFile f( packageFileDir );
- cout << "Try to open " << packageFileDir.latin1() << endl;
+ cout << "Try to open " << packageFileDir << endl;
if ( !f.open(IO_ReadOnly) )
{
// Couldn't open from dest, try from /
-// cout << "Could not open:" << packageFileDir << endl;
+ cout << "Could not open:" << packageFileDir << endl;
f.close();
packageFileDir = "/usr/lib/ipkg/info/"+packageFilename+".list";