summaryrefslogtreecommitdiff
authortille <tille>2002-04-24 09:33:16 (UTC)
committer tille <tille>2002-04-24 09:33:16 (UTC)
commit8f67324fd1a60c165ae7043b9457f911b9690e43 (patch) (unidiff)
tree89956792ee33b839a463082e8a43bd1d919afaf9
parentd3fe6dead3c84f1cd94b913c3c6c8657485d70a1 (diff)
downloadopie-8f67324fd1a60c165ae7043b9457f911b9690e43.zip
opie-8f67324fd1a60c165ae7043b9457f911b9690e43.tar.gz
opie-8f67324fd1a60c165ae7043b9457f911b9690e43.tar.bz2
fixed: ipkg c version issues
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/unsupported/oipkg/TODO1
-rw-r--r--noncore/unsupported/oipkg/pmipkg.cpp36
2 files changed, 33 insertions, 4 deletions
diff --git a/noncore/unsupported/oipkg/TODO b/noncore/unsupported/oipkg/TODO
index d81e873..c53ca93 100644
--- a/noncore/unsupported/oipkg/TODO
+++ b/noncore/unsupported/oipkg/TODO
@@ -6,5 +6,6 @@
6* parse "to install" and "to remove" from status 6* parse "to install" and "to remove" from status
7* install local file 7* install local file
8* install to dest with click on packet 8* install to dest with click on packet
9* qcop
9* error handling 10* error handling
10* manage links 11* manage links
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp
index 681f2d4..94ca824 100644
--- a/noncore/unsupported/oipkg/pmipkg.cpp
+++ b/noncore/unsupported/oipkg/pmipkg.cpp
@@ -7,6 +7,7 @@
7 7
8#include <qpe/process.h> 8#include <qpe/process.h>
9#include <qpe/resource.h> 9#include <qpe/resource.h>
10#include <qpe/config.h>
10#include <qpe/stringutil.h> 11#include <qpe/stringutil.h>
11#include <qpe/qcopenvelope_qws.h> 12#include <qpe/qcopenvelope_qws.h>
12#include <qdir.h> 13#include <qdir.h>
@@ -23,6 +24,9 @@
23#include "runwindow.h" 24#include "runwindow.h"
24 25
25 26
27#define PARSE_FILELIST
28// #define IPKG_FILELIST
29
26PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) 30PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f )
27// : RunWindow ( p, name, f ) 31// : RunWindow ( p, name, f )
28 : QObject ( p ) 32 : QObject ( p )
@@ -52,7 +56,7 @@ int PmIpkg::runIpkg(const QString& args)
52 cmd += " -dest "+settings->getDestinationName(); 56 cmd += " -dest "+settings->getDestinationName();
53 cmd += " -force-defaults "; 57 cmd += " -force-defaults ";
54 58
55 out( "Starting to "+ args+"<br>\n"); 59 out( "<hr><br>Starting to "+ args+"<br>\n");
56 cmd += args; 60 cmd += args;
57 out( "running:<br>\n"+cmd+"<br>\n" ); 61 out( "running:<br>\n"+cmd+"<br>\n" );
58 int r = 0; 62 int r = 0;
@@ -66,6 +70,7 @@ int PmIpkg::runIpkg(const QString& args)
66#ifdef SYSTEM 70#ifdef SYSTEM
67 QString redirect = "/tmp/oipkg.pipe"; 71 QString redirect = "/tmp/oipkg.pipe";
68 cmd += " | tee "+redirect+" 2>&1"; 72 cmd += " | tee "+redirect+" 2>&1";
73 pvDebug(2, "running >"+cmd+"<");
69 r = system(cmd.latin1()); 74 r = system(cmd.latin1());
70 QFile f( redirect ); 75 QFile f( redirect );
71 while ( ! f.open(IO_ReadOnly) ) {}; 76 while ( ! f.open(IO_ReadOnly) ) {};
@@ -85,14 +90,30 @@ int PmIpkg::runIpkg(const QString& args)
85 return r; 90 return r;
86} 91}
87 92
88void PmIpkg::makeLinks(QString file) 93void PmIpkg::makeLinks(QString pack)
89{ 94{
95 pvDebug( 2, "PmIpkg::makeLinks "+ pack);
90 out( "<br>creating links<br>" ); 96 out( "<br>creating links<br>" );
91 QString dest = settings->getDestinationUrl(); 97 QString dest = settings->getDestinationUrl();
92 out("for package "+file+" in "+dest+"<br>"); 98 out("for package "+pack+" in "+dest+"<br>");
93 system(("ipkg -d "+dest+" files "+file+"> /tmp/oipkg.pipe 2>&1").latin1()); 99#ifdef IPKG_FILELIST
100 system(("ipkg -d "+dest+" files "+pack+"> /tmp/oipkg.pipe 2>&1").latin1());
94 QFile f( "/tmp/oipkg.pipe" ); 101 QFile f( "/tmp/oipkg.pipe" );
95 while ( ! f.open(IO_ReadOnly) ) {}; 102 while ( ! f.open(IO_ReadOnly) ) {};
103#endif
104#ifdef PARSE_FILELIST
105 {
106 Config cfg( "oipkg", Config::User );
107 cfg.setGroup( "Common" );
108 QString statusDir = cfg.readEntry( "statusDir", "" );
109 }
110 QString fn = dest+"/"+statusDir+"/info/"+pack+".list";
111 QFile f( fn );
112 if ( ! f.open(IO_ReadOnly) )
113 {
114 out( "<b>Panik!</b> Could not open:<br>"+fn );
115 };
116#endif
96 QTextStream t( &f ); 117 QTextStream t( &f );
97 QString fp; 118 QString fp;
98 while ( !t.eof() ) 119 while ( !t.eof() )
@@ -105,7 +126,14 @@ void PmIpkg::makeLinks(QString file)
105 126
106void PmIpkg::processLinkDir( QString file, QString dest ) 127void PmIpkg::processLinkDir( QString file, QString dest )
107{ 128{
129
130#ifdef PARSE_FILELIST
131 QString destFile = file;
132 file = dest+"/"+file;
133#endif
134#ifdef IPKG_FILELIST
108 QString destFile = file.right( file.length() - dest.length() ); 135 QString destFile = file.right( file.length() - dest.length() );
136#endif
109 QFileInfo fileInfo( file ); 137 QFileInfo fileInfo( file );
110 if ( fileInfo.isDir() ) 138 if ( fileInfo.isDir() )
111 { 139 {