author | andyq <andyq> | 2002-11-23 15:27:45 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-11-23 15:27:45 (UTC) |
commit | bf0cc4c950f0a96bf7091e730744a2b3eb6cc751 (patch) (side-by-side diff) | |
tree | 97fb1d7337da8659bbcdaf0343de7d76cc4d7d1c | |
parent | 7763c095d81f44cd3012d894da6b17eb0b0cc194 (diff) | |
download | opie-bf0cc4c950f0a96bf7091e730744a2b3eb6cc751.zip opie-bf0cc4c950f0a96bf7091e730744a2b3eb6cc751.tar.gz opie-bf0cc4c950f0a96bf7091e730744a2b3eb6cc751.tar.bz2 |
*** empty log message ***
-rw-r--r-- | noncore/settings/aqpkg/server.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp index 2cb0533..fc5ed12 100644 --- a/noncore/settings/aqpkg/server.cpp +++ b/noncore/settings/aqpkg/server.cpp @@ -55,104 +55,104 @@ Server :: ~Server() } void Server :: cleanUp() { packageList.clear(); } void Server :: readStatusFile( vector<Destination> &destList ) { cleanUp(); vector<Destination>::iterator dit; bool rootRead = false; for ( dit = destList.begin() ; dit != destList.end() ; ++dit ) { bool installingToRoot = false; QString path = dit->getDestinationPath(); if ( path.right( 1 ) != "/" ) path += "/"; if ( path == "/" ) { rootRead = true; installingToRoot = true; } packageFile = path + "usr/lib/ipkg/status"; readPackageFile( 0, false, installingToRoot, &( *dit ) ); } // Ensure that the root status file is read if ( !rootRead ) { cout << "Reading status file " << "/usr/lib/ipkg/status" << endl; packageFile = "/usr/lib/ipkg/status"; readPackageFile( 0, false, true ); } } void Server :: readLocalIpks( Server *local ) { cleanUp(); #ifdef QWS // First, get any local IPKGs in the documents area // Only applicable to Qtopie/Opie - DocLnkSet files; - Global::findDocuments( &files, "application/ipkg" ); + DocLnkSet files; + Global::findDocuments( &files, "application/ipkg" ); - // Now add the items to the list - QListIterator<DocLnk> it( files.children() ); + // Now add the items to the list + QListIterator<DocLnk> it( files.children() ); - for ( ; it.current() ; ++it ) - { + for ( ; it.current() ; ++it ) + { // OK, we have a local IPK file, I think the standard naming conventions // for these are packagename_version_arm.ipk QString file = (*it)->file(); // Changed to display the filename (excluding the path) QString packageName = Utils::getFilenameFromIpkFilename( file ); QString ver = Utils::getPackageVersionFromIpkFilename( file ); packageList.push_back( Package( packageName ) ); packageList.back().setVersion( ver ); packageList.back().setFilename( file ); packageList.back().setPackageStoredLocally( true ); } #else QString names[] = { "advancedfm_0.9.1-20020811_arm.ipk", "libopie_0.9.1-20020811_arm.ipk", "libopieobex_0.9.1-20020811.1_arm.ipk", "opie-addressbook_0.9.1-20020811_arm.ipk" }; for ( int i = 0 ; i < 4 ; ++i ) { // OK, we have a local IPK file, I think the standard naming conventions // for these are packagename_version_arm.ipk QString file = names[i]; int p = file.find( "_" ); QString tmp = file.mid( 0, p ); packageList.push_back( Package( tmp ) ); int p2 = file.find( "_", p+1 ); tmp = file.mid( p+1, p2-(p+1) ); packageList.back().setVersion( tmp ); packageList.back().setPackageStoredLocally( true ); } #endif // build local packages buildLocalPackages( local ); } void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot, Destination *dest ) { ifstream in( packageFile ); if ( !in.is_open() ) return; char line[1001]; char k[21]; char v[1001]; QString key; QString value; if ( clearAll ) cleanUp(); |