/* * Copyright (c) 2001, 2003 Robert Collins. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * A copy of the GNU General Public License can be found at * http://www.gnu.org/ * * Written by Robert Collins * */ /* this is the parent class for all package operations. */ #if 0 static const char *cvsid = "\n%%% $Id$\n"; #endif #include "package_version.h" #include "package_db.h" #include "package_meta.h" #include "LogSingleton.h" #include "state.h" #include "resource.h" #include #include "download.h" #include "Exception.h" #include "csu_util/version_compare.h" using namespace std; /* a default class to avoid special casing empty packageversions */ /* TODO place into the class header */ class _defaultversion : public _packageversion { public: _defaultversion() { // never try to free me! ++references; } const std::string Name(){return std::string();} const std::string Vendor_version() {return std::string();} const std::string Package_version() {return std::string();} const std::string Canonical_version() {return std::string();} void setCanonicalVersion (const std::string& ) {} package_status_t Status (){return package_notinstalled;} package_type_t Type () {return package_binary;} const std::string getfirstfile () {return std::string();} const std::string getnextfile () {return std::string();} const std::string SDesc () {return std::string();} void set_sdesc (const std::string& ) {} const std::string LDesc () {return std::string();} void set_ldesc (const std::string& ) {} void uninstall (){} void pick(bool const &newValue){/* Ignore attempts to pick this!. Throw an exception here if you want to detect such attemtps instead */} virtual void addScript(Script const &) {} virtual std::vector