author | tille <tille> | 2002-07-15 16:03:13 (UTC) |
---|---|---|
committer | tille <tille> | 2002-07-15 16:03:13 (UTC) |
commit | dcea0e50a00ed9efb988ded5abf5d39de1bea393 (patch) (unidiff) | |
tree | a0deba1e0a736c8ae6bae5dcd73b457ed27962d8 | |
parent | ecf2a873be3274bb30be0c659b7db6ef8a43be84 (diff) | |
download | opie-dcea0e50a00ed9efb988ded5abf5d39de1bea393.zip opie-dcea0e50a00ed9efb988ded5abf5d39de1bea393.tar.gz opie-dcea0e50a00ed9efb988ded5abf5d39de1bea393.tar.bz2 |
oipkg works with ipkg 0.99.20
-rw-r--r-- | noncore/unsupported/oipkg/opie-oipkg.control | 2 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 8 | ||||
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.h | 1 |
3 files changed, 2 insertions, 9 deletions
diff --git a/noncore/unsupported/oipkg/opie-oipkg.control b/noncore/unsupported/oipkg/opie-oipkg.control index 1cff44e..ff1c6ca 100644 --- a/noncore/unsupported/oipkg/opie-oipkg.control +++ b/noncore/unsupported/oipkg/opie-oipkg.control | |||
@@ -1,9 +1,9 @@ | |||
1 | Files: bin/oipkg apps/Settings/oipkg.desktop pics/oipkg/* | 1 | Files: bin/oipkg apps/Settings/oipkg.desktop pics/oipkg/* |
2 | Priority: optional | 2 | Priority: optional |
3 | Section: opie/settings | 3 | Section: opie/settings |
4 | Maintainer: Patrick S. Vogt <tille@almana.ch> | 4 | Maintainer: Patrick S. Vogt <tille@almana.ch> |
5 | Architecture: arm | 5 | Architecture: arm |
6 | Version: $QPE_VERSION-$SUB_VERSION | 6 | Version: $QPE_VERSION-$SUB_VERSION |
7 | Depends: opie-base ($QPE_VERSION), ipkg (>0.9) | 7 | Depends: opie-base ($QPE_VERSION), ipkg (>0.99.20) |
8 | Description: Opie Projects advanced gui ipkg installer | 8 | Description: Opie Projects advanced gui ipkg installer |
9 | A GUI front-end to ipkg for the Opie environment. | 9 | A GUI front-end to ipkg for the Opie environment. |
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 71e9b88..2ed86ee 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -1,260 +1,254 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
10 | #include "pmipkg.h" | 10 | #include "pmipkg.h" |
11 | #include "pksettings.h" | 11 | #include "pksettings.h" |
12 | #include "package.h" | 12 | #include "package.h" |
13 | #include "packagelistitem.h" | 13 | #include "packagelistitem.h" |
14 | 14 | ||
15 | #include <opie/oprocess.h> | 15 | #include <opie/oprocess.h> |
16 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
17 | #include <qpe/config.h> | 17 | #include <qpe/config.h> |
18 | #include <qpe/stringutil.h> | 18 | #include <qpe/stringutil.h> |
19 | #include <qpe/qpeapplication.h> | 19 | #include <qpe/qpeapplication.h> |
20 | #include <qdir.h> | 20 | #include <qdir.h> |
21 | #include <qfile.h> | 21 | #include <qfile.h> |
22 | #include <qgroupbox.h> | 22 | #include <qgroupbox.h> |
23 | #include <qmultilineedit.h> | 23 | #include <qmultilineedit.h> |
24 | #include <qstring.h> | 24 | #include <qstring.h> |
25 | #include <qcheckbox.h> | 25 | #include <qcheckbox.h> |
26 | #include <qtextstream.h> | 26 | #include <qtextstream.h> |
27 | #include <qtextview.h> | 27 | #include <qtextview.h> |
28 | #include <qmessagebox.h> | 28 | #include <qmessagebox.h> |
29 | #include <qprogressbar.h> | 29 | #include <qprogressbar.h> |
30 | #include <qpushbutton.h> | 30 | #include <qpushbutton.h> |
31 | #include <qlayout.h> | 31 | #include <qlayout.h> |
32 | 32 | ||
33 | #include <stdlib.h> | 33 | #include <stdlib.h> |
34 | #include <unistd.h> | 34 | #include <unistd.h> |
35 | 35 | ||
36 | #include "mainwindow.h" | 36 | #include "mainwindow.h" |
37 | 37 | ||
38 | 38 | ||
39 | //#define OPROCESS | 39 | //#define OPROCESS |
40 | 40 | ||
41 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) | 41 | PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlags f ) |
42 | : QObject ( p ), shellWarning(true) | 42 | : QObject ( p ) |
43 | { | 43 | { |
44 | settings = s; | 44 | settings = s; |
45 | runwindow = new RunWindow( p, name, true, f ); | 45 | runwindow = new RunWindow( p, name, true, f ); |
46 | #ifdef OPROCESS | 46 | #ifdef OPROCESS |
47 | ipkgProcess = new OProcess(); | 47 | ipkgProcess = new OProcess(); |
48 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 48 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
49 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 49 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
50 | 50 | ||
51 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), | 51 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), |
52 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 52 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
53 | installDialog = 0; | 53 | installDialog = 0; |
54 | #endif | 54 | #endif |
55 | } | 55 | } |
56 | 56 | ||
57 | PmIpkg::~PmIpkg() | 57 | PmIpkg::~PmIpkg() |
58 | { | 58 | { |
59 | #ifdef OPROCESS | 59 | #ifdef OPROCESS |
60 | delete ipkgProcess; | 60 | delete ipkgProcess; |
61 | #endif | 61 | #endif |
62 | } | 62 | } |
63 | 63 | ||
64 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | 64 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) |
65 | { | 65 | { |
66 | bool ret=false; | 66 | bool ret=false; |
67 | QDir::setCurrent("/tmp"); | 67 | QDir::setCurrent("/tmp"); |
68 | QString cmd = "/usr/bin/ipkg "; | 68 | QString cmd = "/usr/bin/ipkg "; |
69 | #ifdef OPROCESS | 69 | #ifdef OPROCESS |
70 | ipkgProcess->kill(); | 70 | ipkgProcess->kill(); |
71 | ipkgProcess->clearArguments(); | 71 | ipkgProcess->clearArguments(); |
72 | *ipkgProcess << "/usr/bin/ipkg "; | 72 | *ipkgProcess << "/usr/bin/ipkg "; |
73 | cmd = ""; | 73 | cmd = ""; |
74 | #endif | 74 | #endif |
75 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); | 75 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); |
76 | if ( dest == "" ) | 76 | if ( dest == "" ) |
77 | cmd += " -dest "+settings->getDestinationName(); | 77 | cmd += " -dest "+settings->getDestinationName(); |
78 | else | 78 | else |
79 | cmd += " -dest "+ dest; | 79 | cmd += " -dest "+ dest; |
80 | 80 | ||
81 | cmd += " -force-defaults "; | 81 | cmd += " -force-defaults "; |
82 | 82 | ||
83 | if (installDialog && installDialog->_force_depends) | 83 | if (installDialog && installDialog->_force_depends) |
84 | { | 84 | { |
85 | if (installDialog->_force_depends->isChecked()) | 85 | if (installDialog->_force_depends->isChecked()) |
86 | cmd += " -force-depends "; | 86 | cmd += " -force-depends "; |
87 | if (installDialog->_force_reinstall->isChecked()) | 87 | if (installDialog->_force_reinstall->isChecked()) |
88 | cmd += " -force-reinstall "; | 88 | cmd += " -force-reinstall "; |
89 | if (installDialog->_force_remove->isChecked()) | 89 | if (installDialog->_force_remove->isChecked()) |
90 | cmd += " -force-removal-of-essential-packages "; | 90 | cmd += " -force-removal-of-essential-packages "; |
91 | } | 91 | } |
92 | 92 | ||
93 | out( "Starting to "+ args+"\n"); | 93 | out( "Starting to "+ args+"\n"); |
94 | cmd += args; | 94 | cmd += args; |
95 | out( "running:\n"+cmd+"\n" ); | 95 | out( "running:\n"+cmd+"\n" ); |
96 | pvDebug(2,"running:"+cmd); | 96 | pvDebug(2,"running:"+cmd); |
97 | #ifdef OPROCESS | 97 | #ifdef OPROCESS |
98 | *ipkgProcess << args; | 98 | *ipkgProcess << args; |
99 | out( "running:\n" + cmd); | 99 | out( "running:\n" + cmd); |
100 | *ipkgProcess << cmd; | 100 | *ipkgProcess << cmd; |
101 | 101 | ||
102 | //debug | 102 | //debug |
103 | delete ipkgProcess; | 103 | delete ipkgProcess; |
104 | ipkgProcess = new OProcess(); | 104 | ipkgProcess = new OProcess(); |
105 | ipkgProcess->clearArguments(); | 105 | ipkgProcess->clearArguments(); |
106 | *ipkgProcess << "/bin/ls "; | 106 | *ipkgProcess << "/bin/ls "; |
107 | //debug | 107 | //debug |
108 | QValueList<QCString> a = ipkgProcess->args(); | 108 | QValueList<QCString> a = ipkgProcess->args(); |
109 | QValueList<QCString>::Iterator it; | 109 | QValueList<QCString>::Iterator it; |
110 | for( it = a.begin(); it != a.end(); ++it ) | 110 | for( it = a.begin(); it != a.end(); ++it ) |
111 | { | 111 | { |
112 | out( *it ); | 112 | out( *it ); |
113 | cmd += *it; | 113 | cmd += *it; |
114 | } | 114 | } |
115 | 115 | ||
116 | pvDebug(2,"running:"+cmd); | 116 | pvDebug(2,"running:"+cmd); |
117 | qApp->processEvents(); | 117 | qApp->processEvents(); |
118 | // sleep(1); | 118 | // sleep(1); |
119 | ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); | 119 | ret = ipkgProcess->start(OProcess::NotifyOnExit,OProcess::AllOutput); |
120 | if ( !ret ) { | 120 | if ( !ret ) { |
121 | pvDebug(2,"Could not execute '" + cmd); | 121 | pvDebug(2,"Could not execute '" + cmd); |
122 | out("\nError while executing "+ cmd+"\n\n"); | 122 | out("\nError while executing "+ cmd+"\n\n"); |
123 | out("\nError while executing\n\n"); | 123 | out("\nError while executing\n\n"); |
124 | // return false; | 124 | // return false; |
125 | } | 125 | } |
126 | 126 | ||
127 | while ( ipkgProcess->isRunning() ) | 127 | while ( ipkgProcess->isRunning() ) |
128 | { | 128 | { |
129 | out("."); | 129 | out("."); |
130 | pvDebug(7,"wait for oprocess to terminate"); | 130 | pvDebug(7,"wait for oprocess to terminate"); |
131 | qApp->processEvents(); | 131 | qApp->processEvents(); |
132 | }; | 132 | }; |
133 | #else | 133 | #else |
134 | qApp->processEvents(); | 134 | qApp->processEvents(); |
135 | FILE *fp; | 135 | FILE *fp; |
136 | char line[130]; | 136 | char line[130]; |
137 | QString lineStr, lineStrOld; | 137 | QString lineStr, lineStrOld; |
138 | sleep(1); | 138 | sleep(1); |
139 | cmd +=" 2>&1"; | 139 | cmd +=" 2>&1"; |
140 | fp = popen( (const char *) cmd, "r"); | 140 | fp = popen( (const char *) cmd, "r"); |
141 | if ( fp == NULL ) { | 141 | if ( fp == NULL ) { |
142 | qDebug("Could not execute '" + cmd + "'! err=%d", fp); | 142 | qDebug("Could not execute '" + cmd + "'! err=%d", fp); |
143 | out("\nError while executing "+ cmd+"\n\n"); | 143 | out("\nError while executing "+ cmd+"\n\n"); |
144 | ret = false; | 144 | ret = false; |
145 | } else { | 145 | } else { |
146 | while ( fgets( line, sizeof line, fp) != NULL) | 146 | while ( fgets( line, sizeof line, fp) != NULL) |
147 | { | 147 | { |
148 | lineStr = line; | 148 | lineStr = line; |
149 | lineStr=lineStr.left(lineStr.length()-1); | 149 | lineStr=lineStr.left(lineStr.length()-1); |
150 | //Configuring opie-oipkg...Done | 150 | //Configuring opie-oipkg...Done |
151 | if (lineStr.contains("Done")) ret = true; | 151 | if (lineStr.contains("Done")) ret = true; |
152 | if (lineStr!=lineStrOld) | 152 | if (lineStr!=lineStrOld) |
153 | out(lineStr); | 153 | out(lineStr); |
154 | lineStrOld = lineStr; | 154 | lineStrOld = lineStr; |
155 | qApp->processEvents(); | 155 | qApp->processEvents(); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | pclose(fp); | 158 | pclose(fp); |
159 | if (!ret && shellWarning) | ||
160 | { | ||
161 | shellWarning = false; | ||
162 | QMessageBox::critical( runwindow, tr("install failure"), | ||
163 | tr("<p>Did you start me from the command line?</p>")); | ||
164 | } | ||
165 | #endif | 159 | #endif |
166 | //out( "Finished!"); | 160 | //out( "Finished!"); |
167 | pvDebug(2,QString(ret?"success\n":"failure\n")); | 161 | pvDebug(2,QString(ret?"success\n":"failure\n")); |
168 | return ret; | 162 | return ret; |
169 | } | 163 | } |
170 | 164 | ||
171 | void PmIpkg::makeLinks(Package *pack) | 165 | void PmIpkg::makeLinks(Package *pack) |
172 | { | 166 | { |
173 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 167 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
174 | QString pn = pack->name(); | 168 | QString pn = pack->name(); |
175 | linkPackage( pack->packageName(), pack->dest() ); | 169 | linkPackage( pack->packageName(), pack->dest() ); |
176 | } | 170 | } |
177 | 171 | ||
178 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 172 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
179 | { | 173 | { |
180 | QString dest = settings->getDestinationUrlByName( d ); | 174 | QString dest = settings->getDestinationUrlByName( d ); |
181 | dest = dest==""?d:dest; | 175 | dest = dest==""?d:dest; |
182 | // if (dest == "/" ) return 0; | 176 | // if (dest == "/" ) return 0; |
183 | { | 177 | { |
184 | Config cfg( "oipkg", Config::User ); | 178 | Config cfg( "oipkg", Config::User ); |
185 | cfg.setGroup( "Common" ); | 179 | cfg.setGroup( "Common" ); |
186 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 180 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
187 | } | 181 | } |
188 | QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 182 | QString packFileDir = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
189 | QFile f( packFileDir ); | 183 | QFile f( packFileDir ); |
190 | qDebug("Try to open %s", packFileDir.latin1()); | 184 | qDebug("Try to open %s", packFileDir.latin1()); |
191 | if ( ! f.open(IO_ReadOnly) ) | 185 | if ( ! f.open(IO_ReadOnly) ) |
192 | { | 186 | { |
193 | out( "Could not open:\n"+packFileDir ); | 187 | out( "Could not open:\n"+packFileDir ); |
194 | f.close(); | 188 | f.close(); |
195 | packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; | 189 | packFileDir = "/"+statusDir+"/info/"+packFileName+".list"; |
196 | f.setName( packFileDir ); | 190 | f.setName( packFileDir ); |
197 | qDebug("Try to open %s", packFileDir.latin1()); | 191 | qDebug("Try to open %s", packFileDir.latin1()); |
198 | if ( ! f.open(IO_ReadOnly) ) | 192 | if ( ! f.open(IO_ReadOnly) ) |
199 | { | 193 | { |
200 | qDebug(" Panik! Could not open"+packFileDir); | 194 | qDebug(" Panik! Could not open"+packFileDir); |
201 | out( "Could not open:\n"+packFileDir+"\n Panik!" ); | 195 | out( "Could not open:\n"+packFileDir+"\n Panik!" ); |
202 | return (QStringList*)0; | 196 | return (QStringList*)0; |
203 | } | 197 | } |
204 | } | 198 | } |
205 | QStringList *fileList = new QStringList(); | 199 | QStringList *fileList = new QStringList(); |
206 | QTextStream t( &f ); | 200 | QTextStream t( &f ); |
207 | while ( !t.eof() ) | 201 | while ( !t.eof() ) |
208 | { | 202 | { |
209 | *fileList += t.readLine(); | 203 | *fileList += t.readLine(); |
210 | } | 204 | } |
211 | f.close(); | 205 | f.close(); |
212 | return fileList; | 206 | return fileList; |
213 | } | 207 | } |
214 | 208 | ||
215 | void PmIpkg::linkPackage( QString packFileName, QString dest ) | 209 | void PmIpkg::linkPackage( QString packFileName, QString dest ) |
216 | { | 210 | { |
217 | if (dest == "root" || dest == "/" ) return; | 211 | if (dest == "root" || dest == "/" ) return; |
218 | QStringList *fileList = getList( packFileName, dest ); | 212 | QStringList *fileList = getList( packFileName, dest ); |
219 | processFileList( fileList, dest ); | 213 | processFileList( fileList, dest ); |
220 | delete fileList; | 214 | delete fileList; |
221 | } | 215 | } |
222 | 216 | ||
223 | void PmIpkg::processFileList( QStringList *fileList, QString d ) | 217 | void PmIpkg::processFileList( QStringList *fileList, QString d ) |
224 | { | 218 | { |
225 | if (!fileList) return; | 219 | if (!fileList) return; |
226 | for (uint i=0; i < fileList->count(); i++) | 220 | for (uint i=0; i < fileList->count(); i++) |
227 | { | 221 | { |
228 | QString dest = settings->getDestinationUrlByName( d ); | 222 | QString dest = settings->getDestinationUrlByName( d ); |
229 | dest = dest==""?d:dest; | 223 | dest = dest==""?d:dest; |
230 | processLinkDir( (*fileList)[i], dest ); | 224 | processLinkDir( (*fileList)[i], dest ); |
231 | } | 225 | } |
232 | } | 226 | } |
233 | 227 | ||
234 | 228 | ||
235 | void PmIpkg::processLinkDir( QString file, QString dest ) | 229 | void PmIpkg::processLinkDir( QString file, QString dest ) |
236 | { | 230 | { |
237 | pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); | 231 | pvDebug( 4,"PmIpkg::processLinkDir "+file+" to "+ dest); |
238 | if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); | 232 | if (linkOpp==createLink) pvDebug( 4,"opp: createLink"); |
239 | if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); | 233 | if (linkOpp==removeLink) pvDebug( 4,"opp: removeLink"); |
240 | if ( dest == "???" || dest == "" ) return; | 234 | if ( dest == "???" || dest == "" ) return; |
241 | QString destFile = file; | 235 | QString destFile = file; |
242 | file = dest+"/"+file; | 236 | file = dest+"/"+file; |
243 | if (file == dest) return; | 237 | if (file == dest) return; |
244 | // if (linkOpp==createLink) out( "\ncreating links\n" ); | 238 | // if (linkOpp==createLink) out( "\ncreating links\n" ); |
245 | // if (linkOpp==removeLink) out( "\nremoving links\n" ); | 239 | // if (linkOpp==removeLink) out( "\nremoving links\n" ); |
246 | QFileInfo fileInfo( file ); | 240 | QFileInfo fileInfo( file ); |
247 | if ( fileInfo.isDir() ) | 241 | if ( fileInfo.isDir() ) |
248 | { | 242 | { |
249 | pvDebug(4, "process dir "+file); | 243 | pvDebug(4, "process dir "+file); |
250 | QDir destDir( destFile ); | 244 | QDir destDir( destFile ); |
251 | if (linkOpp==createLink) destDir.mkdir( destFile, true ); | 245 | if (linkOpp==createLink) destDir.mkdir( destFile, true ); |
252 | QDir d( file ); | 246 | QDir d( file ); |
253 | // d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); | 247 | // d.setFilter( QDir::Files | QDir::Hidden | QDir::NoSymLinks ); |
254 | const QFileInfoList *list = d.entryInfoList(); | 248 | const QFileInfoList *list = d.entryInfoList(); |
255 | QFileInfoListIterator it( *list ); | 249 | QFileInfoListIterator it( *list ); |
256 | QFileInfo *fi; | 250 | QFileInfo *fi; |
257 | while ( (fi=it.current()) ) | 251 | while ( (fi=it.current()) ) |
258 | { | 252 | { |
259 | pvDebug(4, "processLinkDir "+fi->absFilePath()); | 253 | pvDebug(4, "processLinkDir "+fi->absFilePath()); |
260 | processLinkDir( fi->absFilePath(), dest ); | 254 | processLinkDir( fi->absFilePath(), dest ); |
diff --git a/noncore/unsupported/oipkg/pmipkg.h b/noncore/unsupported/oipkg/pmipkg.h index 662800a..c84acfa 100644 --- a/noncore/unsupported/oipkg/pmipkg.h +++ b/noncore/unsupported/oipkg/pmipkg.h | |||
@@ -1,74 +1,73 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | * * | 2 | * * |
3 | * This program is free software; you can redistribute it and/or modify * | 3 | * This program is free software; you can redistribute it and/or modify * |
4 | * it under the terms of the GNU General Public License as published by * | 4 | * it under the terms of the GNU General Public License as published by * |
5 | * the Free Software Foundation; either version 2 of the License, or * | 5 | * the Free Software Foundation; either version 2 of the License, or * |
6 | * (at your option) any later version. * | 6 | * (at your option) any later version. * |
7 | * * | 7 | * * |
8 | ***************************************************************************/ | 8 | ***************************************************************************/ |
9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> | 9 | // (c) 2002 Patrick S. Vogt <tille@handhelds.org> |
10 | #ifndef PMIPKG_H | 10 | #ifndef PMIPKG_H |
11 | #define PMIPKG_H | 11 | #define PMIPKG_H |
12 | 12 | ||
13 | 13 | ||
14 | #include <opie/oprocess.h> | 14 | #include <opie/oprocess.h> |
15 | #include <qobject.h> | 15 | #include <qobject.h> |
16 | #include <qlist.h> | 16 | #include <qlist.h> |
17 | #include <qstring.h> | 17 | #include <qstring.h> |
18 | #include <qwidget.h> | 18 | #include <qwidget.h> |
19 | #include "pksettings.h" | 19 | #include "pksettings.h" |
20 | #include "runwindow.h" | 20 | #include "runwindow.h" |
21 | #include "packagelist.h" | 21 | #include "packagelist.h" |
22 | #include "installdialog.h" | 22 | #include "installdialog.h" |
23 | #include "debug.h" | 23 | #include "debug.h" |
24 | 24 | ||
25 | #define createLink 0 | 25 | #define createLink 0 |
26 | #define removeLink 1 | 26 | #define removeLink 1 |
27 | 27 | ||
28 | class Package; | 28 | class Package; |
29 | class PmIpkg : public QObject | 29 | class PmIpkg : public QObject |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | public: | 32 | public: |
33 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); | 33 | PmIpkg( PackageManagerSettings* , QWidget* p=0, const char * name=0, WFlags f=0 ); |
34 | ~PmIpkg(); | 34 | ~PmIpkg(); |
35 | 35 | ||
36 | int linkOpp; | 36 | int linkOpp; |
37 | void loadList( PackageList* ); | 37 | void loadList( PackageList* ); |
38 | void commit(); | 38 | void commit(); |
39 | void update(); | 39 | void update(); |
40 | void show(); | 40 | void show(); |
41 | void clearLists(); | 41 | void clearLists(); |
42 | 42 | ||
43 | public slots: | 43 | public slots: |
44 | void doIt(); | 44 | void doIt(); |
45 | void install(); | 45 | void install(); |
46 | void remove(); | 46 | void remove(); |
47 | void installFile(const QString &fileName, const QString &dest=""); | 47 | void installFile(const QString &fileName, const QString &dest=""); |
48 | void removeFile(const QString &fileName, const QString &dest=""); | 48 | void removeFile(const QString &fileName, const QString &dest=""); |
49 | void createLinks( const QString &dest ); | 49 | void createLinks( const QString &dest ); |
50 | void removeLinks( const QString &dest ); | 50 | void removeLinks( const QString &dest ); |
51 | 51 | ||
52 | //private slots: | 52 | //private slots: |
53 | void getIpkgOutput(OProcess *proc, char *buffer, int buflen); | 53 | void getIpkgOutput(OProcess *proc, char *buffer, int buflen); |
54 | 54 | ||
55 | private: | 55 | private: |
56 | bool shellWarning; | ||
57 | OProcess *ipkgProcess; | 56 | OProcess *ipkgProcess; |
58 | PackageManagerSettings* settings; | 57 | PackageManagerSettings* settings; |
59 | RunWindow *runwindow; | 58 | RunWindow *runwindow; |
60 | InstallDialog *installDialog; | 59 | InstallDialog *installDialog; |
61 | QList<Package> to_remove; | 60 | QList<Package> to_remove; |
62 | QList<Package> to_install; | 61 | QList<Package> to_install; |
63 | void makeLinks(Package*); | 62 | void makeLinks(Package*); |
64 | void linkPackage( QString, QString ); | 63 | void linkPackage( QString, QString ); |
65 | void processLinkDir( QString , QString ); | 64 | void processLinkDir( QString , QString ); |
66 | bool runIpkg(const QString& args, const QString& dest="" ); | 65 | bool runIpkg(const QString& args, const QString& dest="" ); |
67 | void out( QString ); | 66 | void out( QString ); |
68 | QStringList* getList( QString, QString ); | 67 | QStringList* getList( QString, QString ); |
69 | void processFileList( QStringList*, QString ); | 68 | void processFileList( QStringList*, QString ); |
70 | 69 | ||
71 | 70 | ||
72 | }; | 71 | }; |
73 | 72 | ||
74 | #endif | 73 | #endif |