summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/server.cpp13
-rw-r--r--noncore/settings/aqpkg/server.h3
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
@@ -78,7 +78,7 @@ void Server :: readStatusFile( vector<Destination> &destList )
78 } 78 }
79 79
80 packageFile = path + "usr/lib/ipkg/status"; 80 packageFile = path + "usr/lib/ipkg/status";
81 readPackageFile( 0, false, installingToRoot ); 81 readPackageFile( 0, false, installingToRoot, dit );
82 } 82 }
83 83
84 // Ensure that the root status file is read 84 // Ensure that the root status file is read
@@ -139,7 +139,7 @@ void Server :: readLocalIpks( Server *local )
139 buildLocalPackages( local ); 139 buildLocalPackages( local );
140} 140}
141 141
142void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot ) 142void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot, Destination *dest )
143{ 143{
144 ifstream in( packageFile ); 144 ifstream in( packageFile );
145 if ( !in.is_open() ) 145 if ( !in.is_open() )
@@ -168,7 +168,8 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
168 sscanf( line, "%[^:]: %[^\n]", k, v ); 168 sscanf( line, "%[^:]: %[^\n]", k, v );
169 key = k; 169 key = k;
170 value = v; 170 value = v;
171 key.stripWhiteSpace(); 171 key = key.stripWhiteSpace();
172 value = value.stripWhiteSpace();
172 if ( key == "Package" && newPackage ) 173 if ( key == "Package" && newPackage )
173 { 174 {
174 newPackage = false; 175 newPackage = false;
@@ -178,10 +179,16 @@ void Server :: readPackageFile( Server *local, bool clearAll, bool installingToR
178 { 179 {
179 packageList.push_back( Package( value ) ); 180 packageList.push_back( Package( value ) );
180 currPackage = &(packageList.back()); 181 currPackage = &(packageList.back());
182 currPackage->setInstalledTo( dest );
181 183
182 if ( installingToRoot ) 184 if ( installingToRoot )
183 currPackage->setInstalledToRoot( true ); 185 currPackage->setInstalledToRoot( true );
184 } 186 }
187 else
188 {
189 if (currPackage->getStatus().find( "deinstall" ) != -1 )
190 currPackage->setInstalledTo( dest );
191 }
185 } 192 }
186 else if ( key == "Version" ) 193 else if ( key == "Version" )
187 { 194 {
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:
37 37
38 void readStatusFile( vector<Destination> &v ); 38 void readStatusFile( vector<Destination> &v );
39 void readLocalIpks( Server *local ); 39 void readLocalIpks( Server *local );
40 void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false ); 40 void readPackageFile( Server *local = 0, bool clearAll = true, bool installedToRoot= false, Destination *dest = 0 );
41 void buildLocalPackages( Server *local ); 41 void buildLocalPackages( Server *local );
42 Package *getPackage( const char *name ); 42 Package *getPackage( const char *name );
43 Package *getPackage( QString &name ); 43 Package *getPackage( QString &name );
@@ -59,7 +59,6 @@ private:
59 QString packageFile; 59 QString packageFile;
60 bool active; 60 bool active;
61 61
62
63 vector<Package> packageList; 62 vector<Package> packageList;
64}; 63};
65 64