summaryrefslogtreecommitdiff
path: root/core/launcher/packageslave.cpp
Unidiff
Diffstat (limited to 'core/launcher/packageslave.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/packageslave.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/core/launcher/packageslave.cpp b/core/launcher/packageslave.cpp
index a11ac86..0461432 100644
--- a/core/launcher/packageslave.cpp
+++ b/core/launcher/packageslave.cpp
@@ -154,50 +154,49 @@ void PackageHandler::addPackageFiles( const QString &location,
154 if ( f.open(IO_ReadOnly) ) { 154 if ( f.open(IO_ReadOnly) ) {
155 QTextStream ts(&f); 155 QTextStream ts(&f);
156 156
157 QString s; 157 QString s;
158 while ( !ts.eof() ) { // until end of file... 158 while ( !ts.eof() ) { // until end of file...
159 s = ts.readLine(); // line of text excluding '\n' 159 s = ts.readLine(); // line of text excluding '\n'
160 // for s, do link/mkdir. 160 // for s, do link/mkdir.
161 if ( s.right(1) == "/" ) { 161 if ( s.right(1) == "/" ) {
162 odebug << "do mkdir for " << s.ascii() << "" << oendl; 162 odebug << "do mkdir for " << s.ascii() << "" << oendl;
163#ifndef Q_OS_WIN32 163#ifndef Q_OS_WIN32
164 mkdir( s.ascii(), 0777 ); 164 mkdir( s.ascii(), 0777 );
165 //possible optimization: symlink directories 165 //possible optimization: symlink directories
166 //that don't exist already. -- Risky. 166 //that don't exist already. -- Risky.
167#else 167#else
168 d.mkdir( s.ascii()); 168 d.mkdir( s.ascii());
169#endif 169#endif
170 170
171 } else { 171 } else {
172#ifndef Q_OS_WIN32 172#ifndef Q_OS_WIN32
173 odebug << "do symlink for " << s.ascii() << "" << oendl; 173 odebug << "do symlink for " << s.ascii() << "" << oendl;
174 symlink( (location + s).ascii(), s.ascii() ); 174 symlink( (location + s).ascii(), s.ascii() );
175#else 175#else
176 odebug << "Copy file instead of a symlink for WIN32" << oendl; 176 odebug << "Copy file instead of a symlink for WIN32" << oendl;
177 if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE)) 177 if (!CopyFile((TCHAR*)qt_winTchar((location + s), TRUE), (TCHAR*)qt_winTchar(s, TRUE), FALSE))
178 qWarning("Unable to create symlinkfor %s", 178 owarn << "Unable to create symlinkfor " << (location + s).ascii() << oendl;
179 (location + s).ascii());
180#endif 179#endif
181 } 180 }
182 } 181 }
183 f.close(); 182 f.close();
184 } 183 }
185} 184}
186 185
187void PackageHandler::addPackages( const QString &location ) 186void PackageHandler::addPackages( const QString &location )
188{ 187{
189 // get list of *.list in location/usr/lib/ipkg/info/*.list 188 // get list of *.list in location/usr/lib/ipkg/info/*.list
190 QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr 189 QDir dir(location + "/usr/lib/ipkg/info", "*.list", // No tr
191 QDir::Name, QDir::Files); 190 QDir::Name, QDir::Files);
192 if ( !dir.exists() ) 191 if ( !dir.exists() )
193 return; 192 return;
194 193
195 QStringList packages = dir.entryList(); 194 QStringList packages = dir.entryList();
196 for ( QStringList::Iterator it = packages.begin(); 195 for ( QStringList::Iterator it = packages.begin();
197 it != packages.end(); ++it ) { 196 it != packages.end(); ++it ) {
198 addPackageFiles( location, *it ); 197 addPackageFiles( location, *it );
199 } 198 }
200} 199}
201 200
202 201
203void PackageHandler::cleanupPackageFiles( const QString &listfile ) 202void PackageHandler::cleanupPackageFiles( const QString &listfile )