Diffstat (limited to 'noncore/settings/packagemanager/oipkg.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/packagemanager/oipkg.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/noncore/settings/packagemanager/oipkg.cpp b/noncore/settings/packagemanager/oipkg.cpp index f2d7e39..e7e292e 100644 --- a/noncore/settings/packagemanager/oipkg.cpp +++ b/noncore/settings/packagemanager/oipkg.cpp | |||
@@ -360,12 +360,16 @@ OPackageList *OIpkg::installedPackages( const QString &destName, const QString & | |||
360 | else | 360 | else |
361 | line = t.readLine(); | 361 | line = t.readLine(); |
362 | } | 362 | } |
363 | 363 | ||
364 | f.close(); | 364 | f.close(); |
365 | 365 | ||
366 | // Make sure to add to list last entry | ||
367 | if ( !name.isNull() && status.contains( " installed" ) ) | ||
368 | pl->append( new OPackage( name, QString::null, version, QString::null, destName ) ); | ||
369 | |||
366 | return pl; | 370 | return pl; |
367 | } | 371 | } |
368 | 372 | ||
369 | OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) | 373 | OConfItem *OIpkg::findConfItem( OConfItem::Type type, const QString &name ) |
370 | { | 374 | { |
371 | // Find configuration item in list | 375 | // Find configuration item in list |
@@ -450,13 +454,13 @@ bool OIpkg::executeCommand( OPackage::Command command, const QStringList ¶me | |||
450 | break; | 454 | break; |
451 | case OPackage::Remove : { | 455 | case OPackage::Remove : { |
452 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); | 456 | connect( this, SIGNAL(signalIpkgMessage(const QString &)), receiver, slotOutput ); |
453 | 457 | ||
454 | // Get list of destinations for unlinking of packages not installed to root | 458 | // Get list of destinations for unlinking of packages not installed to root |
455 | OConfItemList *destList = destinations(); | 459 | OConfItemList *destList = destinations(); |
456 | 460 | ||
457 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) | 461 | for ( QStringList::ConstIterator it = parameters.begin(); it != parameters.end(); ++it ) |
458 | { | 462 | { |
459 | unlinkPackage( (*it), destList ); | 463 | unlinkPackage( (*it), destList ); |
460 | ipkg_packages_remove( &m_ipkgArgs, (*it), true ); | 464 | ipkg_packages_remove( &m_ipkgArgs, (*it), true ); |
461 | } | 465 | } |
462 | 466 | ||
@@ -642,13 +646,13 @@ const QString &OIpkg::rootPath() | |||
642 | 646 | ||
643 | void OIpkg::linkPackageDir( const QString &dest ) | 647 | void OIpkg::linkPackageDir( const QString &dest ) |
644 | { | 648 | { |
645 | if ( !dest.isNull() ) | 649 | if ( !dest.isNull() ) |
646 | { | 650 | { |
647 | OConfItem *destConfItem = findConfItem( OConfItem::Destination, dest ); | 651 | OConfItem *destConfItem = findConfItem( OConfItem::Destination, dest ); |
648 | 652 | ||
649 | emit signalIpkgMessage( tr( "Linking packages installed in: %1" ).arg( dest ) ); | 653 | emit signalIpkgMessage( tr( "Linking packages installed in: %1" ).arg( dest ) ); |
650 | 654 | ||
651 | // Set package destination directory | 655 | // Set package destination directory |
652 | QString destDir = destConfItem->value(); | 656 | QString destDir = destConfItem->value(); |
653 | QString destInfoDir = destDir; | 657 | QString destInfoDir = destDir; |
654 | if ( destInfoDir.right( 1 ) != '/' ) | 658 | if ( destInfoDir.right( 1 ) != '/' ) |
@@ -686,13 +690,13 @@ void OIpkg::linkPackageDir( const QString &dest ) | |||
686 | linkDest.prepend( rootPath() ); | 690 | linkDest.prepend( rootPath() ); |
687 | 691 | ||
688 | // If file installed file is actually symbolic link, use actual file for linking | 692 | // If file installed file is actually symbolic link, use actual file for linking |
689 | QFileInfo fileInfo( linkFile ); | 693 | QFileInfo fileInfo( linkFile ); |
690 | if ( fileInfo.isSymLink() && !fileInfo.readLink().isEmpty() ) | 694 | if ( fileInfo.isSymLink() && !fileInfo.readLink().isEmpty() ) |
691 | linkFile = fileInfo.readLink(); | 695 | linkFile = fileInfo.readLink(); |
692 | 696 | ||
693 | // See if directory exists in 'root', if not, create | 697 | // See if directory exists in 'root', if not, create |
694 | fileInfo.setFile( linkDest ); | 698 | fileInfo.setFile( linkDest ); |
695 | QString linkDestDirName = fileInfo.dirPath( true ); | 699 | QString linkDestDirName = fileInfo.dirPath( true ); |
696 | QDir linkDestDir( linkDestDirName ); | 700 | QDir linkDestDir( linkDestDirName ); |
697 | if ( !linkDestDir.exists() ) | 701 | if ( !linkDestDir.exists() ) |
698 | { | 702 | { |
@@ -730,13 +734,13 @@ void OIpkg::unlinkPackage( const QString &package, OConfItemList *destList ) | |||
730 | { | 734 | { |
731 | OConfItem *dest = it.current(); | 735 | OConfItem *dest = it.current(); |
732 | QString destInfoFileName = QString( "%1/%2/%3.list" ).arg( dest->value() ) | 736 | QString destInfoFileName = QString( "%1/%2/%3.list" ).arg( dest->value() ) |
733 | .arg( IPKG_INFO_PATH ) | 737 | .arg( IPKG_INFO_PATH ) |
734 | .arg( package ); | 738 | .arg( package ); |
735 | //emit signalIpkgMessage( QString( "Looking for '%1'" ).arg ( destInfoFileName ) ); | 739 | //emit signalIpkgMessage( QString( "Looking for '%1'" ).arg ( destInfoFileName ) ); |
736 | 740 | ||
737 | // If found and destination is not 'root', remove symbolic links | 741 | // If found and destination is not 'root', remove symbolic links |
738 | if ( QFile::exists( destInfoFileName ) && dest->name() != "root" ) | 742 | if ( QFile::exists( destInfoFileName ) && dest->name() != "root" ) |
739 | { | 743 | { |
740 | QFile destInfoFile( destInfoFileName ); | 744 | QFile destInfoFile( destInfoFileName ); |
741 | if ( destInfoFile.open( IO_ReadOnly ) ) | 745 | if ( destInfoFile.open( IO_ReadOnly ) ) |
742 | { | 746 | { |