Diffstat (limited to 'noncore/unsupported/oipkg/pmipkg.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/unsupported/oipkg/pmipkg.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/unsupported/oipkg/pmipkg.cpp b/noncore/unsupported/oipkg/pmipkg.cpp index 7d0e246..89309a2 100644 --- a/noncore/unsupported/oipkg/pmipkg.cpp +++ b/noncore/unsupported/oipkg/pmipkg.cpp | |||
@@ -39,49 +39,49 @@ PmIpkg::PmIpkg( PackageManagerSettings* s, QWidget* p, const char * name, WFlag | |||
39 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), | 39 | connect ( ipkgProcess, SIGNAL(receivedStdout(OProcess*,char*,int)), |
40 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 40 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
41 | 41 | ||
42 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), | 42 | connect ( ipkgProcess, SIGNAL(receivedStderr(OProcess*,char*,int)), |
43 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); | 43 | this, SLOT(getIpkgOutput(OProcess*,char*,int))); |
44 | installDialog = 0; | 44 | installDialog = 0; |
45 | #endif | 45 | #endif |
46 | } | 46 | } |
47 | 47 | ||
48 | PmIpkg::~PmIpkg() | 48 | PmIpkg::~PmIpkg() |
49 | { | 49 | { |
50 | #ifdef OPROCESS | 50 | #ifdef OPROCESS |
51 | delete ipkgProcess; | 51 | delete ipkgProcess; |
52 | #endif | 52 | #endif |
53 | } | 53 | } |
54 | 54 | ||
55 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | 55 | bool PmIpkg::runIpkg(const QString& args, const QString& dest ) |
56 | { | 56 | { |
57 | bool ret=false; | 57 | bool ret=false; |
58 | QDir::setCurrent("/tmp"); | 58 | QDir::setCurrent("/tmp"); |
59 | QString cmd = "/usr/bin/ipkg "; | 59 | QString cmd = "/usr/bin/ipkg "; |
60 | #ifdef OPROCESS | 60 | #ifdef OPROCESS |
61 | ipkgProcess->clearArguments(); | 61 | ipkgProcess->clearArguments(); |
62 | *ipkgProcess << "/usr/bin/ipkg "; | 62 | *ipkgProcess << "/usr/bin/ipkg "; |
63 | QString cmd = ""; | 63 | cmd = ""; |
64 | #endif | 64 | #endif |
65 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); | 65 | pvDebug( 3,"PmIpkg::runIpkg got dest="+dest); |
66 | if ( dest == "" ) | 66 | if ( dest == "" ) |
67 | cmd += " -dest "+settings->getDestinationName(); | 67 | cmd += " -dest "+settings->getDestinationName(); |
68 | else | 68 | else |
69 | cmd += " -dest "+ dest; | 69 | cmd += " -dest "+ dest; |
70 | 70 | ||
71 | cmd += " -force-defaults "; | 71 | cmd += " -force-defaults "; |
72 | 72 | ||
73 | if (installDialog && installDialog->_force_depends) | 73 | if (installDialog && installDialog->_force_depends) |
74 | { | 74 | { |
75 | if (installDialog->_force_depends->isChecked()) | 75 | if (installDialog->_force_depends->isChecked()) |
76 | cmd += " -force-depends "; | 76 | cmd += " -force-depends "; |
77 | if (installDialog->_force_reinstall->isChecked()) | 77 | if (installDialog->_force_reinstall->isChecked()) |
78 | cmd += " -force-reinstall "; | 78 | cmd += " -force-reinstall "; |
79 | if (installDialog->_force_remove->isChecked()) | 79 | if (installDialog->_force_remove->isChecked()) |
80 | cmd += " -force-removal-of-essential-packages "; | 80 | cmd += " -force-removal-of-essential-packages "; |
81 | } | 81 | } |
82 | 82 | ||
83 | out( "Starting to "+ args+"\n"); | 83 | out( "Starting to "+ args+"\n"); |
84 | cmd += args; | 84 | cmd += args; |
85 | out( "running:\n"+cmd+"\n" ); | 85 | out( "running:\n"+cmd+"\n" ); |
86 | pvDebug(2,"running:"+cmd); | 86 | pvDebug(2,"running:"+cmd); |
87 | #ifdef OPROCESS | 87 | #ifdef OPROCESS |
@@ -132,49 +132,50 @@ bool PmIpkg::runIpkg(const QString& args, const QString& dest ) | |||
132 | ret = false; | 132 | ret = false; |
133 | } else { | 133 | } else { |
134 | while ( fgets( line, sizeof line, fp) != NULL) | 134 | while ( fgets( line, sizeof line, fp) != NULL) |
135 | { | 135 | { |
136 | lineStr = line; | 136 | lineStr = line; |
137 | lineStr=lineStr.left(lineStr.length()-1); | 137 | lineStr=lineStr.left(lineStr.length()-1); |
138 | //Configuring opie-oipkg...Done | 138 | //Configuring opie-oipkg...Done |
139 | if (lineStr.contains("Done")) ret = true; | 139 | if (lineStr.contains("Done")) ret = true; |
140 | if (lineStr!=lineStrOld) | 140 | if (lineStr!=lineStrOld) |
141 | out(lineStr); | 141 | out(lineStr); |
142 | lineStrOld = lineStr; | 142 | lineStrOld = lineStr; |
143 | qApp->processEvents(); | 143 | qApp->processEvents(); |
144 | } | 144 | } |
145 | } | 145 | } |
146 | pclose(fp); | 146 | pclose(fp); |
147 | #endif | 147 | #endif |
148 | //out( "Finished!"); | 148 | //out( "Finished!"); |
149 | pvDebug(2,QString(ret?"success\n":"failure\n")); | 149 | pvDebug(2,QString(ret?"success\n":"failure\n")); |
150 | return ret; | 150 | return ret; |
151 | } | 151 | } |
152 | 152 | ||
153 | void PmIpkg::makeLinks(Package *pack) | 153 | void PmIpkg::makeLinks(Package *pack) |
154 | { | 154 | { |
155 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); | 155 | pvDebug( 2, "PmIpkg::makeLinks "+ pack->name()); |
156 | linkPackage( pack->name(), pack->dest() ); | 156 | QString pn = pack->name(); |
157 | linkPackage( pack->packageName(), pack->dest() ); | ||
157 | } | 158 | } |
158 | 159 | ||
159 | QStringList* PmIpkg::getList( QString packFileName, QString d ) | 160 | QStringList* PmIpkg::getList( QString packFileName, QString d ) |
160 | { | 161 | { |
161 | QString dest = settings->getDestinationUrlByName( d ); | 162 | QString dest = settings->getDestinationUrlByName( d ); |
162 | dest = dest==""?d:dest; | 163 | dest = dest==""?d:dest; |
163 | if (dest == "/" ) return 0; | 164 | if (dest == "/" ) return 0; |
164 | { | 165 | { |
165 | Config cfg( "oipkg", Config::User ); | 166 | Config cfg( "oipkg", Config::User ); |
166 | cfg.setGroup( "Common" ); | 167 | cfg.setGroup( "Common" ); |
167 | QString statusDir = cfg.readEntry( "statusDir", "" ); | 168 | QString statusDir = cfg.readEntry( "statusDir", "" ); |
168 | } | 169 | } |
169 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; | 170 | packFileName = dest+"/"+statusDir+"/info/"+packFileName+".list"; |
170 | QFile f( packFileName ); | 171 | QFile f( packFileName ); |
171 | if ( ! f.open(IO_ReadOnly) ) | 172 | if ( ! f.open(IO_ReadOnly) ) |
172 | { | 173 | { |
173 | pvDebug(1," Panik! Could not open"); | 174 | pvDebug(1," Panik! Could not open"); |
174 | out( "Panik!\n Could not open:\n"+packFileName ); | 175 | out( "Panik!\n Could not open:\n"+packFileName ); |
175 | return (QStringList*)0; | 176 | return (QStringList*)0; |
176 | } | 177 | } |
177 | QStringList *fileList = new QStringList(); | 178 | QStringList *fileList = new QStringList(); |
178 | QTextStream t( &f ); | 179 | QTextStream t( &f ); |
179 | while ( !t.eof() ) | 180 | while ( !t.eof() ) |
180 | { | 181 | { |