Diffstat (limited to 'noncore/settings/aqpkg/ipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 21 |
1 files changed, 14 insertions, 7 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 @@ -38,13 +38,13 @@ Ipkg :: Ipkg() } 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 // package parameter) // dest is the destination alias (from ipk.conf) // destDir is the dir that the destination alias points to (used to link to root) @@ -86,30 +86,36 @@ bool Ipkg :: runIpkg( ) { // If destDir == / turn off make links as package is being insalled // to root already. if ( destDir == "/" ) flags ^= MAKE_LINKS; } - } #ifdef X86 cmd += " -f "; cmd += IPKG_CONF; #endif + + 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 ) { emit outputText( QString( "Removing symbolic links...\n" ) ); linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); @@ -122,13 +128,13 @@ bool Ipkg :: runIpkg( ) // Execute command dependantPackages = new QList<QString>; dependantPackages->setAutoDelete( true ); 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 createLinks = true; if ( flags & MAKE_LINKS ) { @@ -150,12 +156,13 @@ bool Ipkg :: runIpkg( ) } } delete dependantPackages; emit outputText( QString( "Finished - status=" ) + (ret ? "success" : "failure") ); + emit outputText( "" ); return ret; } int Ipkg :: executeIpkgCommand( QString &cmd, const QString option ) { @@ -179,13 +186,13 @@ int Ipkg :: executeIpkgCommand( QString &cmd, const QString option ) lineStr = line; lineStr=lineStr.left( lineStr.length()-1 ); 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 if ( lineStr.startsWith( "Installing " ) ) { cout << "LineStr = " << lineStr << endl; @@ -239,17 +246,17 @@ void Ipkg :: linkPackage( const QString &packFileName, const QString &dest, cons QStringList* Ipkg :: getList( const QString &packageFilename, const QString &destDir ) { 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"; f.setName( packageFileDir ); // cout << "Try to open " << packageFileDir.latin1() << endl; if ( ! f.open(IO_ReadOnly) ) |