author | andyq <andyq> | 2002-10-17 22:52:44 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-17 22:52:44 (UTC) |
commit | e38ea35a5bbfae58a9d4cb66cfdf557d606921cd (patch) (side-by-side diff) | |
tree | 4526e3e7a8540bbc81baa25c629bfda2f76e56bd | |
parent | b61a21e46590228b6c5800d168fc57789ce733f6 (diff) | |
download | opie-e38ea35a5bbfae58a9d4cb66cfdf557d606921cd.zip opie-e38ea35a5bbfae58a9d4cb66cfdf557d606921cd.tar.gz opie-e38ea35a5bbfae58a9d4cb66cfdf557d606921cd.tar.bz2 |
Now sets the destination a package was installed to
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 13 | ||||
-rw-r--r-- | noncore/settings/aqpkg/server.h | 3 |
2 files changed, 11 insertions, 5 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 ) diff --git a/noncore/settings/aqpkg/server.h b/noncore/settings/aqpkg/server.h index 5f83f75..e9f434c 100644 --- a/noncore/settings/aqpkg/server.h +++ b/noncore/settings/aqpkg/server.h @@ -36,9 +36,9 @@ public: void cleanUp(); void readStatusFile( vector<Destination> &v ); void readLocalIpks( Server *local ); - void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false ); + void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false, Destination *dest = 0 ); void buildLocalPackages( Server *local ); Package *getPackage( const char *name ); Package *getPackage( QString &name ); QString toString(); @@ -58,9 +58,8 @@ private: QString serverUrl; QString packageFile; bool active; - vector<Package> packageList; }; #endif |