]> cygwin.com Git - cygwin-apps/setup.git/commitdiff
Make package size and checksum mandatory in setup.ini
authorJon Turney <jon.turney@dronecode.org.uk>
Wed, 14 Dec 2016 00:00:02 +0000 (00:00 +0000)
committerJon Turney <jon.turney@dronecode.org.uk>
Sat, 21 Jan 2017 16:20:28 +0000 (16:20 +0000)
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.

iniparse.yy

index 8ae1e2d7a7fb430ae71e0ee7a25d55037519a0d9..7a0b522672c8eee19877c105b519013e76067a5c 100644 (file)
@@ -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); }
  ;
 
This page took 0.0378 seconds and 5 git commands to generate.