-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.cpp | 7 | ||||
-rw-r--r-- | noncore/settings/aqpkg/installdlgimpl.h | 2 | ||||
-rw-r--r-- | noncore/settings/aqpkg/ipkg.cpp | 8 | ||||
-rw-r--r-- | noncore/settings/aqpkg/networkpkgmgr.cpp | 4 |
4 files changed, 13 insertions, 8 deletions
diff --git a/noncore/settings/aqpkg/installdlgimpl.cpp b/noncore/settings/aqpkg/installdlgimpl.cpp index f5aef94..83f983a 100644 --- a/noncore/settings/aqpkg/installdlgimpl.cpp +++ b/noncore/settings/aqpkg/installdlgimpl.cpp @@ -85,17 +85,17 @@ InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *d installList.push_back( item ); install += " " + item.packageName + "\n"; } else if ( item.option == "D" ) { removeList.push_back( item ); remove += " " + item.packageName + "\n"; } - else if ( item.option == "U" ) + else if ( item.option == "U" || item.option == "R" ) { updateList.push_back( item ); upgrade += " " + item.packageName + "\n"; } } output->setText( remove + install + upgrade ); } @@ -203,19 +203,22 @@ void InstallDlgImpl :: installSelected() pIpkg->setFlags( instFlags ); for ( it = installList.begin() ; it != installList.end() ; ++it ) { pIpkg->setPackage( it->packageName ); pIpkg->runIpkg(); } flags |= FORCE_REINSTALL; - pIpkg->setOption( "reinstall" ); for ( it = updateList.begin() ; it != updateList.end() ; ++it ) { + if ( it->option == "R" ) + pIpkg->setOption( "reinstall" ); + else + pIpkg->setOption( "upgrade" ); pIpkg->setDestination( it->destination->getDestinationName() ); pIpkg->setDestinationDir( it->destination->getDestinationPath() ); pIpkg->setPackage( it->packageName ); int tmpFlags = flags; if ( it->destination->linkToRoot() && it->recreateLinks ) tmpFlags |= MAKE_LINKS; pIpkg->setFlags( tmpFlags ); diff --git a/noncore/settings/aqpkg/installdlgimpl.h b/noncore/settings/aqpkg/installdlgimpl.h index 6716ced..9819b2e 100644 --- a/noncore/settings/aqpkg/installdlgimpl.h +++ b/noncore/settings/aqpkg/installdlgimpl.h @@ -23,17 +23,17 @@ using namespace std; #include <qstring.h> #include "ipkg.h" #include "install.h" class InstallData { public: - QString option; // I - install, D - delete, U - upgrade + QString option; // I - install, D - delete, R- reinstall U - upgrade QString packageName; Destination *destination; bool recreateLinks; }; class InstallDlgImpl : public InstallDlg { public: diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp index 368548b..731a336 100644 --- a/noncore/settings/aqpkg/ipkg.cpp +++ b/noncore/settings/aqpkg/ipkg.cpp @@ -58,22 +58,20 @@ bool Ipkg :: runIpkg( ) QString cmd = ""; if ( runtimeDir != "" ) { cmd += "cd "; cmd += runtimeDir; cmd += " ; "; } - cmd += "ipkg"; - - if ( option != "update" && option != "download" && option != "upgrade" ) + cmd += "ipkg -force-defaults"; + if ( option != "update" && option != "download" ) { cmd += " -dest "+ destination; - cmd += " -force-defaults"; if ( flags & FORCE_DEPENDS ) cmd += " -force-depends"; if ( flags & FORCE_REINSTALL ) cmd += " -force-reinstall"; if ( flags & FORCE_REMOVE ) cmd += " -force-removal-of-essential-packages"; if ( flags & FORCE_OVERWRITE ) @@ -96,17 +94,17 @@ bool Ipkg :: runIpkg( ) cmd += IPKG_CONF; #endif if ( option == "reinstall" ) cmd += " install"; else cmd += " " + option; - if ( option != "upgrade" ) + if ( package != "" ) cmd += " " + package; cmd += " 2>&1"; if ( package != "" ) emit outputText( QString( "Dealing with package " ) + package ); qApp->processEvents(); diff --git a/noncore/settings/aqpkg/networkpkgmgr.cpp b/noncore/settings/aqpkg/networkpkgmgr.cpp index a374266..3971aea 100644 --- a/noncore/settings/aqpkg/networkpkgmgr.cpp +++ b/noncore/settings/aqpkg/networkpkgmgr.cpp @@ -554,17 +554,21 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item ) { // item.option = stickyOption; } // Check if we are reinstalling the same version if ( p->getVersion() != p->getInstalledVersion() ) item.recreateLinks = true; else + { + if ( item.option == "U" ) + item.option = "R"; item.recreateLinks = false; + } // User hit cancel (on dlg - assume remove) return item; } } void NetworkPackageManager :: displayText( const QString &t ) { |