From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 115303 invoked by alias); 31 May 2017 10:57:31 -0000 Mailing-List: contact cygwin-apps-help@cygwin.com; run by ezmlm Precedence: bulk Sender: cygwin-apps-owner@cygwin.com List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Mail-Followup-To: cygwin-apps@cygwin.com Received: (qmail 115233 invoked by uid 89); 31 May 2017 10:57:31 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.7 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 spammy=robert, Robert, collins, Collins X-HELO: rgout04.bt.lon5.cpcloud.co.uk Received: from rgout0404.bt.lon5.cpcloud.co.uk (HELO rgout04.bt.lon5.cpcloud.co.uk) (65.20.0.217) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 31 May 2017 10:57:27 +0000 X-OWM-Source-IP: 86.141.128.130 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2017.5.13.91815:17:8.707,ip=,rules=NO_URI_FOUND, NO_CTA_URI_FOUND, NO_MESSAGE_ID, NO_URI_HTTPS, TO_MALFORMED Received: from localhost.localdomain (86.141.128.130) by rgout04.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 58482DA21281BB10; Wed, 31 May 2017 11:57:31 +0100 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 09/14] Remove cygpackage class Date: Wed, 31 May 2017 10:57:00 -0000 Message-Id: <20170531105015.162228-10-jon.turney@dronecode.org.uk> In-Reply-To: <20170531105015.162228-1-jon.turney@dronecode.org.uk> References: <20170531105015.162228-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-05/txt/msg00170.txt.bz2 --- Makefile.am | 2 - bootstrap.sh | 2 +- cygpackage.cc | 136 -------------------------------------------------------- cygpackage.h | 82 ---------------------------------- package_db.cc | 1 - package_meta.cc | 1 - 6 files changed, 1 insertion(+), 223 deletions(-) delete mode 100644 cygpackage.cc delete mode 100644 cygpackage.h diff --git a/Makefile.am b/Makefile.am index a8bfe4b..27bb8f1 100644 --- a/Makefile.am +++ b/Makefile.am @@ -128,8 +128,6 @@ inilint_SOURCES = \ crypto.cc \ crypto.h \ cyg-pubkey.h \ - cygpackage.cc \ - cygpackage.h \ desktop.cc \ desktop.h \ dialog.cc \ diff --git a/bootstrap.sh b/bootstrap.sh index f21206d..a676268 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -21,7 +21,7 @@ bootstrap() { cd "$srcdir" # Make sure we are running in the right directory -if [ ! -f cygpackage.cc ]; then +if [ ! -f bmain.cc ]; then echo "You must run this script from the directory containing it" exit 1 fi diff --git a/cygpackage.cc b/cygpackage.cc deleted file mode 100644 index 2724249..0000000 --- a/cygpackage.cc +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2001, 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. - */ - -#include "cygpackage.h" -#include -#include -#include - -#include "io_stream.h" -#include "compress.h" - -#include "package_version.h" -#include "cygpackage.h" -#include "LogSingleton.h" - -/* this constructor creates an invalid package - further details MUST be provided */ -cygpackage::cygpackage (): -name (), -vendor (), -packagev (), -canonical (), -sdesc (), -ldesc (), -type (package_binary) -{ - /* FIXME: query the install database for the currently installed - * version details - */ -} - -packageversion -cygpackage::createInstance (const std::string& pkgname, - const package_type_t type) -{ - cygpackage *temp = new cygpackage; - temp->name = pkgname; - temp->type = type; - return packageversion(temp); -} - -packageversion -cygpackage::createInstance (const std::string& pkgname, - const std::string& version, - package_type_t const newtype) -{ - cygpackage *temp = new cygpackage; - temp->name = pkgname; - temp->type = newtype; - temp->setCanonicalVersion (version); - return packageversion(temp); -} - -/* tell the version */ -void -cygpackage::setCanonicalVersion (const std::string& version) -{ - canonical = version; - - const char *start = canonical.c_str(); - const char *curr = strchr(start, '-'); - - if (curr) - { - const char *next; - while ((next = strchr (curr + 1, '-'))) - curr = next; - - /* package version appears after the last '-' in the version string */ - packagev = curr + 1; - /* vendor version is everything up to that last '-' */ - vendor.assign(canonical.c_str(), (size_t)(curr - start)); - } - else - { - // FIXME: What's up with the "0"? It's probably a mistake, and should be - // "". It used to be written as 0, and was subject to a bizarre implicit - // conversion by the unwise String(int) constructor. - packagev = "0"; - vendor = version; - } -} - -cygpackage::~cygpackage () -{ -} - -const std::string -cygpackage::Name () -{ - return name; -} - -const std::string -cygpackage::Vendor_version () -{ - return vendor; -} - -const std::string -cygpackage::Package_version () -{ - return packagev; -} - -std::string const -cygpackage::Canonical_version () -{ - return canonical; -} - -void -cygpackage::set_sdesc (const std::string& desc) -{ - sdesc = desc; -} - -void -cygpackage::set_ldesc (const std::string& desc) -{ - ldesc = desc; -} diff --git a/cygpackage.h b/cygpackage.h deleted file mode 100644 index 720921d..0000000 --- a/cygpackage.h +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2001, 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 - * - */ - -#ifndef SETUP_CYGPACKAGE_H -#define SETUP_CYGPACKAGE_H - -/* This is a cygwin specific package class, that should be able to - * arbitrate acceess to cygwin binary packages amd cygwin source packages - */ - -#include "package_version.h" - -class io_stream; - -class cygpackage:public _packageversion -{ -public: - virtual const std::string Name (); - virtual const std::string Vendor_version (); - virtual const std::string Package_version (); - virtual const std::string Canonical_version (); - virtual package_stability_t Stability () - { - return stability; - } - virtual void SetStability (package_stability_t newstability) - { - stability = newstability; - } - virtual package_type_t Type () - { - return type; - }; - virtual void set_sdesc (const std::string& ); - virtual void set_ldesc (const std::string& ); - virtual const std::string SDesc () - { - return sdesc; - }; - virtual const std::string LDesc () - { - return ldesc; - }; - - /* pass the name of the package when constructing */ - void setCanonicalVersion (const std::string& ); - - virtual ~ cygpackage (); - - /* pass the name of the package when constructing */ - static packageversion createInstance (const std::string& pkgname, - const package_type_t type); - - static packageversion createInstance (const std::string& pkgname, - const std::string& version, - package_type_t const); - -private: - cygpackage (); - std::string name; - std::string vendor; - std::string packagev; - std::string canonical; - std::string sdesc, ldesc; - - package_stability_t stability; - package_type_t type; -}; - -#endif /* SETUP_CYGPACKAGE_H */ diff --git a/package_db.cc b/package_db.cc index c561089..2d6d22c 100644 --- a/package_db.cc +++ b/package_db.cc @@ -33,7 +33,6 @@ #include "filemanip.h" #include "package_version.h" -#include "cygpackage.h" #include "package_db.h" #include "package_meta.h" #include "Exception.h" diff --git a/package_meta.cc b/package_meta.cc index c19eddf..3d1d666 100644 --- a/package_meta.cc +++ b/package_meta.cc @@ -39,7 +39,6 @@ using namespace std; #include "script.h" #include "package_version.h" -#include "cygpackage.h" #include "package_db.h" #include -- 2.12.3