author | andyq <andyq> | 2002-10-16 21:24:23 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-16 21:24:23 (UTC) |
commit | 6c5cf5e778ce7cce306b5e02c1ce66a536d3a11c (patch) (side-by-side diff) | |
tree | 472f959c5e6bdda1468a405af93e6794f4eb6332 | |
parent | b44c3eeb732a115e7c49e6ca9880e674f28da43e (diff) | |
download | opie-6c5cf5e778ce7cce306b5e02c1ce66a536d3a11c.zip opie-6c5cf5e778ce7cce306b5e02c1ce66a536d3a11c.tar.gz opie-6c5cf5e778ce7cce306b5e02c1ce66a536d3a11c.tar.bz2 |
Changed active server - found out you can have many (ipkg is so clever)
Now active is set in server class.
Also, currently ignores commented out servers in ipkg.conf
-rw-r--r-- | noncore/settings/aqpkg/datamgr.cpp | 45 |
1 files changed, 7 insertions, 38 deletions
diff --git a/noncore/settings/aqpkg/datamgr.cpp b/noncore/settings/aqpkg/datamgr.cpp index bb86766..7c49621 100644 --- a/noncore/settings/aqpkg/datamgr.cpp +++ b/noncore/settings/aqpkg/datamgr.cpp @@ -87,5 +87,5 @@ void DataManager :: loadServers() { lineStr = line; - if ( lineStr.startsWith( "src" ) || lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) ) + if ( lineStr.startsWith( "src" ) ) //|| lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) ) { char alias[20]; @@ -99,8 +99,11 @@ void DataManager :: loadServers() sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url ); Server s( alias, url ); + if ( lineStr.startsWith( "src" ) ) + s.setActive( true ); + else + s.setActive( false ); + serverList.push_back( s ); - if ( lineStr.startsWith( "src" ) ) - setActiveServer( alias ); } else if ( lineStr.startsWith( "dest" ) ) @@ -116,38 +119,4 @@ void DataManager :: loadServers() fclose( fp ); - // Go through the server destination list and add root, cf and card if they - // don't already exist -/* AQ - commented out as if you don't have a CF or SD card in then - * this causes IPKG to try to create directories on non existant devices - * (which of course fails), gives a nasty error message and can cause ipkg - * to seg fault. - * - vector<Destination>::iterator dit; - bool foundRoot = false; - bool foundCF = false; - bool foundCard = false; - for ( dit = destList.begin() ; dit != destList.end() ; ++dit ) - { - if ( dit->getDestinationPath() == "/" ) - foundRoot = true; - if ( dit->getDestinationPath() == "/mnt/cf" ) - foundCF = true; - if ( dit->getDestinationPath() == "/mnt/card" ) - foundCard = true; - } - - // If running on a Zaurus (arm) then if we didn't find root, CF or card - // destinations, add them as default -#ifdef QWS -#ifndef X86 - if ( !foundRoot ) - destList.push_back( Destination( "root", "/" ) ); - if ( !foundCF ) - destList.push_back( Destination( "cf", "/mnt/cf" ) ); - if ( !foundCF ) - destList.push_back( Destination( "card", "/mnt/card" ) ); -#endif -#endif -*/ vector<Server>::iterator it; for ( it = serverList.begin() ; it != serverList.end() ; ++it ) @@ -202,5 +171,5 @@ void DataManager :: writeOutIpkgConf() QString url = it->getServerUrl();; - if ( !activeServer || alias != activeServer ) + if ( !it->isServerActive() ) out << "#"; out << "src " << alias << " " << url << endl; |