From e729a9bdd9f37f4bd610d10122f002a0540c93ed Mon Sep 17 00:00:00 2001 From: tille Date: Wed, 01 May 2002 14:00:09 +0000 Subject: added ipkgfind remote query --- (limited to 'noncore/unsupported/oipkg/packagelist.cpp') diff --git a/noncore/unsupported/oipkg/packagelist.cpp b/noncore/unsupported/oipkg/packagelist.cpp index 035ec81..b892b30 100644 --- a/noncore/unsupported/oipkg/packagelist.cpp +++ b/noncore/unsupported/oipkg/packagelist.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include "debug.h" @@ -12,19 +11,6 @@ PackageList::PackageList() : packageIter( packageList ) { empty=true; - { - Config cfg( "oipkg", Config::User ); - cfg.setGroup( "Common" ); - statusDir = cfg.readEntry( "statusDir", "" ); - listsDir = cfg.readEntry( "listsDir", "" ); - if ( statusDir=="" || ! QFileInfo(statusDir+"/status").isFile() ) - { - statusDir="/usr/lib/ipkg/"; - listsDir="/usr/lib/ipkg/lists/"; - cfg.writeEntry( "statusDir", statusDir ); - cfg.writeEntry( "listsDir", listsDir ); - } - } sections << "All"; subSections.insert("All", new QStringList() ); QStringList *ss = subSections["All"]; @@ -145,71 +131,36 @@ void PackageList::updateSections( Package* pack ) } - -/** No descriptions */ -void PackageList::parseStatus() -{ - QStringList dests = settings->getDestinationUrls(); - QStringList destnames = settings->getDestinationNames(); - QStringList::Iterator name = destnames.begin(); - for ( QStringList::Iterator dir = dests.begin(); dir != dests.end(); ++dir ) - { - pvDebug( 2,"Status: "+*dir+statusDir+"/status"); - readFileEntries( *dir+statusDir+"/status", *name ); - ++name; - }; -} - -void PackageList::parseList() -{ - QStringList srvs = settings->getActiveServers(); - - for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) - { - pvDebug( 2, "List: "+listsDir+"/"+*it); - readFileEntries( listsDir+"/"+*it, "" ); - } -} - void PackageList::readFileEntries( QString filename, QString dest ) { + pvDebug(5,"PackageList::readFileEntries "+filename+" dest "+dest); QStringList packEntry; QFile f( filename ); if ( !f.open(IO_ReadOnly) ) return; QTextStream *statusStream = new QTextStream( &f ); while ( !statusStream ->eof() ) - { - QString line = statusStream->readLine(); - if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) - { - //end of package - if ( ! packEntry.isEmpty() ) - { - Package *p = new Package( packEntry, settings ); - p->setDest( dest ); - if ( p ) - { - insertPackage( p ); - packEntry.clear(); - } - } - }else{ - packEntry << line; - }; + { + QString line = statusStream->readLine(); + if ( line.find(QRegExp("[\n\t ]*")) || line == "" ) + { + //end of package + if ( ! packEntry.isEmpty() ) + { + Package *p = new Package( packEntry, settings ); + p->setDest( dest ); + if ( p ) + { + insertPackage( p ); + packEntry.clear(); + } + } + }else{ + packEntry << line; + }; } return; } - -void PackageList::update() -{ - pvDebug( 2, "parseStatus"); - parseStatus(); - pvDebug( 2, "parseList"); - parseList(); - pvDebug( 2, "finished parsing"); -} - void PackageList::setSettings( PackageManagerSettings *s ) { settings = s; -- cgit v0.9.0.2