Commit Graph

24 Commits

Author SHA1 Message Date
Colin Walters
8e0d85c61e Add 'VCS' key
Spec files have a lot of metadata about a project.  However one of the
most key components is the upstream version control system which was
notably lacking.

Resolve this by adding a "VCS" key.  There is no specification
for contents of this key, given that the set of version control
systems (and features thereof) are not well-defined.  However,
recommendations are:

 * git: This URL should be in a form that can be passed to "git clone",
   with the additional feature that an optional fragment identifier "#foo"
   denotes a branch or tag.
2019-11-01 16:16:23 +00:00
1b6d0ed4c2 parseBits: fix regression introduced by the latest fix 2019-04-19 05:08:33 +00:00
988b7b0106 parseBits: disallow syntax errors and unknown qualifiers
The previous attempt to fail build in case of syntax errors
and unknown dependency qualifiers made in commit
rpm-4.8.0-beta1-385-gbf2bc18ebb325f081ade65adc2fbb6858f0b8396
missed the following classes of erroneous dependencies:

Requires(,) -- erroneously treated as Requires(),
Requires(;) -- erroneously treated as Requires(),
Requires(,pre) -- erroneously treated as Requires(),
Requires(;pre) -- erroneously treated as Requires(),
Requires(pre,) -- erroneously treated as Requires(pre),
Requires(pre,,postun) -- erroneously treated as Requires(pre),
Requires(pre,,junk) -- erroneously treated as Requires(pre),
Requires(pre;postun) -- erroneously treated as Requires(pre),
Requires(pre;junk) -- erroneously treated as Requires(pre).

Found by code inspection.

Fixes: bf2bc18ebb32 ("Always fail build on unknown dependency qualifiers")

(cherry picked from rpm.org commit aafb861846db97d78964e98d603b4e6cd88ed3ae)

The two last cases listed above have already been fixed by commit
f7280d8302.
2019-04-16 18:46:34 +00:00
Ivan Zakharyaschev
6be20da468 headerNVR() replaced by the new header{NVRD,Name{,Version}}() in trivial cases
These are the cases where even the release was not needed (so, the
disttag is not needed, too), or one case where the filename is
contructed (and it doesn't include the disttag).

Now grep -Ee 'headerNVR[^D]' will show the remaining non-trivial
cases, where adapting to disttags may be needed.
2019-02-26 23:16:13 +03:00
f7280d8302 parseBits: disallow unknown qualifiers, allow abbreviated qualifiers
Before this change unknown qualifiers were silently ignored if they
happened to be the last or the only qualifier, e.g. Requires(trash) or
Requires(pre,trash) were accepted but Requires(trash,post) were not.
Now all unknown qualifiers are treated as errors.

Before this change abbreviated qualifiers like BuildRequires(pre)
were silently ignored as unknown, now unambiguously abbreviated qualifiers
are handled like non-abbreviated.
2019-01-14 20:56:55 +00:00
e612cf937e handlePreambleTag: disallow extra qualifiers with BuildPreReq
Extra qualifiers (prep, build, install, clean) used to be allowed
but useless with BuildPreReq.
2019-01-14 20:56:55 +00:00
Panu Matilainen
31d64932f7 "prereq" is not a valid qualifier to regular Requires
(cherry picked from commit cce0fb4387089db4b860a042bf0a163fd3ea7b6f)
2012-08-07 05:24:57 +00:00
Panu Matilainen
e7b0e4fa4e Oops, being a bit too strict on dependency qualifiers
Forgot how nasty hack parseBits() was... its abusing multilang
support and the multilang support passes "C" if no lang is specified,
which certainly isn't a valid qualifier. Make multilang vs tag with
optional qualifiers different types in PreambleRec, which allows
handling this more sanely.

(cherry picked from commit dbec3664232852425d9e966058cb02e6c5f6689c)
2010-03-29 06:35:25 +00:00
Panu Matilainen
94ea8d6916 Always initialize tagflags to RPMSENSE_ANY
(cherry picked from commit 1ab0222b032d510f331cefa83fb0172673f89083)
2010-03-29 05:27:35 +00:00
Panu Matilainen
6d9d4fed64 Generate preamble tag lengths at build time and make it const
(cherry picked from commit 317533ce3134d05fc9f30fb29238d3fb2ed4bc6b)
2009-06-01 11:45:44 +00:00
75893575d7 build/parsePreamble.c: backport rpmCharCheck() from rpm-4.13.0.1-release
Backport rpmCharCheck() from rpm-4.13.0.1-release, replace rasprintf()
and risalnum() with asprintf() and isalnum() respectively, check
VERSION and RELEASE tags against whitelisted characters.  The whitelist
only contains all alphanumeric symbols as well as "._+" symbols.

[ldv:
 Rewritten, all code from rpm is terrible.
 Extended to NAME and DISTTAG.]
2019-01-10 23:20:03 +00:00
Gleb Fotengauer-Malinovskiy
4ebe39ba25 Backport Disttag: syntax to spec file parser and header content.
Original commit by jbj@ (10336f1):
- add Disttag: syntax to spec file parser and header
content.
2014-06-24 19:00:52 +04:00
26545f3846 Drop deprecated RPMTAG_RHNPLATFORM support 2009-04-12 22:39:46 +00:00
Alexey Tourbin
3ad2b101d0 parsePreamble.c, parseSpec.c: allow noarch subpackages
Based on rpm5.org code.  However, I do not introduce special variables
to distinguish between toplevel package and subpackages -- we can tell
the difference simply by checking if current "pkg" and "spec->packages"
point to the same record (which is toplevel package in the linked list).
This idiom is already used in e.g. parsePreamble().
2008-06-13 01:08:51 +04:00
ed45223b24 Ignore RPMTAG_BUILDROOT completely. 2006-04-03 16:41:43 +00:00
b397ca0085 Ignore RPMTAG_BUILDROOT completely. 2006-01-11 13:53:32 +00:00
35877f4306 fixed spacing 2005-10-06 18:21:40 +00:00
c0a2a76a04 fix readLine() usage 2005-10-06 15:24:35 +00:00
a2f087de09 fixed rpmExpand() usage in fillOutMainPackage() 2005-10-05 23:42:30 +00:00
345b80cf88 disabled icon tag support 2003-07-20 12:51:57 +00:00
af0e6ef16a Support setting the BuildHost tag explicitly rather than only from what the kernel thinks the system's hostname is (Owl). 2002-06-13 11:28:05 +00:00
44b632799a sync with rpm4 branch: fixed: autoReq/autoProv, buildRoot 2002-03-25 22:57:16 +00:00
dee952c2f8 sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
82a4763c66 Initial revision 2002-03-25 20:16:26 +00:00