This is the mail archive of the cygwin-apps mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[[PATCH setup] 3/3] Remove the ScanFindVisitor class


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 <robertc@hotmail.com>
- *
- */
-
-#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 <robertc@hotmail.com>
- *
- */
-
-#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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]