From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129903 invoked by alias); 22 Jan 2017 14:17:04 -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 129837 invoked by uid 89); 22 Jan 2017 14:17:03 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_05,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=MESSAGE, FORMAT, PRIORITY, 1798 X-HELO: rgout03.bt.lon5.cpcloud.co.uk Received: from rgout0306.bt.lon5.cpcloud.co.uk (HELO rgout03.bt.lon5.cpcloud.co.uk) (65.20.0.212) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Jan 2017 14:16:53 +0000 X-OWM-Source-IP: 86.166.190.63 (GB) X-OWM-Env-Sender: jonturney@btinternet.com X-Junkmail-Premium-Raw: score=8/50,refid=2.7.2:2016.12.21.193617:17:8.707,ip=,rules=NO_URI_FOUND, NO_CTA_URI_FOUND, NO_MESSAGE_ID, TO_MALFORMED, NO_URI_HTTPS Received: from localhost.localdomain (86.166.190.63) by rgout03.bt.lon5.cpcloud.co.uk (9.0.019.13-1) (authenticated as jonturney@btinternet.com) id 58482CCA0400B568; Sun, 22 Jan 2017 14:16:51 +0000 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 3/8] Remove parser rules which do nothing Date: Sun, 22 Jan 2017 14:17:00 -0000 Message-Id: <20170122141623.226172-4-jon.turney@dronecode.org.uk> In-Reply-To: <20170122141623.226172-1-jon.turney@dronecode.org.uk> References: <20170122141623.226172-1-jon.turney@dronecode.org.uk> X-SW-Source: 2017-01/txt/msg00037.txt.bz2 Remove parser rules for undocumented sytax which does nothing MAINTAINER STANDARDSVERSION FORMAT DIRECTORY FILES Either the parser rules are empty, or call functions which do nothing Signed-off-by: Jon Turney --- IniDBBuilder.h | 3 --- IniDBBuilderPackage.cc | 10 ---------- IniDBBuilderPackage.h | 4 ---- inilex.ll | 8 -------- iniparse.yy | 13 ++----------- 5 files changed, 2 insertions(+), 36 deletions(-) diff --git a/IniDBBuilder.h b/IniDBBuilder.h index 0756d91..7f0a616 100644 --- a/IniDBBuilder.h +++ b/IniDBBuilder.h @@ -30,15 +30,12 @@ public: virtual void buildPackageLDesc (const std::string& ) = 0; virtual void buildPackageInstall (const std::string& ) = 0; virtual void buildPackageSource (const std::string&, const std::string&) = 0; - virtual void buildSourceFile (unsigned char const[16], - const std::string&, const std::string&) = 0; virtual void buildPackageTrust (int) = 0; virtual void buildPackageCategory (const std::string& ) = 0; virtual void buildBeginDepends () = 0; virtual void buildBeginPreDepends () = 0; virtual void buildPriority (const std::string& ) = 0; virtual void buildInstalledSize (const std::string& ) = 0; - virtual void buildMaintainer (const std::string& ) = 0; virtual void buildArchitecture (const std::string& ) = 0; virtual void buildInstallSize (const std::string& ) = 0; virtual void buildInstallSHA512 (unsigned char const[64]) = 0; diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc index 6ecc11f..d5a473b 100644 --- a/IniDBBuilderPackage.cc +++ b/IniDBBuilderPackage.cc @@ -175,13 +175,6 @@ IniDBBuilderPackage::buildPackageSource (const std::string& path, } void -IniDBBuilderPackage::buildSourceFile (unsigned char const * md5, - const std::string& size, - const std::string& path) -{ -} - -void IniDBBuilderPackage::buildPackageTrust (int newtrust) { trust = newtrust; @@ -241,9 +234,6 @@ IniDBBuilderPackage::buildInstalledSize (const std::string& size) #endif } -void -IniDBBuilderPackage::buildMaintainer (const std::string& ){} - /* TODO: we can multiple arch's for a given package, and it may befor either source or binary, so we need to either set both or track a third current package that points to whether we altering source diff --git a/IniDBBuilderPackage.h b/IniDBBuilderPackage.h index 7b9e0d6..5f65530 100644 --- a/IniDBBuilderPackage.h +++ b/IniDBBuilderPackage.h @@ -36,9 +36,6 @@ public: virtual void buildPackageLDesc (const std::string& ); virtual void buildPackageInstall (const std::string& ); virtual void buildPackageSource (const std::string&, const std::string&); - virtual void buildSourceFile (unsigned char const[16], - const std::string&, - const std::string&); virtual void buildPackageTrust (int); virtual void buildPackageCategory (const std::string& ); @@ -46,7 +43,6 @@ public: virtual void buildBeginPreDepends (); virtual void buildPriority (const std::string& ); virtual void buildInstalledSize (const std::string& ); - virtual void buildMaintainer (const std::string& ); virtual void buildArchitecture (const std::string& ); virtual void buildInstallSize (const std::string& ); virtual void buildInstallSHA512 (unsigned char const[64]); diff --git a/inilex.ll b/inilex.ll index 32a172b..f4d53b1 100644 --- a/inilex.ll +++ b/inilex.ll @@ -43,7 +43,6 @@ static void ignore_line (void); %option never-interactive %x descriptionstate -%x eolstate STR [!a-zA-Z0-9_./:\+~-]+ HEX [0-9a-f] @@ -124,16 +123,11 @@ B64 [a-zA-Z0-9_-] "MD5sum:" return MD5LINE; "SHA512:" return SHA512LINE; "Installed-Size:" return INSTALLEDSIZE; -"Maintainer:" BEGIN (eolstate); return MAINTAINER; "Architecture:" return ARCHITECTURE; "Source:" return SOURCEPACKAGE; "Binary:" return BINARYPACKAGE; "Build-Depends:" return BUILDDEPENDS; "Build-Depends-Indep:" return BUILDDEPENDS; /* technicallyincorrect :[ */ -"Standards-Version:" return STANDARDSVERSION; -"Format:" return FORMAT; -"Directory:" return DIRECTORY; -"Files:" return FILES; "category:"|"Section:" return CATEGORY; "Priority:" return PRIORITY; @@ -179,8 +173,6 @@ B64 [a-zA-Z0-9_-] return STRTOEOL; } \n { return NL; } "\n"+ {BEGIN(INITIAL); return PARAGRAPH;} -[^\n]+ {return STRING; } -\n {BEGIN(INITIAL); return NL; } \n { return NL; } . { return *yytext;} diff --git a/iniparse.yy b/iniparse.yy index 70a9dd7..f8b949f 100644 --- a/iniparse.yy +++ b/iniparse.yy @@ -41,14 +41,14 @@ void add_correct_version(); %token SETUP_TIMESTAMP SETUP_VERSION PACKAGEVERSION INSTALL SOURCE SDESC LDESC %token CATEGORY DEPENDS REQUIRES %token T_PREV T_CURR T_TEST T_OTHER -%token INSTALLEDSIZE MAINTAINER PRIORITY +%token INSTALLEDSIZE PRIORITY %token MD5 MD5LINE SHA512 SHA512LINE %token DESCTAG FILESIZE ARCHITECTURE SOURCEPACKAGE %token RECOMMENDS PREDEPENDS %token SUGGESTS CONFLICTS REPLACES PROVIDES PACKAGENAME STRTOEOL PARAGRAPH %token COMMA OR NL AT %token OPENBRACE CLOSEBRACE EQUAL GT LT GTEQUAL LTEQUAL -%token BINARYPACKAGE BUILDDEPENDS STANDARDSVERSION FORMAT DIRECTORY FILES +%token BINARYPACKAGE BUILDDEPENDS %token MESSAGE %token ARCH RELEASE @@ -100,12 +100,8 @@ singleitem /* non-empty */ | T_OTHER NL { iniBuilder->buildPackageTrust (TRUST_OTHER); } | PRIORITY STRING NL { iniBuilder->buildPriority ($2); } | INSTALLEDSIZE STRING NL { iniBuilder->buildInstalledSize ($2); } - | MAINTAINER STRING NL { iniBuilder->buildMaintainer ($2); } | ARCHITECTURE packagearchspec NL { iniBuilder->buildArchitecture ($2); } | FILESIZE STRING NL { iniBuilder->buildInstallSize($2); } - | FORMAT STRING NL { /* TODO */ } - | DIRECTORY STRING NL { /* TODO */ } - | STANDARDSVERSION STRING NL { /* TODO */ } | MD5LINE MD5 NL { iniBuilder->buildInstallMD5 ((unsigned char *)$2); } | SHA512LINE SHA512 NL { iniBuilder->buildInstallSHA512 ((unsigned char *)$2); } | SOURCEPACKAGE source NL @@ -122,7 +118,6 @@ singleitem /* non-empty */ | SUGGESTS { iniBuilder->buildBeginSuggests(); } versionedpackagelist NL | REPLACES { iniBuilder->buildBeginReplaces(); } versionedpackagelist NL | BUILDDEPENDS { iniBuilder->buildBeginBuildDepends(); } versionedpackagelist NL - | FILES NL SourceFilesList | MESSAGE STRING STRING NL { iniBuilder->buildMessage ($2, $3); } | DESCTAG mlinedesc | error { yyerror (std::string("unrecognized line ") @@ -205,8 +200,4 @@ operator /* non-empty */ | GTEQUAL { iniBuilder->buildPackageListOperator (PackageSpecification::MoreThanEquals); } ; -SourceFilesList: /* empty */ - | SourceFilesList MD5 STRING STRING { iniBuilder->buildSourceFile ((unsigned char *)$2, $3, $4); } NL - ; - %% -- 2.8.3