[PATCH setup 09/14] Remove cygpackage class
Jon Turney
jon.turney@dronecode.org.uk
Wed May 31 10:57:00 GMT 2017
---
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 <rbtcollins@hotmail.com>
- *
- */
-
-/* this is the parent class for all package operations.
- */
-
-#include "cygpackage.h"
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-
-#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 <rbtcollins@hotmail.com>
- *
- */
-
-#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 <algorithm>
--
2.12.3
More information about the Cygwin-apps
mailing list