3 * Copyright (c) 2000, Red Hat, Inc.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * A copy of the GNU General Public License can be found at
13 * Written by DJ Delorie <dj@cygnus.com>
17 /* Parse the setup.ini files. inilex.l provides the tokens for this. */
26 #include "PackageTrust.h"
28 extern int yyerror (String const &s);
33 #include "IniDBBuilder.h"
35 #define YYERROR_VERBOSE 1
38 IniDBBuilder *iniBuilder;
41 void add_correct_version();
45 %token SETUP_TIMESTAMP SETUP_VERSION PACKAGEVERSION INSTALL SOURCE SDESC LDESC
46 %token CATEGORY REQUIRES
47 %token APATH PPATH INCLUDE_SETUP EXCLUDE_PACKAGE DOWNLOAD_URL
48 %token T_PREV T_CURR T_TEST T_UNKNOWN
54 : setup_headers packages
58 : setup_header setup_headers
63 : SETUP_TIMESTAMP STRING '\n' { iniBuilder->buildTimestamp ($2); }
64 | SETUP_VERSION STRING '\n' { iniBuilder->buildVersion ($2); }
66 | error { yyerror ("unrecognized line in setup.ini headers (do you have the latest setup?)"); } '\n'
75 : '@' STRING '\n' { iniBuilder->buildPackage ($2);}
80 : lines '\n' simple_line
85 : PACKAGEVERSION STRING { iniBuilder->buildPackageVersion ($2); }
86 | SDESC STRING { iniBuilder->buildPackageSDesc($2); }
87 | LDESC STRING { iniBuilder->buildPackageLDesc($2); }
90 | INSTALL STRING STRING MD5 { iniBuilder->buildPackageInstall ($2, $3, $4); }
91 | INSTALL STRING STRING { iniBuilder->buildPackageInstall ($2, $3); }
92 | SOURCE STRING STRING MD5 { iniBuilder->buildPackageSource ($2, $3, $4); }
93 | SOURCE STRING STRING { iniBuilder->buildPackageSource ($2, $3); }
94 | T_PREV { iniBuilder->buildPackageTrust (TRUST_PREV); }
95 | T_CURR { iniBuilder->buildPackageTrust (TRUST_CURR); }
96 | T_TEST { iniBuilder->buildPackageTrust (TRUST_TEST); }
97 | T_UNKNOWN { iniBuilder->buildPackageTrust (TRUST_UNKNOWN); }
99 | error '\n' { --yylineno;
100 yyerror (String("unrecognized line ") + yylineno + " (do you have the latest setup?)");
106 : STRING { iniBuilder->buildPackageRequirement($1); } requires
107 | STRING { iniBuilder->buildPackageRequirement($1); }
111 : STRING { iniBuilder->buildPackageCategory ($1); } categories
112 | STRING { iniBuilder->buildPackageCategory ($1); }