From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 128908 invoked by alias); 22 Jan 2017 14:16:56 -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 128808 invoked by uid 89); 22 Jan 2017 14:16:55 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RCVD_IN_DNSWL_NONE autolearn=no version=3.3.2 spammy=SOURCE, D*org.uk, D*uk X-HELO: rgout03.bt.lon5.cpcloud.co.uk Received: from rgout0307.bt.lon5.cpcloud.co.uk (HELO rgout03.bt.lon5.cpcloud.co.uk) (65.20.0.213) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sun, 22 Jan 2017 14:16:45 +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 58482CCA0400B4BC; Sun, 22 Jan 2017 14:16:43 +0000 From: Jon Turney To: cygwin-apps@cygwin.com Cc: Jon Turney Subject: [PATCH setup 1/8] Make package size and checksum mandatory in setup.ini Date: Sun, 22 Jan 2017 14:16:00 -0000 Message-Id: <20170122141623.226172-2-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/msg00036.txt.bz2 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 --- 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