From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99604 invoked by alias); 27 Oct 2017 18:47:45 -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 99329 invoked by uid 89); 27 Oct 2017 18:47:44 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=basepath, collins, Collins, sk:robertc X-HELO: limerock02.mail.cornell.edu Received: from limerock02.mail.cornell.edu (HELO limerock02.mail.cornell.edu) (128.84.13.242) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 27 Oct 2017 18:47:42 +0000 X-CornellRouted: This message has been Routed already. Received: from authusersmtp.mail.cornell.edu (granite4.serverfarm.cornell.edu [10.16.197.9]) by limerock02.mail.cornell.edu (8.14.4/8.14.4_cu) with ESMTP id v9RIldLk025669; Fri, 27 Oct 2017 14:47:40 -0400 Received: from localhost.localdomain (65-112-130-194.dia.static.qwest.net [65.112.130.194]) (authenticated bits=0) by authusersmtp.mail.cornell.edu (8.14.4/8.12.10) with ESMTP id v9RIlUG5024450 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Oct 2017 14:47:39 -0400 From: Ken Brown To: cygwin-apps@cygwin.com Subject: [[PATCH setup] 3/3] Remove the ScanFindVisitor class Date: Fri, 27 Oct 2017 18:47:00 -0000 Message-Id: <20171027184723.9324-4-kbrown@cornell.edu> In-Reply-To: <20171027184723.9324-1-kbrown@cornell.edu> References: <20171027184723.9324-1-kbrown@cornell.edu> X-PMX-Cornell-Gauge: Gauge=X X-PMX-CORNELL-AUTH-RESULTS: dkim-out=none; X-IsSubscribed: yes X-SW-Source: 2017-10/txt/msg00149.txt.bz2 This class was used for local installs in which the repository contains no setup.ini file. It didn't correctly handle filenames with colons, and it could become a maintenance burden to continue to support it. There are now good instructions at https://cygwin.com/package-server.html#overlay for creating a valid repository, so we just remove the class instead of fixing it. --- IniDBBuilderPackage.h | 6 ------ Makefile.am | 2 -- ScanFindVisitor.cc | 57 --------------------------------------------------- ScanFindVisitor.h | 36 -------------------------------- fromcwd.cc | 8 +------- 5 files changed, 1 insertion(+), 108 deletions(-) delete mode 100644 ScanFindVisitor.cc delete mode 100644 ScanFindVisitor.h diff --git a/IniDBBuilderPackage.h b/IniDBBuilderPackage.h index 766a5ef..323b186 100644 --- a/IniDBBuilderPackage.h +++ b/IniDBBuilderPackage.h @@ -42,12 +42,6 @@ public: void buildPackageSource (const std::string&, const std::string&, char *, hashType); - // helpers for ScanFindVisitor - void buildPackageInstall (const std::string& path, const std::string& size) - { buildPackageInstall(path, size, NULL, hashType::none); } - void buildPackageSource (const std::string& path, const std::string& size) - { buildPackageSource(path, size, NULL, hashType::none); } - void buildPackageTrust (int); void buildPackageCategory (const std::string& ); diff --git a/Makefile.am b/Makefile.am index d4c8472..7d1f072 100644 --- a/Makefile.am +++ b/Makefile.am @@ -236,8 +236,6 @@ inilint_SOURCES = \ resource.h \ root.cc \ root.h \ - ScanFindVisitor.cc \ - ScanFindVisitor.h \ script.cc \ script.h \ setup_version.h \ diff --git a/ScanFindVisitor.cc b/ScanFindVisitor.cc deleted file mode 100644 index 14c3722..0000000 --- a/ScanFindVisitor.cc +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2002 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 - * - */ - -#include "ScanFindVisitor.h" -#include "filemanip.h" -#include "IniDBBuilderPackage.h" - -ScanFindVisitor::ScanFindVisitor(IniDBBuilderPackage &aBuilder) : _Builder (aBuilder) {} -ScanFindVisitor::~ScanFindVisitor(){} - -/* look for potential packages we can add to the in-memory package - * database - */ -void -ScanFindVisitor::visitFile(const std::string& basePath, - const WIN32_FIND_DATA *theFile) -{ - // Sanity check: Does the file look like a package ? - fileparse f; - if (!parse_filename (theFile->cFileName, f)) - return; - - // Sanity check: Zero length package files get thrown out. - if (!(theFile->nFileSizeLow || theFile->nFileSizeHigh)) - return; - - // Build a new package called f.pkg - _Builder.buildPackage (f.pkg); - - // Set the version we are bulding - _Builder.buildPackageVersion (f.ver); - - // Add the file as a installable package - if (!f.what.size()) - { - //assume binary - _Builder.buildPackageInstall (basePath + theFile->cFileName, - stringify(theFile->nFileSizeLow)); - } - else - // patch or src, assume src until someone complains - _Builder.buildPackageSource (basePath + theFile->cFileName, - stringify(theFile->nFileSizeLow)); - -} diff --git a/ScanFindVisitor.h b/ScanFindVisitor.h deleted file mode 100644 index b4c93d9..0000000 --- a/ScanFindVisitor.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2002 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_SCANFINDVISITOR_H -#define SETUP_SCANFINDVISITOR_H - -#include "FindVisitor.h" - -class IniDBBuilderPackage ; -/* Scan files and create a package db when no cached .ini exists */ -class ScanFindVisitor : public FindVisitor -{ -public: - ScanFindVisitor (IniDBBuilderPackage &aBuilder); - virtual void visitFile(const std::string& basePath, const WIN32_FIND_DATA *); - virtual ~ ScanFindVisitor (); -protected: - ScanFindVisitor (ScanFindVisitor const &); - ScanFindVisitor & operator= (ScanFindVisitor const &); -private: - IniDBBuilderPackage &_Builder; -}; - -#endif /* SETUP_SCANFINDVISITOR_H */ diff --git a/fromcwd.cc b/fromcwd.cc index 791744e..3e77ad3 100644 --- a/fromcwd.cc +++ b/fromcwd.cc @@ -30,7 +30,7 @@ #include "find.h" #include "ini.h" -#include "ScanFindVisitor.h" +#include "FindVisitor.h" #include "IniDBBuilderPackage.h" #include "IniParseFeedback.h" @@ -111,7 +111,6 @@ IniList found_ini_list; bool do_from_local_dir (HINSTANCE h, HWND owner, std::string &local_dir) { - // Assume we won't find the INI file. SetupFindVisitor found; // single mirror? Find (local_dir.c_str ()).accept (found, 1); @@ -121,10 +120,5 @@ do_from_local_dir (HINSTANCE h, HWND owner, std::string &local_dir) Find (local_dir.c_str ()).accept (found, 2); if (found) return true; - // nope, do full scan. - IniParseFeedback myFeedback; - IniDBBuilderPackage myBuilder (myFeedback); - ScanFindVisitor myVisitor (myBuilder); - Find (local_dir.c_str ()).accept (myVisitor); return false; } -- 2.14.2