public inbox for cygwin-apps@cygwin.com
 help / color / mirror / Atom feed
From: Jon Turney <jon.turney@dronecode.org.uk>
To: cygwin-apps@cygwin.com
Cc: Jon Turney <jon.turney@dronecode.org.uk>
Subject: [PATCH setup 3/8] Remove parser rules which do nothing
Date: Sun, 22 Jan 2017 14:17:00 -0000	[thread overview]
Message-ID: <20170122141623.226172-4-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <20170122141623.226172-1-jon.turney@dronecode.org.uk>

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 <jon.turney@dronecode.org.uk>
---
 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; }
 <descriptionstate>\n	{ return NL; }
 <descriptionstate>"\n"+	{BEGIN(INITIAL); return PARAGRAPH;}
-<eolstate>[^\n]+	{return STRING; }
-<eolstate>\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

  parent reply	other threads:[~2017-01-22 14:17 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
2017-01-22 14:16 ` [PATCH setup 1/8] Make package size and checksum mandatory in setup.ini Jon Turney
2017-01-22 14:17 ` [PATCH setup 7/8] Remove unused cvsid Jon Turney
2017-01-22 14:17 ` [PATCH setup 2/8] Remove unused lexer tokens Jon Turney
2017-01-22 14:17 ` [PATCH setup 6/8] Remove redundant parser rule Jon Turney
2017-01-22 14:17 ` Jon Turney [this message]
2017-01-22 14:17 ` [PATCH setup 5/8] Remove unused syntax for separate size and hash lines Jon Turney
2017-01-22 14:17 ` [PATCH setup 4/8] Remove parser rules which store data which is never used Jon Turney
2017-01-22 14:18 ` [PATCH setup 8/8] Remove an obsolete prototype Jon Turney
2017-01-23 10:37 ` [PATCH setup 0/8] Remove cruft from setup Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170122141623.226172-4-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-apps@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).