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 06/10] Fold IniDBBuilderPackage::buildInstallSize() into buildPackageInstall()


As mentioned in 5a3799dc, this ripples through into ScanFindVisitor as well.
---
 IniDBBuilderPackage.cc | 10 +++-------
 IniDBBuilderPackage.h  |  3 +--
 ScanFindVisitor.cc     |  4 ++--
 iniparse.yy            |  2 +-
 4 files changed, 7 insertions(+), 12 deletions(-)

diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc
index b5b5f4c..c90bfe3 100644
--- a/IniDBBuilderPackage.cc
+++ b/IniDBBuilderPackage.cc
@@ -119,9 +119,11 @@ IniDBBuilderPackage::buildPackageLDesc (const std::string& theDesc)
 }
 
 void
-IniDBBuilderPackage::buildPackageInstall (const std::string& path)
+IniDBBuilderPackage::buildPackageInstall (const std::string& path,
+                                          const std::string& size)
 {
   process_src (*cbpv.source(), path);
+  setSourceSize (*cbpv.source(), size);
 }
 
 void
@@ -198,12 +200,6 @@ IniDBBuilderPackage::buildBeginDepends ()
 }
 
 void
-IniDBBuilderPackage::buildInstallSize (const std::string &size)
-{
-  setSourceSize (*cbpv.source(), size);
-}
-
-void
 IniDBBuilderPackage::buildInstallSHA512 (unsigned char const *sha512)
 {
   if (sha512 && !cbpv.source()->sha512_isSet) {
diff --git a/IniDBBuilderPackage.h b/IniDBBuilderPackage.h
index 4df1bdb..1dab41b 100644
--- a/IniDBBuilderPackage.h
+++ b/IniDBBuilderPackage.h
@@ -34,13 +34,12 @@ public:
   void buildPackageVersion (const std::string& );
   void buildPackageSDesc (const std::string& );
   void buildPackageLDesc (const std::string& );
-  void buildPackageInstall (const std::string& );
+  void buildPackageInstall (const std::string&, const std::string&);
   void buildPackageSource (const std::string&, const std::string&);
   void buildPackageTrust (int);
   void buildPackageCategory (const std::string& );
 
   void buildBeginDepends ();
-  void buildInstallSize (const std::string& );
   void buildInstallSHA512 (unsigned char const[64]);
   void buildSourceSHA512 (unsigned char const[64]);
   void buildInstallMD5 (unsigned char const[16]);
diff --git a/ScanFindVisitor.cc b/ScanFindVisitor.cc
index 02cd6e8..14c3722 100644
--- a/ScanFindVisitor.cc
+++ b/ScanFindVisitor.cc
@@ -46,8 +46,8 @@ ScanFindVisitor::visitFile(const std::string& basePath,
   if (!f.what.size())
     {
       //assume binary
-      _Builder.buildPackageInstall (basePath + theFile->cFileName);
-      _Builder.buildInstallSize(stringify(theFile->nFileSizeLow));
+      _Builder.buildPackageInstall (basePath + theFile->cFileName,
+                                    stringify(theFile->nFileSizeLow));
     }
   else
     // patch or src, assume src until someone complains
diff --git a/iniparse.yy b/iniparse.yy
index 2480cc6..98b51bb 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -96,7 +96,7 @@ singleitem /* non-empty */
  | T_OTHER NL			{ iniBuilder->buildPackageTrust (TRUST_OTHER); }
  | SOURCEPACKAGE source NL
  | CATEGORY categories NL
- | INSTALL STRING STRING { iniBuilder->buildPackageInstall ($2); iniBuilder->buildInstallSize($3);} installchksum NL
+ | INSTALL STRING STRING { iniBuilder->buildPackageInstall ($2, $3);} installchksum NL
  | SOURCE STRING STRING sourcechksum NL {iniBuilder->buildPackageSource ($2, $3);}
  | DEPENDS { iniBuilder->buildBeginDepends(); } versionedpackagelist NL
  | REQUIRES { iniBuilder->buildBeginDepends(); } versionedpackagelistsp NL
-- 
2.12.3


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