Diffstat (limited to 'noncore/settings/aqpkg/server.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 0069a60..7d103a2 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp @@ -77,9 +77,9 @@ void Server :: readStatusFile( vector<Destination> &destList ) installingToRoot = true; } packageFile = path + "usr/lib/ipkg/status"; - readPackageFile( 0, false, installingToRoot ); + readPackageFile( 0, false, installingToRoot, dit ); } // Ensure that the root status file is read if ( !rootRead ) @@ -138,9 +138,9 @@ void Server :: readLocalIpks( Server *local ) // build local packages buildLocalPackages( local ); } -void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot ) +void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot, Destination *dest ) { ifstream in( packageFile ); if ( !in.is_open() ) return; @@ -167,9 +167,10 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR sscanf( line, "%[^:]: %[^\n]", k, v ); key = k; value = v; - key.stripWhiteSpace(); + key = key.stripWhiteSpace(); + value = value.stripWhiteSpace(); if ( key == "Package" && newPackage ) { newPackage = false; @@ -177,12 +178,18 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR if ( !currPackage ) { packageList.push_back( Package( value ) ); currPackage = &(packageList.back()); + currPackage->setInstalledTo( dest ); if ( installingToRoot ) currPackage->setInstalledToRoot( true ); } + else + { + if (currPackage->getStatus().find( "deinstall" ) != -1 ) + currPackage->setInstalledTo( dest ); + } } else if ( key == "Version" ) { if ( currPackage ) |