* [PATCH setup 1/8] Make package size and checksum mandatory in setup.ini
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
@ 2017-01-22 14:16 ` Jon Turney
2017-01-22 14:17 ` [PATCH setup 7/8] Remove unused cvsid Jon Turney
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:16 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
The setup.ini grammar is written such that size and checksum are optional in
install: lines, and checksum is optional in source: lines. Presumably this
had some historical use.
Change to make package size and checksum mandatory.
Future work: We keep the asymmetry between install: and source: where
buildPackageSource() sets both pathname and size, but buildPackageInstall()
only sets pathname, relying on a separate buildInstallSize() to set the size
later for the moment, as fixing that ripples through to other place.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
iniparse.yy | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/iniparse.yy b/iniparse.yy
index 8ae1e2d..7a0b522 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -112,7 +112,7 @@ singleitem /* non-empty */
| SHA512LINE SHA512 NL { iniBuilder->buildInstallSHA512 ((unsigned char *)$2); }
| SOURCEPACKAGE source NL
| CATEGORY categories NL
- | INSTALL STRING { iniBuilder->buildPackageInstall ($2); } installmeta NL
+ | INSTALL STRING STRING { iniBuilder->buildPackageInstall ($2); iniBuilder->buildInstallSize($3);} installchksum NL
| SOURCE STRING STRING sourcechksum NL {iniBuilder->buildPackageSource ($2, $3);}
| PROVIDES { iniBuilder->buildBeginProvides(); } packagelist NL
| BINARYPACKAGE { iniBuilder->buildBeginBinary (); } packagelist NL
@@ -141,17 +141,13 @@ categories: /* empty */
| categories STRING { iniBuilder->buildPackageCategory ($2); }
;
-installmeta: /* empty */
- | STRING installchksum { iniBuilder->buildInstallSize($1); }
- ;
-
-installchksum: /* empty */
- | MD5 { iniBuilder->buildInstallMD5 ((unsigned char *)$1);}
+installchksum /* non-empty */
+ : MD5 { iniBuilder->buildInstallMD5 ((unsigned char *)$1);}
| SHA512 { iniBuilder->buildInstallSHA512 ((unsigned char *)$1);}
;
-sourcechksum: /* empty */
- | MD5 { iniBuilder->buildSourceMD5 ((unsigned char *)$1); }
+sourcechksum /* non-empty */
+ : MD5 { iniBuilder->buildSourceMD5 ((unsigned char *)$1); }
| SHA512 { iniBuilder->buildSourceSHA512 ((unsigned char *)$1); }
;
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 7/8] Remove unused cvsid
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 ` Jon Turney
2017-01-22 14:17 ` [PATCH setup 6/8] Remove redundant parser rule Jon Turney
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:17 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
ConnectionSetting.cc | 5 -----
FindVisitor.cc | 5 -----
IniParseFeedback.cc | 5 -----
KeysSetting.cc | 5 -----
LogFile.cc | 5 -----
PackageSpecification.cc | 4 ----
ScanFindVisitor.cc | 5 -----
SourceSetting.cc | 5 -----
archive.cc | 5 -----
archive_tar.cc | 5 -----
archive_tar_file.cc | 4 ----
choose.cc | 5 -----
crypto.cc | 5 -----
cygpackage.cc | 5 -----
desktop.cc | 5 -----
dialog.cc | 5 -----
diskfull.cc | 5 -----
download.cc | 5 -----
filemanip.cc | 5 -----
find.cc | 5 -----
geturl.cc | 5 -----
gpg-packet.cc | 5 -----
inilintmain.cc | 5 -----
install.cc | 4 ----
io_stream.cc | 5 -----
io_stream_cygfile.cc | 5 -----
io_stream_file.cc | 5 -----
io_stream_memory.cc | 5 -----
main.cc | 5 -----
mkdir.cc | 5 -----
mklink2.cc | 5 -----
mount.cc | 4 ----
msg.cc | 5 -----
net.cc | 5 -----
netio.cc | 5 -----
nio-file.cc | 5 -----
nio-ftp.cc | 5 -----
nio-http.cc | 5 -----
nio-ie5.cc | 5 -----
package_db.cc | 4 ----
package_meta.cc | 4 ----
package_source.cc | 5 -----
package_version.cc | 5 -----
postinstall.cc | 5 -----
prereq.cc | 5 -----
root.cc | 5 -----
script.cc | 5 -----
simpsock.cc | 5 -----
site.cc | 5 -----
source.cc | 5 -----
state.cc | 5 -----
win32.cc | 5 -----
52 files changed, 254 deletions(-)
diff --git a/ConnectionSetting.cc b/ConnectionSetting.cc
index c4d8178..5baf76c 100644
--- a/ConnectionSetting.cc
+++ b/ConnectionSetting.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdlib.h>
#include "ConnectionSetting.h"
#include "UserSettings.h"
diff --git a/FindVisitor.cc b/FindVisitor.cc
index 4b56a76..99ae6fc 100644
--- a/FindVisitor.cc
+++ b/FindVisitor.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "FindVisitor.h"
#include "find.h"
diff --git a/IniParseFeedback.cc b/IniParseFeedback.cc
index b441fec..8b7ebd1 100644
--- a/IniParseFeedback.cc
+++ b/IniParseFeedback.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "IniParseFeedback.h"
IniParseFeedback::~IniParseFeedback(){}
diff --git a/KeysSetting.cc b/KeysSetting.cc
index da3b2a9..a21c3c4 100644
--- a/KeysSetting.cc
+++ b/KeysSetting.cc
@@ -21,11 +21,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdlib.h>
#include <string.h>
#include "UserSettings.h"
diff --git a/LogFile.cc b/LogFile.cc
index 69bf70b..6590023 100644
--- a/LogFile.cc
+++ b/LogFile.cc
@@ -15,11 +15,6 @@
/* Log to one or more files. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdlib.h>
#include "LogFile.h"
#include "io_stream.h"
diff --git a/PackageSpecification.cc b/PackageSpecification.cc
index c64d509..a0818b3 100644
--- a/PackageSpecification.cc
+++ b/PackageSpecification.cc
@@ -13,10 +13,6 @@
*
*/
-#if 0
-static const char *cvsid = "\n%%% $Id$\n";
-#endif
-
#include "PackageSpecification.h"
#include <iostream>
#include "package_version.h"
diff --git a/ScanFindVisitor.cc b/ScanFindVisitor.cc
index 11f0a16..50e7415 100644
--- a/ScanFindVisitor.cc
+++ b/ScanFindVisitor.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "ScanFindVisitor.h"
#include "filemanip.h"
#include "IniDBBuilder.h"
diff --git a/SourceSetting.cc b/SourceSetting.cc
index 1d42674..1e8700b 100644
--- a/SourceSetting.cc
+++ b/SourceSetting.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "SourceSetting.h"
#include "UserSettings.h"
#include "io_stream.h"
diff --git a/archive.cc b/archive.cc
index 5023f9b..e4af4f7 100644
--- a/archive.cc
+++ b/archive.cc
@@ -16,11 +16,6 @@
/* Archive IO operations
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "LogSingleton.h"
#include "io_stream.h"
diff --git a/archive_tar.cc b/archive_tar.cc
index a07756e..05c3f6e 100644
--- a/archive_tar.cc
+++ b/archive_tar.cc
@@ -15,11 +15,6 @@
/* Built-in tar functionality. See tar.h for usage. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
diff --git a/archive_tar_file.cc b/archive_tar_file.cc
index 986ecd8..87e54df 100644
--- a/archive_tar_file.cc
+++ b/archive_tar_file.cc
@@ -15,10 +15,6 @@
/* An individual stream from a tar archive. */
-#if 0
-static const char *cvsid = "\n%%% $Id$\n";
-#endif
-
#include <errno.h>
#include <algorithm>
diff --git a/choose.cc b/choose.cc
index aa1d8e9..a0dcc1b 100644
--- a/choose.cc
+++ b/choose.cc
@@ -26,11 +26,6 @@
install packages, or to install packages that aren't installed by
default. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <commctrl.h>
#include <stdio.h>
diff --git a/crypto.cc b/crypto.cc
index 6ac7a54..a606283 100644
--- a/crypto.cc
+++ b/crypto.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/cygpackage.cc b/cygpackage.cc
index 71816f9..cd4b6bd 100644
--- a/cygpackage.cc
+++ b/cygpackage.cc
@@ -16,11 +16,6 @@
/* this is the parent class for all package operations.
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "cygpackage.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/desktop.cc b/desktop.cc
index 1add57a..81278dd 100644
--- a/desktop.cc
+++ b/desktop.cc
@@ -18,11 +18,6 @@
that unlike other do_* functions, this one is called directly from
install.cc */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <shlobj.h>
#include "desktop.h"
diff --git a/dialog.cc b/dialog.cc
index 03bacf0..6e673d3 100644
--- a/dialog.cc
+++ b/dialog.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to provide common functionality for
all the dialogs in the program. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <stdio.h>
#include <stdlib.h>
diff --git a/diskfull.cc b/diskfull.cc
index 595f233..31058bb 100644
--- a/diskfull.cc
+++ b/diskfull.cc
@@ -18,11 +18,6 @@
handle disks bigger than 2G, and a new API that isn't always
available. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "filemanip.h"
#include "diskfull.h"
diff --git a/download.cc b/download.cc
index e319ed4..f9354bb 100644
--- a/download.cc
+++ b/download.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to download all the files we need to
do the installation. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "csu_util/rfc1738.h"
#include "download.h"
diff --git a/filemanip.cc b/filemanip.cc
index 8b733ce..d1d27be 100644
--- a/filemanip.cc
+++ b/filemanip.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to put all general purpose file manipulation
code in one place. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <string.h>
#include <wchar.h>
#include <stdlib.h>
diff --git a/find.cc b/find.cc
index 3998ccf..39badf1 100644
--- a/find.cc
+++ b/find.cc
@@ -17,11 +17,6 @@
/* The purpose of this file is to doa recursive find on a given
directory, calling a given function for each file found. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "filemanip.h"
#include "find.h"
diff --git a/geturl.cc b/geturl.cc
index de4e60f..17ad8e9 100644
--- a/geturl.cc
+++ b/geturl.cc
@@ -19,11 +19,6 @@
netio.cc. We add a progress dialog and some convenience functions
(like collect to string or file */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "commctrl.h"
diff --git a/gpg-packet.cc b/gpg-packet.cc
index e288b0a..bbafbc3 100644
--- a/gpg-packet.cc
+++ b/gpg-packet.cc
@@ -18,11 +18,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/inilintmain.cc b/inilintmain.cc
index 2d1b2cf..72298d6 100644
--- a/inilintmain.cc
+++ b/inilintmain.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "getopt++/GetOption.h"
#include <iostream>
#include <sstream>
diff --git a/install.cc b/install.cc
index 277737d..fb3e93f 100644
--- a/install.cc
+++ b/install.cc
@@ -20,10 +20,6 @@
handling two tasks in one thread. We also create or update all the
files in /etc/setup/\* and create the mount points. */
-#if 0
-static const char *cvsid = "\n%%% $Id$\n";
-#endif
-
#include "getopt++/BoolOption.h"
#include "csu_util/MD5Sum.h"
#include "LogFile.h"
diff --git a/io_stream.cc b/io_stream.cc
index 8a1d635..36970ca 100644
--- a/io_stream.cc
+++ b/io_stream.cc
@@ -19,11 +19,6 @@
* case.
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "LogSingleton.h"
#include "io_stream.h"
diff --git a/io_stream_cygfile.cc b/io_stream_cygfile.cc
index 84fdb31..f014e0e 100644
--- a/io_stream_cygfile.cc
+++ b/io_stream_cygfile.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "mklink2.h"
#include "filemanip.h"
diff --git a/io_stream_file.cc b/io_stream_file.cc
index 09f7ddd..cc869d7 100644
--- a/io_stream_file.cc
+++ b/io_stream_file.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "mklink2.h"
#include "filemanip.h"
diff --git a/io_stream_memory.cc b/io_stream_memory.cc
index d743e3e..cbdaf83 100644
--- a/io_stream_memory.cc
+++ b/io_stream_memory.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
diff --git a/main.cc b/main.cc
index 6332920..e1f1def 100644
--- a/main.cc
+++ b/main.cc
@@ -26,11 +26,6 @@
those don't count, although they could). Replace the IDD_S_* with
IDD_* if you create a real dialog for those steps. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <commctrl.h>
#include <shellapi.h>
diff --git a/mkdir.cc b/mkdir.cc
index 84bb176..e683a71 100644
--- a/mkdir.cc
+++ b/mkdir.cc
@@ -15,11 +15,6 @@
/* see mkdir.h */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "ntdll.h"
diff --git a/mklink2.cc b/mklink2.cc
index d4f53cf..0b73403 100644
--- a/mklink2.cc
+++ b/mklink2.cc
@@ -6,11 +6,6 @@
#include "mklink2.h"
#include "filemanip.h"
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
/* This part of the code must be in C because the C++ interface to COM
doesn't work. */
diff --git a/mount.cc b/mount.cc
index e9c39e2..f261ce0 100644
--- a/mount.cc
+++ b/mount.cc
@@ -18,10 +18,6 @@
Cygwin's mount table. If the format or location of the mount table
changes, this is the file to change to match it. */
-#if 0
-static const char *cvsid = "\n%%% $Id$\n";
-#endif
-
#include "ini.h"
#include "win32.h"
#include "filemanip.h"
diff --git a/msg.cc b/msg.cc
index b7d96bb..403e78a 100644
--- a/msg.cc
+++ b/msg.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to centralize all the message
functions. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "msg.h"
#include "LogFile.h"
diff --git a/net.cc b/net.cc
index aa734da..659cf9b 100644
--- a/net.cc
+++ b/net.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to get the network configuration
information from the user. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "net.h"
#include "LogSingleton.h"
diff --git a/netio.cc b/netio.cc
index 473000a..5ec0b9a 100644
--- a/netio.cc
+++ b/netio.cc
@@ -17,11 +17,6 @@
methods known to setup. To add a new method, create a pair of
nio-*.[ch] files and add the logic to NetIO::open here */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "netio.h"
#include "LogFile.h"
diff --git a/nio-file.cc b/nio-file.cc
index efdf40d..e69f1ff 100644
--- a/nio-file.cc
+++ b/nio-file.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to manage access to files stored on the
local disk (i.e. "downloading" setup.ini). Called from netio.cc */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <stdio.h>
#include <sys/types.h>
diff --git a/nio-ftp.cc b/nio-ftp.cc
index 171e3a2..65625d5 100644
--- a/nio-ftp.cc
+++ b/nio-ftp.cc
@@ -16,11 +16,6 @@
/* This file is responsible for implementing all direct FTP protocol
channels. It is intentionally simplistic. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "nio-ftp.h"
#include "LogSingleton.h"
diff --git a/nio-http.cc b/nio-http.cc
index 269d69d..413ee7f 100644
--- a/nio-http.cc
+++ b/nio-http.cc
@@ -16,11 +16,6 @@
/* This file is responsible for implementing all direct HTTP protocol
channels. It is intentionally simplistic. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <winsock2.h>
#include <stdio.h>
diff --git a/nio-ie5.cc b/nio-ie5.cc
index c66cf52..236c459 100644
--- a/nio-ie5.cc
+++ b/nio-ie5.cc
@@ -18,11 +18,6 @@
must already have installed and configured IE5. This module is
called from netio.cc, which is called from geturl.cc */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include "resource.h"
diff --git a/package_db.cc b/package_db.cc
index eb7ff6b..ba1a561 100644
--- a/package_db.cc
+++ b/package_db.cc
@@ -18,10 +18,6 @@
* installed ones.
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/package_meta.cc b/package_meta.cc
index 0836187..4ea9a4f 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -13,10 +13,6 @@
*
*/
-#if 0
-static const char *cvsid = "\n%%% $Id$\n";
-#endif
-
#include "package_meta.h"
#include <string>
diff --git a/package_source.cc b/package_source.cc
index e04c18c..192fe5f 100644
--- a/package_source.cc
+++ b/package_source.cc
@@ -17,11 +17,6 @@
* source as in http/ftp/disk file) operations.
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <stdlib.h>
#include <strings.h>
#include "package_source.h"
diff --git a/package_version.cc b/package_version.cc
index 5b4c6fc..8ed8ac8 100644
--- a/package_version.cc
+++ b/package_version.cc
@@ -16,11 +16,6 @@
/* this is the parent class for all package operations.
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "package_version.h"
#include "package_db.h"
#include "package_meta.h"
diff --git a/postinstall.cc b/postinstall.cc
index 1843450..2d8e73c 100644
--- a/postinstall.cc
+++ b/postinstall.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to run all the post-install scripts
in their various forms. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "dialog.h"
#include "find.h"
#include "mount.h"
diff --git a/prereq.cc b/prereq.cc
index a5083ed..0d3b93c 100644
--- a/prereq.cc
+++ b/prereq.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <commctrl.h>
#include <stdio.h>
diff --git a/root.cc b/root.cc
index 1fa562f..e339d89 100644
--- a/root.cc
+++ b/root.cc
@@ -17,11 +17,6 @@
root of the installation to be, and to ask whether the user prefers
text or binary mounts. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "root.h"
#include "LogSingleton.h"
diff --git a/script.cc b/script.cc
index 016d7ab..92c3122 100644
--- a/script.cc
+++ b/script.cc
@@ -17,11 +17,6 @@
/* The purpose of this file is to provide functions for the invocation
of install scripts. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <stdlib.h>
#include <unistd.h>
diff --git a/simpsock.cc b/simpsock.cc
index 8b82063..9d37a05 100644
--- a/simpsock.cc
+++ b/simpsock.cc
@@ -15,11 +15,6 @@
/* Simplified socket access functions */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <winsock2.h>
#include <stdio.h>
diff --git a/site.cc b/site.cc
index 1485096..1ff3a39 100644
--- a/site.cc
+++ b/site.cc
@@ -16,11 +16,6 @@
/* The purpose of this file is to get the list of mirror sites and ask
the user which mirror site they want to download from. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include <string>
#include <algorithm>
diff --git a/source.cc b/source.cc
index 90c98b5..42b565e 100644
--- a/source.cc
+++ b/source.cc
@@ -17,11 +17,6 @@
user choose the source of the install - from the net, from the
current directory, or to just download files. */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "source.h"
#include "LogSingleton.h"
diff --git a/state.cc b/state.cc
index 055b13d..8b92603 100644
--- a/state.cc
+++ b/state.cc
@@ -15,11 +15,6 @@
/* All we do here is instantiate the extern'd variables from state.h */
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "state.h"
enum attend_mode unattended_mode = attended;
diff --git a/win32.cc b/win32.cc
index 488892b..0981355 100644
--- a/win32.cc
+++ b/win32.cc
@@ -13,11 +13,6 @@
*
*/
-#if 0
-static const char *cvsid =
- "\n%%% $Id$\n";
-#endif
-
#include "win32.h"
#include <memory>
#include <malloc.h>
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 6/8] Remove redundant parser rule
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 ` Jon Turney
2017-01-22 14:17 ` [PATCH setup 2/8] Remove unused lexer tokens Jon Turney
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:17 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Remove parser rules for undocumented redundant syntax
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
inilex.ll | 1 -
1 file changed, 1 deletion(-)
diff --git a/inilex.ll b/inilex.ll
index a7c31fb..a6ae1fb 100644
--- a/inilex.ll
+++ b/inilex.ll
@@ -118,7 +118,6 @@ B64 [a-zA-Z0-9_-]
"message:" return MESSAGE;
"Source:" return SOURCEPACKAGE;
"Build-Depends:" return BUILDDEPENDS;
-"Build-Depends-Indep:" return BUILDDEPENDS; /* technicallyincorrect :[ */
"category:"|"Section:" return CATEGORY;
"requires:" return REQUIRES;
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 2/8] Remove unused lexer tokens
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
` (2 preceding siblings ...)
2017-01-22 14:17 ` [PATCH setup 6/8] Remove redundant parser rule Jon Turney
@ 2017-01-22 14:17 ` Jon Turney
2017-01-22 14:17 ` [PATCH setup 3/8] Remove parser rules which do nothing Jon Turney
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:17 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Terminals unused in grammar
APATH
PPATH
INCLUDE_SETUP
EXCLUDE_PACKAGE
DOWNLOAD_URL
DESCRIPTION
EMAIL
OPENSQUARE
CLOSESQUARE
EXCLUDE_PACKAGE and DESCRIPTION aren't even produced by any lexer rule
OPENSQUARE and CLOSESQUARE are unused since 3074ce5e, EXCLUDE_PACKAGE seems
to have done something in 2001, the rest never seem to have been used.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
inilex.ll | 12 ------------
iniparse.yy | 6 ++----
2 files changed, 2 insertions(+), 16 deletions(-)
diff --git a/inilex.ll b/inilex.ll
index 7daca34..32a172b 100644
--- a/inilex.ll
+++ b/inilex.ll
@@ -146,13 +146,6 @@ B64 [a-zA-Z0-9_-]
"Replaces:" return REPLACES;
"Provides:" return PROVIDES;
-"apath:" return APATH;
-"ppath:" return PPATH;
-
-"include-setup:" return INCLUDE_SETUP;
-
-"download-url:" return DOWNLOAD_URL;
-
^{STR}":" ignore_line ();
"[curr]" return T_CURR;
@@ -163,8 +156,6 @@ B64 [a-zA-Z0-9_-]
"(" return OPENBRACE;
")" return CLOSEBRACE;
-"[" return OPENSQUARE;
-"]" return CLOSESQUARE;
"<<" return LT;
">>" return GT;
">=" return GTEQUAL;
@@ -176,9 +167,6 @@ B64 [a-zA-Z0-9_-]
"|" return OR;
"@" return AT;
-{STR}"@"{STR} { yylval = new char [strlen(yytext) + 1];
- strcpy (yylval, yytext);
- return EMAIL; }
{STR} { yylval = new char [strlen(yytext) + 1];
strcpy (yylval, yytext);
return STRING; }
diff --git a/iniparse.yy b/iniparse.yy
index 7a0b522..70a9dd7 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -40,16 +40,14 @@ void add_correct_version();
%token STRING
%token SETUP_TIMESTAMP SETUP_VERSION PACKAGEVERSION INSTALL SOURCE SDESC LDESC
%token CATEGORY DEPENDS REQUIRES
-%token APATH PPATH INCLUDE_SETUP EXCLUDE_PACKAGE DOWNLOAD_URL
%token T_PREV T_CURR T_TEST T_OTHER
%token INSTALLEDSIZE MAINTAINER PRIORITY
%token MD5 MD5LINE SHA512 SHA512LINE
-%token DESCTAG DESCRIPTION FILESIZE ARCHITECTURE SOURCEPACKAGE
+%token DESCTAG FILESIZE ARCHITECTURE SOURCEPACKAGE
%token RECOMMENDS PREDEPENDS
%token SUGGESTS CONFLICTS REPLACES PROVIDES PACKAGENAME STRTOEOL PARAGRAPH
-%token EMAIL COMMA OR NL AT
+%token COMMA OR NL AT
%token OPENBRACE CLOSEBRACE EQUAL GT LT GTEQUAL LTEQUAL
-%token OPENSQUARE CLOSESQUARE
%token BINARYPACKAGE BUILDDEPENDS STANDARDSVERSION FORMAT DIRECTORY FILES
%token MESSAGE
%token ARCH RELEASE
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 3/8] Remove parser rules which do nothing
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
` (3 preceding siblings ...)
2017-01-22 14:17 ` [PATCH setup 2/8] Remove unused lexer tokens Jon Turney
@ 2017-01-22 14:17 ` Jon Turney
2017-01-22 14:17 ` [PATCH setup 5/8] Remove unused syntax for separate size and hash lines Jon Turney
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:17 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
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
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 5/8] Remove unused syntax for separate size and hash lines
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
` (4 preceding siblings ...)
2017-01-22 14:17 ` [PATCH setup 3/8] Remove parser rules which do nothing Jon Turney
@ 2017-01-22 14:17 ` Jon Turney
2017-01-22 14:17 ` [PATCH setup 4/8] Remove parser rules which store data which is never used Jon Turney
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:17 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Size:, MD5sum:, SHA512: are never used as the size and hash are always given
in install: or source: lines
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
inilex.ll | 3 ---
iniparse.yy | 7 ++-----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/inilex.ll b/inilex.ll
index e9100e2..a7c31fb 100644
--- a/inilex.ll
+++ b/inilex.ll
@@ -116,9 +116,6 @@ B64 [a-zA-Z0-9_-]
"sdesc:" return SDESC;
"ldesc:" return LDESC;
"message:" return MESSAGE;
-"Size:" return FILESIZE;
-"MD5sum:" return MD5LINE;
-"SHA512:" return SHA512LINE;
"Source:" return SOURCEPACKAGE;
"Build-Depends:" return BUILDDEPENDS;
"Build-Depends-Indep:" return BUILDDEPENDS; /* technicallyincorrect :[ */
diff --git a/iniparse.yy b/iniparse.yy
index a544bce..bfc234a 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -41,8 +41,8 @@ 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 MD5 MD5LINE SHA512 SHA512LINE
-%token FILESIZE SOURCEPACKAGE
+%token MD5 SHA512
+%token SOURCEPACKAGE
%token PACKAGENAME
%token COMMA OR NL AT
%token OPENBRACE CLOSEBRACE EQUAL GT LT GTEQUAL LTEQUAL
@@ -96,9 +96,6 @@ singleitem /* non-empty */
| T_CURR NL { iniBuilder->buildPackageTrust (TRUST_CURR); }
| T_TEST NL { iniBuilder->buildPackageTrust (TRUST_TEST); }
| T_OTHER NL { iniBuilder->buildPackageTrust (TRUST_OTHER); }
- | FILESIZE STRING NL { iniBuilder->buildInstallSize($2); }
- | MD5LINE MD5 NL { iniBuilder->buildInstallMD5 ((unsigned char *)$2); }
- | SHA512LINE SHA512 NL { iniBuilder->buildInstallSHA512 ((unsigned char *)$2); }
| SOURCEPACKAGE source NL
| CATEGORY categories NL
| INSTALL STRING STRING { iniBuilder->buildPackageInstall ($2); iniBuilder->buildInstallSize($3);} installchksum NL
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 4/8] Remove parser rules which store data which is never used.
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
` (5 preceding siblings ...)
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 ` 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
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:17 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
Remove parser rules for undocumented syntax which store data which is never
used.
Architecture:
Binary:
Conflicts:
Description:
Installed-Size:
Pre-Depends:
Priority:
Provides:
Recommends:
Replaces:
Suggests:
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
IniDBBuilder.h | 11 ----
IniDBBuilderPackage.cc | 135 -------------------------------------------------
IniDBBuilderPackage.h | 11 ----
inilex.ll | 18 -------
iniparse.yy | 38 ++------------
package_meta.cc | 1 -
package_meta.h | 13 +----
package_source.h | 13 +----
package_version.cc | 42 ---------------
package_version.h | 8 ++-
10 files changed, 8 insertions(+), 282 deletions(-)
diff --git a/IniDBBuilder.h b/IniDBBuilder.h
index 7f0a616..b3f5c57 100644
--- a/IniDBBuilder.h
+++ b/IniDBBuilder.h
@@ -33,23 +33,12 @@ public:
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 buildArchitecture (const std::string& ) = 0;
virtual void buildInstallSize (const std::string& ) = 0;
virtual void buildInstallSHA512 (unsigned char const[64]) = 0;
virtual void buildSourceSHA512 (unsigned char const[64]) = 0;
virtual void buildInstallMD5 (unsigned char const[16]) = 0;
virtual void buildSourceMD5 (unsigned char const[16]) = 0;
- virtual void buildBeginRecommends () = 0;
- virtual void buildBeginSuggests () = 0;
- virtual void buildBeginReplaces () = 0;
- virtual void buildBeginConflicts () = 0;
- virtual void buildBeginProvides () = 0;
virtual void buildBeginBuildDepends () = 0;
- virtual void buildBeginBinary () = 0;
- virtual void buildDescription (const std::string& ) = 0;
virtual void buildSourceName (const std::string& ) = 0;
virtual void buildSourceNameVersion (const std::string& ) = 0;
virtual void buildPackageListAndNode () = 0;
diff --git a/IniDBBuilderPackage.cc b/IniDBBuilderPackage.cc
index d5a473b..582d249 100644
--- a/IniDBBuilderPackage.cc
+++ b/IniDBBuilderPackage.cc
@@ -205,51 +205,6 @@ IniDBBuilderPackage::buildBeginDepends ()
}
void
-IniDBBuilderPackage::buildBeginPreDepends ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a predepends statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cbpv.predepends();
-}
-
-void
-IniDBBuilderPackage::buildPriority (const std::string& priority)
-{
- cp->priority = priority;
-#if DEBUG
- Log (LOG_BABBLE) << "Package " << cp->name << " is " << priority << endLog;
-#endif
-}
-
-void
-IniDBBuilderPackage::buildInstalledSize (const std::string& size)
-{
- cbpv.source()->setInstalledSize (atoi(size.c_str()));
-#if DEBUG
- Log (LOG_BABBLE) << "Installed size for " << cp->name << " is " << cbpv.source()->installedSize() << endLog;
-#endif
-}
-
-/* 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
- or binary at the moment
- */
-void
-IniDBBuilderPackage::buildArchitecture (const std::string &arch)
-{
- cp->architecture = arch;
-#if DEBUG
- Log (LOG_BABBLE) << "Package " << cp->name << " is for "
- << arch << " architectures." << endLog;
-#endif
-}
-
-void
IniDBBuilderPackage::buildInstallSize (const std::string &size)
{
setSourceSize (*cbpv.source(), size);
@@ -288,66 +243,6 @@ IniDBBuilderPackage::buildSourceMD5 (unsigned char const *md5)
}
void
-IniDBBuilderPackage::buildBeginRecommends ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a recommends statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cbpv.recommends();
-}
-
-void
-IniDBBuilderPackage::buildBeginSuggests ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a suggests statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cbpv.suggests();
-}
-
-void
-IniDBBuilderPackage::buildBeginReplaces ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a replaces statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cbpv.replaces();
-}
-
-void
-IniDBBuilderPackage::buildBeginConflicts ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a conflicts statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cbpv.conflicts();
-}
-
-void
-IniDBBuilderPackage::buildBeginProvides ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a provides statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cbpv.provides();
-}
-
-void
IniDBBuilderPackage::buildBeginBuildDepends ()
{
#if DEBUG
@@ -359,36 +254,6 @@ IniDBBuilderPackage::buildBeginBuildDepends ()
currentAndList = cspv.depends ();
}
-
-void
-IniDBBuilderPackage::buildBeginBinary ()
-{
-#if DEBUG
- Log (LOG_BABBLE) << "Beginning of a Binary statement" << endLog;
- dumpAndList (currentAndList, Log (LOG_BABBLE));
-#endif
- currentSpec = NULL;
- currentOrList = NULL; /* set by the build AndListNode */
- currentAndList = cspv.binaries ();
-}
-
-void
-IniDBBuilderPackage::buildDescription (const std::string& descline)
-{
- if (cbpv)
- {
- cbpv.set_ldesc(cbpv.LDesc() + descline + "\n");
-#if DEBUG
- Log (LOG_BABBLE) << "Description for " << cp->name << ": \"" <<
- descline << "\"." << endLog;
-#endif
- }
- else
- _feedback.warning ((std::string ("Attempt to set description for package")
- + std::string(cp->name)
- + "before creation of a version.").c_str());
-}
-
void
IniDBBuilderPackage::buildSourceName (const std::string& name)
{
diff --git a/IniDBBuilderPackage.h b/IniDBBuilderPackage.h
index 5f65530..a97c53f 100644
--- a/IniDBBuilderPackage.h
+++ b/IniDBBuilderPackage.h
@@ -40,23 +40,12 @@ public:
virtual void buildPackageCategory (const std::string& );
virtual void buildBeginDepends ();
- virtual void buildBeginPreDepends ();
- virtual void buildPriority (const std::string& );
- virtual void buildInstalledSize (const std::string& );
- virtual void buildArchitecture (const std::string& );
virtual void buildInstallSize (const std::string& );
virtual void buildInstallSHA512 (unsigned char const[64]);
virtual void buildSourceSHA512 (unsigned char const[64]);
virtual void buildInstallMD5 (unsigned char const[16]);
virtual void buildSourceMD5 (unsigned char const[16]);
- virtual void buildBeginRecommends ();
- virtual void buildBeginSuggests ();
- virtual void buildBeginReplaces ();
- virtual void buildBeginConflicts ();
- virtual void buildBeginProvides ();
virtual void buildBeginBuildDepends ();
- virtual void buildBeginBinary ();
- virtual void buildDescription (const std::string&);
virtual void buildMessage (const std::string&, const std::string&);
virtual void buildSourceName (const std::string& );
virtual void buildSourceNameVersion (const std::string& );
diff --git a/inilex.ll b/inilex.ll
index f4d53b1..e9100e2 100644
--- a/inilex.ll
+++ b/inilex.ll
@@ -42,8 +42,6 @@ static void ignore_line (void);
%option yylineno
%option never-interactive
-%x descriptionstate
-
STR [!a-zA-Z0-9_./:\+~-]+
HEX [0-9a-f]
B64 [a-zA-Z0-9_-]
@@ -118,27 +116,16 @@ B64 [a-zA-Z0-9_-]
"sdesc:" return SDESC;
"ldesc:" return LDESC;
"message:" return MESSAGE;
-"Description:" BEGIN (descriptionstate); return DESCTAG;
"Size:" return FILESIZE;
"MD5sum:" return MD5LINE;
"SHA512:" return SHA512LINE;
-"Installed-Size:" return INSTALLEDSIZE;
-"Architecture:" return ARCHITECTURE;
"Source:" return SOURCEPACKAGE;
-"Binary:" return BINARYPACKAGE;
"Build-Depends:" return BUILDDEPENDS;
"Build-Depends-Indep:" return BUILDDEPENDS; /* technicallyincorrect :[ */
"category:"|"Section:" return CATEGORY;
-"Priority:" return PRIORITY;
"requires:" return REQUIRES;
"Depends:" return DEPENDS;
-"Pre-Depends:" return PREDEPENDS;
-"Recommends:" return RECOMMENDS;
-"Suggests:" return SUGGESTS;
-"Conflicts:" return CONFLICTS;
-"Replaces:" return REPLACES;
-"Provides:" return PROVIDES;
^{STR}":" ignore_line ();
@@ -168,11 +155,6 @@ B64 [a-zA-Z0-9_-]
[ \t\r]+ /* do nothing */;
^"#".*\n /* do nothing */;
-<descriptionstate>[^\n]+ { yylval = new char [strlen(yytext) + 1];
- strcpy (yylval, yytext);
- return STRTOEOL; }
-<descriptionstate>\n { return NL; }
-<descriptionstate>"\n"+ {BEGIN(INITIAL); return PARAGRAPH;}
\n { return NL; }
. { return *yytext;}
diff --git a/iniparse.yy b/iniparse.yy
index f8b949f..a544bce 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -41,14 +41,12 @@ 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 PRIORITY
%token MD5 MD5LINE SHA512 SHA512LINE
-%token DESCTAG FILESIZE ARCHITECTURE SOURCEPACKAGE
-%token RECOMMENDS PREDEPENDS
-%token SUGGESTS CONFLICTS REPLACES PROVIDES PACKAGENAME STRTOEOL PARAGRAPH
+%token FILESIZE SOURCEPACKAGE
+%token PACKAGENAME
%token COMMA OR NL AT
%token OPENBRACE CLOSEBRACE EQUAL GT LT GTEQUAL LTEQUAL
-%token BINARYPACKAGE BUILDDEPENDS
+%token BUILDDEPENDS
%token MESSAGE
%token ARCH RELEASE
@@ -98,9 +96,6 @@ singleitem /* non-empty */
| T_CURR NL { iniBuilder->buildPackageTrust (TRUST_CURR); }
| T_TEST NL { iniBuilder->buildPackageTrust (TRUST_TEST); }
| T_OTHER NL { iniBuilder->buildPackageTrust (TRUST_OTHER); }
- | PRIORITY STRING NL { iniBuilder->buildPriority ($2); }
- | INSTALLEDSIZE STRING NL { iniBuilder->buildInstalledSize ($2); }
- | ARCHITECTURE packagearchspec NL { iniBuilder->buildArchitecture ($2); }
| FILESIZE STRING NL { iniBuilder->buildInstallSize($2); }
| MD5LINE MD5 NL { iniBuilder->buildInstallMD5 ((unsigned char *)$2); }
| SHA512LINE SHA512 NL { iniBuilder->buildInstallSHA512 ((unsigned char *)$2); }
@@ -108,28 +103,16 @@ singleitem /* non-empty */
| CATEGORY categories NL
| INSTALL STRING STRING { iniBuilder->buildPackageInstall ($2); iniBuilder->buildInstallSize($3);} installchksum NL
| SOURCE STRING STRING sourcechksum NL {iniBuilder->buildPackageSource ($2, $3);}
- | PROVIDES { iniBuilder->buildBeginProvides(); } packagelist NL
- | BINARYPACKAGE { iniBuilder->buildBeginBinary (); } packagelist NL
- | CONFLICTS { iniBuilder->buildBeginConflicts(); } versionedpackagelist NL
| DEPENDS { iniBuilder->buildBeginDepends(); } versionedpackagelist NL
| REQUIRES { iniBuilder->buildBeginDepends(); } versionedpackagelistsp NL
- | PREDEPENDS { iniBuilder->buildBeginPreDepends(); } versionedpackagelist NL
- | RECOMMENDS { iniBuilder->buildBeginRecommends(); } versionedpackagelist NL
- | SUGGESTS { iniBuilder->buildBeginSuggests(); } versionedpackagelist NL
- | REPLACES { iniBuilder->buildBeginReplaces(); } versionedpackagelist NL
| BUILDDEPENDS { iniBuilder->buildBeginBuildDepends(); } versionedpackagelist NL
| MESSAGE STRING STRING NL { iniBuilder->buildMessage ($2, $3); }
- | DESCTAG mlinedesc
| error { yyerror (std::string("unrecognized line ")
+ stringify(yylineno)
+ " (do you have the latest setup?)");
}
;
-packagearchspec: /* empty */
- | packagearchspec STRING { iniBuilder->buildArchitecture ($2); }
- ;
-
categories: /* empty */
| categories STRING { iniBuilder->buildPackageCategory ($2); }
;
@@ -152,21 +135,6 @@ versioninfo: /* empty */
| OPENBRACE STRING CLOSEBRACE { iniBuilder->buildSourceNameVersion ($2); }
;
-mlinedesc: /* empty */
- | mlinedesc STRTOEOL NL { iniBuilder->buildDescription ($2); }
- | mlinedesc STRTOEOL PARAGRAPH { iniBuilder->buildDescription ($2); }
- ;
-
-packagelist /* non-empty */
- : packagelist COMMA { iniBuilder->buildPackageListAndNode(); } packageentry
- | { iniBuilder->buildPackageListAndNode(); } packageentry
- ;
-
-packageentry /* empty not allowed */
- : STRING { iniBuilder->buildPackageListOrNode($1); }
- | packageentry OR STRING { iniBuilder->buildPackageListOrNode($3); }
- ;
-
versionedpackagelist /* non-empty */
: { iniBuilder->buildPackageListAndNode(); } versionedpackageentry
| versionedpackagelist listseparator { iniBuilder->buildPackageListAndNode(); } versionedpackageentry
diff --git a/package_meta.cc b/package_meta.cc
index 3923b13..0836187 100644
--- a/package_meta.cc
+++ b/package_meta.cc
@@ -97,7 +97,6 @@ packagemeta::packagemeta (packagemeta const &rhs) :
curr (rhs.curr),
exp (rhs.exp),
desired (rhs.desired),
- architecture (rhs.architecture), priority (rhs.priority),
visited_(rhs.visited_)
{
diff --git a/package_meta.h b/package_meta.h
index 3d6ccd2..f23073e 100644
--- a/package_meta.h
+++ b/package_meta.h
@@ -36,7 +36,7 @@ public:
packagemeta (packagemeta const &);
packagemeta (const std::string& pkgname)
: name (pkgname), key(pkgname), user_picked (false),
- architecture (), priority(), visited_(false)
+ visited_(false)
{
}
@@ -142,17 +142,6 @@ public:
/* What version does the user want ? */
packageversion desired;
- /* What platform is this for ?
- * i386 - linux i386
- * cygwin - cygwin for 32 bit MS Windows
- * All - no binary code, or a version for every platform
- */
- std::string architecture;
- /* What priority does this package have?
- * TODO: this should be linked into a list of priorities.
- */
- std::string priority;
-
packagemessage message;
/* can one or more versions be installed? */
diff --git a/package_source.h b/package_source.h
index 997ccf8..9e68bdc 100644
--- a/package_source.h
+++ b/package_source.h
@@ -58,23 +58,13 @@ public:
class packagesource
{
public:
- packagesource ():size (0), canonical (0), base (0), filename (0), cached (),
- _installedSize (0)
+ packagesource ():size (0), canonical (0), base (0), filename (0), cached ()
{
memset (sha512sum, 0, sizeof sha512sum);
sha512_isSet = false;
};
/* how big is the source file */
size_t size;
- /* how much space do we need to install this ? */
- virtual unsigned long installedSize () const
- {
- return _installedSize;
- }
- virtual void setInstalledSize (unsigned long size)
- {
- _installedSize = size;
- }
/* The canonical name - the complete path to the source file
* i.e. foo/bar/package-1.tar.bz2
*/
@@ -128,7 +118,6 @@ private:
char *base;
char *filename;
std::string cached;
- unsigned long _installedSize;
};
#endif /* SETUP_PACKAGE_SOURCE_H */
diff --git a/package_version.cc b/package_version.cc
index c7d9d24..5b4c6fc 100644
--- a/package_version.cc
+++ b/package_version.cc
@@ -247,48 +247,6 @@ packageversion::depends() const
return &data->depends;
}
-vector <vector <PackageSpecification *> *> *
-packageversion::predepends()
-{
- return &data->predepends;
-}
-
-vector <vector <PackageSpecification *> *> *
-packageversion::recommends()
-{
- return &data->recommends;
-}
-
-vector <vector <PackageSpecification *> *> *
-packageversion::suggests()
-{
- return &data->suggests;
-}
-
-vector <vector <PackageSpecification *> *> *
-packageversion::replaces()
-{
- return &data->replaces;
-}
-
-vector <vector <PackageSpecification *> *> *
-packageversion::conflicts()
-{
- return &data->conflicts;
-}
-
-vector <vector <PackageSpecification *> *> *
-packageversion::provides()
-{
- return &data->provides;
-}
-
-vector <vector <PackageSpecification *> *> *
-packageversion::binaries()
-{
- return &data->binaries;
-}
-
bool
packageversion::picked () const
{
diff --git a/package_version.h b/package_version.h
index 32700f0..edfd15a 100644
--- a/package_version.h
+++ b/package_version.h
@@ -118,9 +118,8 @@ public:
void setSourcePackageSpecification (PackageSpecification const &);
/* invariant: these never return NULL */
- std::vector <std::vector <PackageSpecification *> *> *depends(), *predepends(),
- *recommends(), *suggests(), *replaces(), *conflicts(), *provides(), *binaries();
- const std::vector <std::vector <PackageSpecification *> *> *depends() const;
+ std::vector <std::vector <PackageSpecification *> *> *depends();
+ const std::vector <std::vector <PackageSpecification *> *> *depends() const;
bool picked() const; /* true if this version is to be installed */
void pick(bool, packagemeta *); /* trigger an install/reinsall */
@@ -187,8 +186,7 @@ public:
virtual PackageSpecification & sourcePackageSpecification ();
virtual void setSourcePackageSpecification (PackageSpecification const &);
- std::vector <std::vector <PackageSpecification *> *> depends, predepends, recommends,
- suggests, replaces, conflicts, provides, binaries;
+ std::vector <std::vector <PackageSpecification *> *> depends;
virtual void pick(bool const &newValue) { picked = newValue;}
bool picked; /* non zero if this version is to be installed */
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH setup 8/8] Remove an obsolete prototype
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
` (6 preceding siblings ...)
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 ` Jon Turney
2017-01-23 10:37 ` [PATCH setup 0/8] Remove cruft from setup Corinna Vinschen
8 siblings, 0 replies; 10+ messages in thread
From: Jon Turney @ 2017-01-22 14:18 UTC (permalink / raw)
To: cygwin-apps; +Cc: Jon Turney
add_correct_version() was moved into IniDBBuilderPackage in commit 076654e7
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
---
iniparse.yy | 2 --
1 file changed, 2 deletions(-)
diff --git a/iniparse.yy b/iniparse.yy
index bfc234a..6213b70 100644
--- a/iniparse.yy
+++ b/iniparse.yy
@@ -33,8 +33,6 @@ int yylex ();
IniDBBuilder *iniBuilder;
extern int yylineno;
-
-void add_correct_version();
%}
%token STRING
--
2.8.3
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH setup 0/8] Remove cruft from setup
2017-01-22 14:16 [PATCH setup 0/8] Remove cruft from setup Jon Turney
` (7 preceding siblings ...)
2017-01-22 14:18 ` [PATCH setup 8/8] Remove an obsolete prototype Jon Turney
@ 2017-01-23 10:37 ` Corinna Vinschen
8 siblings, 0 replies; 10+ messages in thread
From: Corinna Vinschen @ 2017-01-23 10:37 UTC (permalink / raw)
To: cygwin-apps
[-- Attachment #1: Type: text/plain, Size: 833 bytes --]
On Jan 22 14:16, Jon Turney wrote:
> Mainly this is cruft in the setup.ini parser, noticed while updating [1] to
> align with source code.
>
> [1] https://sourceware.org/cygwin-apps/setup.ini.html
>
> Jon Turney (8):
> Make package size and checksum mandatory in setup.ini
> Remove unused lexer tokens
> Remove parser rules which do nothing
> Remove parser rules which store data which is never used.
> Remove unused syntax for separate size and hash lines
> Remove redundant parser rule
> Remove unused cvsid
> Remove an obsolete prototype
Are you sure we'll never need cvsid again?
Just kidding... ACK to the patchset.
Thanks,
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 10+ messages in thread