From e38ea35a5bbfae58a9d4cb66cfdf557d606921cd Mon Sep 17 00:00:00 2001 From: andyq Date: Thu, 17 Oct 2002 22:52:44 +0000 Subject: Now sets the destination a package was installed to --- (limited to 'noncore') 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 @@ -78,7 +78,7 @@ void Server :: readStatusFile( vector &destList ) } packageFile = path + "usr/lib/ipkg/status"; - readPackageFile( 0, false, installingToRoot ); + readPackageFile( 0, false, installingToRoot, dit ); } // Ensure that the root status file is read @@ -139,7 +139,7 @@ void Server :: readLocalIpks( Server *local ) 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() ) @@ -168,7 +168,8 @@ 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; @@ -178,10 +179,16 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR { 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" ) { 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 @@ -37,7 +37,7 @@ public: void readStatusFile( vector &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 ); @@ -59,7 +59,6 @@ private: QString packageFile; bool active; - vector packageList; }; -- cgit v0.9.0.2