summaryrefslogtreecommitdiff
authordrw <drw>2003-03-28 01:36:47 (UTC)
committer drw <drw>2003-03-28 01:36:47 (UTC)
commit169a544a1cbd17a6ff3295eba6a9e403fdc299d8 (patch) (unidiff)
tree3dced402e0316212fbffed6194f234ea3d65f0eb
parent9e561f9fdd2bef09d21904aba0a74faa39165c04 (diff)
downloadopie-169a544a1cbd17a6ff3295eba6a9e403fdc299d8.zip
opie-169a544a1cbd17a6ff3295eba6a9e403fdc299d8.tar.gz
opie-169a544a1cbd17a6ff3295eba6a9e403fdc299d8.tar.bz2
Oops...undoing last update.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/aqpkg/server.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/noncore/settings/aqpkg/server.cpp b/noncore/settings/aqpkg/server.cpp
index 06b0863..d4fa439 100644
--- a/noncore/settings/aqpkg/server.cpp
+++ b/noncore/settings/aqpkg/server.cpp
@@ -120,103 +120,102 @@ void Server :: readLocalIpks( Server *local )
120 Package *package = new Package( packageName ); 120 Package *package = new Package( packageName );
121 package->setVersion( ver ); 121 package->setVersion( ver );
122 package->setFilename( file ); 122 package->setFilename( file );
123 package->setPackageStoredLocally( true ); 123 package->setPackageStoredLocally( true );
124 packageList.append( package ); 124 packageList.append( package );
125 } 125 }
126#else 126#else
127 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" }; 127 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" };
128 for ( int i = 0 ; i < 4 ; ++i ) 128 for ( int i = 0 ; i < 4 ; ++i )
129 { 129 {
130 // OK, we have a local IPK file, I think the standard naming conventions 130 // OK, we have a local IPK file, I think the standard naming conventions
131 // for these are packagename_version_arm.ipk 131 // for these are packagename_version_arm.ipk
132 QString file = names[i]; 132 QString file = names[i];
133 int p = file.find( "_" ); 133 int p = file.find( "_" );
134 QString tmp = file.mid( 0, p ); 134 QString tmp = file.mid( 0, p );
135 packageList.push_back( Package( tmp ) ); 135 packageList.push_back( Package( tmp ) );
136 int p2 = file.find( "_", p+1 ); 136 int p2 = file.find( "_", p+1 );
137 tmp = file.mid( p+1, p2-(p+1) ); 137 tmp = file.mid( p+1, p2-(p+1) );
138 packageList.back().setVersion( tmp ); 138 packageList.back().setVersion( tmp );
139 packageList.back().setPackageStoredLocally( true ); 139 packageList.back().setPackageStoredLocally( true );
140 } 140 }
141#endif 141#endif
142 142
143 // build local packages 143 // build local packages
144 buildLocalPackages( local ); 144 buildLocalPackages( local );
145} 145}
146 146
147void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot, Destination *dest ) 147void Server :: readPackageFile( Server *local, bool clearAll, bool installingToRoot, Destination *dest )
148{ 148{
149 ifstream in( packageFile ); 149 ifstream in( packageFile );
150 if ( !in.is_open() ) 150 if ( !in.is_open() )
151 return; 151 return;
152 152
153 char line[1001]; 153 char line[1001];
154 char k[21]; 154 char k[21];
155 char v[1001]; 155 char v[1001];
156 QString key; 156 QString key;
157 QString value; 157 QString value;
158 158
159 if ( clearAll ) 159 if ( clearAll )
160 cleanUp(); 160 cleanUp();
161 Package *currPackage = 0; 161 Package *currPackage = 0;
162 162
163 bool newPackage = true; 163 bool newPackage = true;
164 do 164 do
165 { 165 {
166 in.getline( line, 1000 ); 166 in.getline( line, 1000 );
167 if ( in.eof() ) 167 if ( in.eof() )
168 break; 168 continue;
169 169
170 k[0] = '\0'; 170 k[0] = '\0';
171 v[0] = '\0'; 171 v[0] = '\0';
172 172
173 if ( sscanf( line, "%[^:]: %[^\n]", k, v ) < 2 ) 173 sscanf( line, "%[^:]: %[^\n]", k, v );
174 break;
175 174
176 key = k; 175 key = k;
177 value = v; 176 value = v;
178 key = key.stripWhiteSpace(); 177 key = key.stripWhiteSpace();
179 value = value.stripWhiteSpace(); 178 value = value.stripWhiteSpace();
180 if ( key == "Package" && newPackage ) 179 if ( key == "Package" && newPackage )
181 { 180 {
182 newPackage = false; 181 newPackage = false;
183 182
184 currPackage = getPackage( value ); 183 currPackage = getPackage( value );
185 if ( !currPackage ) 184 if ( !currPackage )
186 { 185 {
187 Package *package = new Package( value ); 186 Package *package = new Package( value );
188 packageList.append( package ); 187 packageList.append( package );
189 currPackage = package; 188 currPackage = package;
190 currPackage->setInstalledTo( dest ); 189 currPackage->setInstalledTo( dest );
191 if ( installingToRoot ) 190 if ( installingToRoot )
192 currPackage->setInstalledToRoot( true ); 191 currPackage->setInstalledToRoot( true );
193 } 192 }
194 else 193 else
195 { 194 {
196 if (currPackage->getStatus().find( "deinstall" ) != -1 ) 195 if (currPackage->getStatus().find( "deinstall" ) != -1 )
197 currPackage->setInstalledTo( dest ); 196 currPackage->setInstalledTo( dest );
198 } 197 }
199 } 198 }
200 else if ( key == "Version" ) 199 else if ( key == "Version" )
201 { 200 {
202 if ( currPackage ) 201 if ( currPackage )
203 currPackage->setVersion( value ); 202 currPackage->setVersion( value );
204 } 203 }
205 else if ( key == "Status" ) 204 else if ( key == "Status" )
206 { 205 {
207 if ( currPackage ) 206 if ( currPackage )
208 currPackage->setStatus( value ); 207 currPackage->setStatus( value );
209 } 208 }
210 else if ( key == "Description" ) 209 else if ( key == "Description" )
211 { 210 {
212 if ( currPackage ) 211 if ( currPackage )
213 currPackage->setDescription( value ); 212 currPackage->setDescription( value );
214 } 213 }
215 else if ( key == "Filename" ) 214 else if ( key == "Filename" )
216 { 215 {
217 if ( currPackage ) 216 if ( currPackage )
218 currPackage->setFilename( value ); 217 currPackage->setFilename( value );
219 } 218 }
220 else if ( key == "Size" ) 219 else if ( key == "Size" )
221 { 220 {
222 if ( currPackage ) 221 if ( currPackage )