summaryrefslogtreecommitdiff
authorandyq <andyq>2002-10-25 14:37:28 (UTC)
committer andyq <andyq>2002-10-25 14:37:28 (UTC)
commitf4007b261a7a4dc9672a1806be50ea16ccfc84f1 (patch) (side-by-side diff)
tree5a2469d149be879bd221a1d1f07d9cab7cab5a49
parent3421736c248c6ca7171bafdf3af9e2edf94eb593 (diff)
downloadopie-f4007b261a7a4dc9672a1806be50ea16ccfc84f1.zip
opie-f4007b261a7a4dc9672a1806be50ea16ccfc84f1.tar.gz
opie-f4007b261a7a4dc9672a1806be50ea16ccfc84f1.tar.bz2
Hopefully handles upgrading to newer packages correctly
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.cpp7
-rw-r--r--noncore/settings/aqpkg/installdlgimpl.h2
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp8
-rw-r--r--noncore/settings/aqpkg/networkpkgmgr.cpp4
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
@@ -90,7 +90,7 @@ InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *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";
@@ -208,9 +208,12 @@ void InstallDlgImpl :: installSelected()
}
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 );
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
@@ -28,7 +28,7 @@ using namespace std;
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;
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
@@ -63,12 +63,10 @@ bool Ipkg :: runIpkg( )
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";
@@ -101,7 +99,7 @@ bool Ipkg :: runIpkg( )
cmd += " install";
else
cmd += " " + option;
- if ( option != "upgrade" )
+ if ( package != "" )
cmd += " " + package;
cmd += " 2>&1";
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
@@ -559,7 +559,11 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
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;