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/packagelistlocal.cpp') diff --git a/noncore/unsupported/oipkg/packagelistlocal.cpp b/noncore/unsupported/oipkg/packagelistlocal.cpp new file mode 100644 index 0000000..6d931c8 --- a/dev/null +++ b/noncore/unsupported/oipkg/packagelistlocal.cpp @@ -0,0 +1,66 @@ +#include +#include +#include +#include +#include +#include "packagelistlocal.h" + +PackageListLocal::PackageListLocal() + : PackageList() +{ + 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 ); + } +} + +PackageListLocal::PackageListLocal(PackageManagerSettings* s) + : PackageList(s) +{ + PackageListLocal(); +} + +PackageListLocal::~PackageListLocal() +{ +} + +void PackageListLocal::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 PackageListLocal::parseList() +{ + QStringList srvs = settings->getActiveServers(); + + for ( QStringList::Iterator it = srvs.begin(); it != srvs.end(); ++it ) + { + pvDebug( 2, "List: "+listsDir+"/"+*it); + readFileEntries( listsDir+"/"+*it ); + } +} + + +void PackageListLocal::update() +{ + pvDebug( 2, "parseStatus"); + parseStatus(); + pvDebug( 2, "parseList"); + parseList(); + pvDebug( 2, "finished parsing"); +} -- cgit v0.9.0.2