summaryrefslogtreecommitdiff
path: root/noncore/unsupported/oipkg/pmipkg.cpp
Unidiff
Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 0ae74da..5996e63 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -36,18 +36,19 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag
36PmIpkg::~PmIpkg() 36PmIpkg::~PmIpkg()
37{ 37{
38} 38}
39 39
40//#define PROC 40//#define PROC
41#define SYSTEM 41#define SYSTEM
42#define QT_QPROCESS_DEBUG
42int PmIpkg::runIpkg(const QString& args, const QString& dest ) 43int PmIpkg::runIpkg(const QString& args, const QString& dest )
43{ 44{
44 pvDebug(2,"PmIpkg::runIpkg "+args); 45 pvDebug(2,"PmIpkg::runIpkg "+args);
45 46 QDir::setCurrent("/tmp");
46#ifdef PROC 47#ifdef PROC
47 QStringList cmd = "ipkg "; 48 QString cmd;
48#endif 49#endif
49#ifdef SYSTEM 50#ifdef SYSTEM
50 QString cmd = "/usr/bin/ipkg "; 51 QString cmd = "/usr/bin/ipkg ";
51#endif 52#endif
52 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); 53 pvDebug( 3,"PmIpkg::runIpkg got dest="+dest);
53 if ( dest == "" ) 54 if ( dest == "" )
@@ -69,13 +70,13 @@ int PmIpkg::runIpkg(const QString& args, const QString& dest )
69 70
70 out( "<hr><br>Starting to "+ args+"<br>\n"); 71 out( "<hr><br>Starting to "+ args+"<br>\n");
71 cmd += args; 72 cmd += args;
72 int r = 0; 73 int r = 0;
73#ifdef PROC 74#ifdef PROC
74 QString o = "start"; 75 QString o = "start";
75 Process *ipkg = new Process( cmd ); 76 Process *ipkg = new Process(QStringList() << "ipkg" << cmd );
76 out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" ); 77 out( "running:<br>\n"+ipkg->arguments().join(" ")+"<br>\n" );
77 QString description; 78 QString description;
78 r = ipkg->exec("",o); 79 r = ipkg->exec("",o);
79 out( o ); 80 out( o );
80#endif 81#endif
81#ifdef SYSTEM 82#ifdef SYSTEM
@@ -294,13 +295,13 @@ void PmIpkg::install()
294 if ( to_install.count() == 0 ) return; 295 if ( to_install.count() == 0 ) return;
295 out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>"); 296 out("<b>"+tr("Installing")+"<br>"+tr("please wait")+"</b><br>");
296 for (uint i=0; i < to_install.count(); i++) 297 for (uint i=0; i < to_install.count(); i++)
297 { 298 {
298 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ) == 0 ) 299 if ( runIpkg("install " + to_install.at(i)->installName(), to_install.at(i)->dest() ) == 0 )
299 { 300 {
300 runwindow->progress->setProgress( to_install.at(i)->size().toInt() ); 301 runwindow->progress->setProgress( to_install.at(i)->size().toInt() + runwindow->progress->progress());
301 linkOpp = createLink; 302 linkOpp = createLink;
302 if ( to_install.at(i)->link() ) 303 if ( to_install.at(i)->link() )
303 { 304 {
304 out( "<br>creating links<br>" ); 305 out( "<br>creating links<br>" );
305 out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"<br>" ); 306 out( "for package "+to_install.at(i)->name()+" in "+to_install.at(i)->dest()+"<br>" );
306 makeLinks( to_install.at(i) ); 307 makeLinks( to_install.at(i) );