summaryrefslogtreecommitdiff
authordrw <drw>2003-03-28 01:36:47 (UTC)
committer drw <drw>2003-03-28 01:36:47 (UTC)
commit169a544a1cbd17a6ff3295eba6a9e403fdc299d8 (patch) (side-by-side diff)
tree3dced402e0316212fbffed6194f234ea3d65f0eb
parent9e561f9fdd2bef09d21904aba0a74faa39165c04 (diff)
downloadopie-169a544a1cbd17a6ff3295eba6a9e403fdc299d8.zip
opie-169a544a1cbd17a6ff3295eba6a9e403fdc299d8.tar.gz
opie-169a544a1cbd17a6ff3295eba6a9e403fdc299d8.tar.bz2
Oops...undoing last update.
Diffstat (more/less context) (show 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 )
Package *package = new Package( packageName );
package->setVersion( ver );
package->setFilename( file );
package->setPackageStoredLocally( true );
packageList.append( package );
}
#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();
Package *currPackage = 0;
bool newPackage = true;
do
{
in.getline( line, 1000 );
if ( in.eof() )
- break;
+ continue;
k[0] = '\0';
v[0] = '\0';
- if ( sscanf( line, "%[^:]: %[^\n]", k, v ) < 2 )
- break;
+ sscanf( line, "%[^:]: %[^\n]", k, v );
key = k;
value = v;
key = key.stripWhiteSpace();
value = value.stripWhiteSpace();
if ( key == "Package" && newPackage )
{
newPackage = false;
currPackage = getPackage( value );
if ( !currPackage )
{
Package *package = new Package( value );
packageList.append( package );
currPackage = package;
currPackage->setInstalledTo( dest );
if ( installingToRoot )
currPackage->setInstalledToRoot( true );
}
else
{
if (currPackage->getStatus().find( "deinstall" ) != -1 )
currPackage->setInstalledTo( dest );
}
}
else if ( key == "Version" )
{
if ( currPackage )
currPackage->setVersion( value );
}
else if ( key == "Status" )
{
if ( currPackage )
currPackage->setStatus( value );
}
else if ( key == "Description" )
{
if ( currPackage )
currPackage->setDescription( value );
}
else if ( key == "Filename" )
{
if ( currPackage )
currPackage->setFilename( value );
}
else if ( key == "Size" )
{
if ( currPackage )