author | andyq <andyq> | 2002-10-16 21:24:23 (UTC) |
---|---|---|
committer | andyq <andyq> | 2002-10-16 21:24:23 (UTC) |
commit | 6c5cf5e778ce7cce306b5e02c1ce66a536d3a11c (patch) (unidiff) | |
tree | 472f959c5e6bdda1468a405af93e6794f4eb6332 /noncore/settings/aqpkg/datamgr.cpp | |
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
Diffstat (limited to 'noncore/settings/aqpkg/datamgr.cpp') (more/less context) (ignore whitespace changes)
-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() | |||
87 | { | 87 | { |
88 | lineStr = line; | 88 | lineStr = line; |
89 | if ( lineStr.startsWith( "src" ) || lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) ) | 89 | if ( lineStr.startsWith( "src" ) ) //|| lineStr.startsWith( "#src" ) || lineStr.startsWith( "# src" ) ) |
90 | { | 90 | { |
91 | char alias[20]; | 91 | char alias[20]; |
@@ -99,8 +99,11 @@ void DataManager :: loadServers() | |||
99 | sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url ); | 99 | sscanf( lineStr, "%*[^r]%*[^ ] %s %s", alias, url ); |
100 | Server s( alias, url ); | 100 | Server s( alias, url ); |
101 | if ( lineStr.startsWith( "src" ) ) | ||
102 | s.setActive( true ); | ||
103 | else | ||
104 | s.setActive( false ); | ||
105 | |||
101 | serverList.push_back( s ); | 106 | serverList.push_back( s ); |
102 | 107 | ||
103 | if ( lineStr.startsWith( "src" ) ) | ||
104 | setActiveServer( alias ); | ||
105 | } | 108 | } |
106 | else if ( lineStr.startsWith( "dest" ) ) | 109 | else if ( lineStr.startsWith( "dest" ) ) |
@@ -116,38 +119,4 @@ void DataManager :: loadServers() | |||
116 | fclose( fp ); | 119 | fclose( fp ); |
117 | 120 | ||
118 | // Go through the server destination list and add root, cf and card if they | ||
119 | // don't already exist | ||
120 | /* AQ - commented out as if you don't have a CF or SD card in then | ||
121 | * this causes IPKG to try to create directories on non existant devices | ||
122 | * (which of course fails), gives a nasty error message and can cause ipkg | ||
123 | * to seg fault. | ||
124 | * | ||
125 | vector<Destination>::iterator dit; | ||
126 | bool foundRoot = false; | ||
127 | bool foundCF = false; | ||
128 | bool foundCard = false; | ||
129 | for ( dit = destList.begin() ; dit != destList.end() ; ++dit ) | ||
130 | { | ||
131 | if ( dit->getDestinationPath() == "/" ) | ||
132 | foundRoot = true; | ||
133 | if ( dit->getDestinationPath() == "/mnt/cf" ) | ||
134 | foundCF = true; | ||
135 | if ( dit->getDestinationPath() == "/mnt/card" ) | ||
136 | foundCard = true; | ||
137 | } | ||
138 | |||
139 | // If running on a Zaurus (arm) then if we didn't find root, CF or card | ||
140 | // destinations, add them as default | ||
141 | #ifdef QWS | ||
142 | #ifndef X86 | ||
143 | if ( !foundRoot ) | ||
144 | destList.push_back( Destination( "root", "/" ) ); | ||
145 | if ( !foundCF ) | ||
146 | destList.push_back( Destination( "cf", "/mnt/cf" ) ); | ||
147 | if ( !foundCF ) | ||
148 | destList.push_back( Destination( "card", "/mnt/card" ) ); | ||
149 | #endif | ||
150 | #endif | ||
151 | */ | ||
152 | vector<Server>::iterator it; | 121 | vector<Server>::iterator it; |
153 | for ( it = serverList.begin() ; it != serverList.end() ; ++it ) | 122 | for ( it = serverList.begin() ; it != serverList.end() ; ++it ) |
@@ -202,5 +171,5 @@ void DataManager :: writeOutIpkgConf() | |||
202 | QString url = it->getServerUrl();; | 171 | QString url = it->getServerUrl();; |
203 | 172 | ||
204 | if ( !activeServer || alias != activeServer ) | 173 | if ( !it->isServerActive() ) |
205 | out << "#"; | 174 | out << "#"; |
206 | out << "src " << alias << " " << url << endl; | 175 | out << "src " << alias << " " << url << endl; |