summaryrefslogtreecommitdiff
Side-by-side diff
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
@@ -69,49 +69,49 @@ InstallDlgImpl::InstallDlgImpl( vector<InstallData> &packageList, DataManager *d
if ( dit->getDestinationName() == defaultDest )
defIndex = i;
}
destination->setCurrentItem( defIndex );
vector<InstallData>::iterator it;
// setup package data
QString remove = "Remove\n";
QString install = "\nInstall\n";
QString upgrade = "\nUpgrade\n";
for ( it = packageList.begin() ; it != packageList.end() ; ++it )
{
InstallData item = *it;
if ( item.option == "I" )
{
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 );
}
InstallDlgImpl::InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget *parent, const char *name, bool modal, WFlags fl )
: InstallDlg( parent, name, modal, fl )
{
pIpkg = ipkg;
output->setText( initialText );
}
InstallDlgImpl::~InstallDlgImpl()
{
}
bool InstallDlgImpl :: showDlg()
{
showMaximized();
@@ -187,51 +187,54 @@ void InstallDlgImpl :: installSelected()
{
pIpkg->setDestination( it->destination->getDestinationName() );
pIpkg->setDestinationDir( it->destination->getDestinationPath() );
pIpkg->setPackage( it->packageName );
int tmpFlags = flags;
if ( it->destination->linkToRoot() )
tmpFlags |= MAKE_LINKS;
pIpkg->setFlags( tmpFlags );
pIpkg->runIpkg();
}
pIpkg->setOption( "install" );
pIpkg->setDestination( dest );
pIpkg->setDestinationDir( destDir );
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 );
pIpkg->runIpkg();
}
delete pIpkg;
}
btnInstall->setEnabled( true );
btnInstall->setText( tr( "Close" ) );
}
void InstallDlgImpl :: displayText(const QString &text )
{
QString t = output->text() + "\n" + text;
output->setText( t );
output->setCursorPosition( output->numLines(), 0 );
}
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
@@ -7,49 +7,49 @@
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#ifndef INSTALLDLGIMPL_H
#define INSTALLDLGIMPL_H
#include <vector>
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:
InstallDlgImpl( vector<InstallData> &packageList, DataManager *dataManager, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
InstallDlgImpl( Ipkg *ipkg, QString initialText, QWidget * parent = 0, const char* name = 0, bool modal = false, WFlags fl = 0 );
~InstallDlgImpl();
bool showDlg();
bool upgradeServer( QString &server );
protected:
private:
DataManager *dataMgr;
vector<InstallData> installList;
vector<InstallData> removeList;
vector<InstallData> updateList;
int flags;
Ipkg *pIpkg;
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
@@ -42,87 +42,85 @@ Ipkg :: ~Ipkg()
}
// 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)
// flags is the ipkg options flags
// dir is the directory to run ipkg in (defaults to "")
bool Ipkg :: runIpkg( )
{
bool ret = false;
QDir::setCurrent( "/tmp" );
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 )
cmd += " -force-overwrite";
// Handle make links
// Rules - If make links is switched on, create links to root
// if destDir is NOT /
if ( flags & MAKE_LINKS )
{
// 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" )
+ if ( package != "" )
cmd += " " + package;
cmd += " 2>&1";
if ( package != "" )
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" || option == "reinstall" )
{
createLinks = false;
if ( flags & MAKE_LINKS )
{
emit outputText( QString( "Removing symbolic links...\n" ) );
linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
emit outputText( QString( " " ) );
}
}
emit outputText( cmd );
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
@@ -538,49 +538,53 @@ InstallData NetworkPackageManager :: dealWithItem( QCheckListItem *item )
if ( stickyOption == "" )
{
QString msgtext;
msgtext.sprintf( "Do you wish to remove or reinstall\n%s?", (const char *)name );
switch( QMessageBox::information( this, "Remove or ReInstall",
msgtext, "Remove", "ReInstall" ) )
{
case 0: // Try again or Enter
item.option = "D";
break;
case 1: // Quit or Escape
item.option = "U";
break;
}
}
else
{
// 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 )
{
cout << t << endl;
}
void NetworkPackageManager :: letterPushed( QString t )
{
QCheckListItem *top = (QCheckListItem *)packagesList->firstChild();
QCheckListItem *start = (QCheckListItem *)packagesList->currentItem();
if ( packagesList->firstChild() == 0 )
return;
QCheckListItem *item;
if ( start == 0 )
{
item = (QCheckListItem *)packagesList->firstChild();
start = top;