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/8] Remove parser rules which do nothing


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


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