summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/ipkg.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/noncore/settings/aqpkg/ipkg.cpp b/noncore/settings/aqpkg/ipkg.cpp
index f8513e4..6d0edad 100644
--- a/noncore/settings/aqpkg/ipkg.cpp
+++ b/noncore/settings/aqpkg/ipkg.cpp
@@ -110,12 +110,13 @@ bool Ipkg :: runIpkg( )
110 { 110 {
111 createLinks = false; 111 createLinks = false;
112 if ( flags & MAKE_LINKS ) 112 if ( flags & MAKE_LINKS )
113 { 113 {
114 emit outputText( QString( "Removing symbolic links...\n" ) ); 114 emit outputText( QString( "Removing symbolic links...\n" ) );
115 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); 115 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
116 emit outputText( QString( " " ) );
116 } 117 }
117 } 118 }
118 119
119 emit outputText( cmd ); 120 emit outputText( cmd );
120 121
121 // Execute command 122 // Execute command
@@ -137,12 +138,14 @@ bool Ipkg :: runIpkg( )
137 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir ); 138 linkPackage( Utils::getPackageNameFromIpkFilename( package ), destination, destDir );
138 139
139 // link dependant packages that were installed with this release 140 // link dependant packages that were installed with this release
140 QString *pkg; 141 QString *pkg;
141 for ( pkg = dependantPackages->first(); pkg != 0; pkg = dependantPackages->next() ) 142 for ( pkg = dependantPackages->first(); pkg != 0; pkg = dependantPackages->next() )
142 { 143 {
144 if ( *pkg == package )
145 continue;
143 emit outputText( " " ); 146 emit outputText( " " );
144 emit outputText( QString( "Creating symbolic links for " )+ (*pkg) ); 147 emit outputText( QString( "Creating symbolic links for " )+ (*pkg) );
145 linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir ); 148 linkPackage( Utils::getPackageNameFromIpkFilename( *pkg ), destination, destDir );
146 } 149 }
147 } 150 }
148 } 151 }
@@ -281,23 +284,32 @@ void Ipkg :: processFileList( const QStringList *fileList, const QString &destDi
281 } 284 }
282 } 285 }
283 else 286 else
284 { 287 {
285 for ( int i = fileList->count()-1; i >= 0 ; i-- ) 288 for ( int i = fileList->count()-1; i >= 0 ; i-- )
286 { 289 {
287 cout << "i = " << i << ", Dealing with " << (*fileList)[i] << endl;
288 processLinkDir( (*fileList)[i], baseDir, destDir ); 290 processLinkDir( (*fileList)[i], baseDir, destDir );
289 qApp->processEvents(); 291 qApp->processEvents();
290 } 292 }
291 } 293 }
292} 294}
293 295
294void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const QString &baseDir ) 296void Ipkg :: processLinkDir( const QString &file, const QString &destDir, const QString &baseDir )
295{ 297{
298
296 QString sourceFile = baseDir + file; 299 QString sourceFile = baseDir + file;
297 QString linkFile = destDir + file; 300
301 QString linkFile = destDir;
302 if ( file.startsWith( "/" ) && destDir.right( 1 ) == "/" )
303 {
304 linkFile += file.mid( 1 );
305 }
306 else
307 {
308 linkFile += file;
309 }
298 QString text; 310 QString text;
299 if ( createLinks ) 311 if ( createLinks )
300 { 312 {
301 // If this file is a directory (ends with a /) and it doesn't exist, 313 // If this file is a directory (ends with a /) and it doesn't exist,
302 // we need to create it 314 // we need to create it
303 if ( file.right(1) == "/" ) 315 if ( file.right(1) == "/" )