summaryrefslogtreecommitdiff
path: root/build/parsePreamble.c
AgeCommit message (Collapse)AuthorFilesLines
2014-06-11Ignore unknown tagsMarkus Lehtonen1-9/+9
Might be e.g. a macro defined only in target distro. We're only interested in a few tags i.e. name, version, release etc. Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
2013-02-02Adding manifest support for rpmbuildElena Reshetova1-0/+1
2013-02-02Add support for weak dependencies:Anas Nashif1-0/+22
A) use RPMTAG_SUGGESTS and RPMTAG_ENHANCES to store them. This is different to upstream, which uses RPMSENSE_MISSINGOK and RPMTAG_REQUIRES/RPMTAG_PROVIDES instead. I chose different tags because I wanted to be compatible. The point is that applications that don't know about the new MISSINGOK semantics will mis-interpret the provides/requires otherwise, which I deemed to risky. B) use RPMSENSE_STRONG to support a "strong" version, "Recommends" instead of "Suggests" and "Supplements" instead of "Enhances".
2012-08-07Handle all dependency tags in spec via same switch-case fallthroughPanu Matilainen1-3/+1
- Requires and OrderWithRequires take extra qualifiers, but other than that they areall handled the same through parseRCPOT()
2012-08-07"prereq" is not a valid qualifier to regular RequiresPanu Matilainen1-1/+0
2012-08-07Extra qualifiers like (postun) are not valid with legacy PreReqPanu Matilainen1-1/+1
2012-05-16Push special doc directory generation next to other special doc foobarPanu Matilainen1-28/+0
- There's no need to carry the special doc directory in the package struct, the directory is only a fleeting thing deep down in the filelist parsing. Handle local-only needs locally. - No behavior/semantic changes intended or expected.
2012-04-23Add support for dpkg-style sorting of tilde in version/releaseMichael Schroeder1-1/+1
- This allows much nicer handling some common scenarios such as upstream pre-releases where the pre-release version would normally appear newer than final release, eg 1.0-rc1 vs 1.0. Previously this required mapping the pre-release tag into the release tag to achieve desired sorting, with tild this becomes simply 1.0~rc1 < 1.0. - Add a rpmlib() tracking dependency to prevent older rpm versions from getting confused with packages relying on the new behavior. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
2011-05-27Clean up + fix memleaks in readIcon()Panu Matilainen1-14/+10
- Assume failure and use single point of exit where all allocations are freed without dumb dead-assignments. Also fixes a leak from icon allocation when Fread() fails.
2011-05-27Eliminate bunch of obvious dead NULL assignments in preamble parsingPanu Matilainen1-6/+6
2011-05-27Cosmetics: rewrap/indent to fit 80 columnsPanu Matilainen1-12/+11
2011-05-27Sanitize handlePreambleTag() error returnsPanu Matilainen1-36/+39
- Single point of exit, assume failure. There are plenty of calls here which can fail, each with different int/rpmRC return code styles when we simply want an RPMRC_OK/RPMRC_FAIL for the return. Also eliminates some dead rc assignments.
2011-05-20Don't fetch missing sources on spec queryPanu Matilainen1-1/+3
2011-04-19Attempt to fetch sources/patches when they are missing from %_sourcedirJindrich Novy1-0/+25
- use _default_source_url macro to specify default URL when it is missing from the spec Source/Patch line - this feature can be disabled by defining _disable_source_fetch to 1
2011-03-04Actually propagare failure when addOrAppendListEntry() fails,Jindrich Novy1-7/+11
add missing headerGet() check.
2011-01-25Teach rpm about post-transaction dependenciesPanu Matilainen1-0/+1
- %posttrans dependencies have their own peculiar semantics, they're install-only dependencies which have no implications on ordering.
2010-12-13Implement transaction ordering hintingPanu Matilainen1-0/+2
- Add support for new "OrderWithRequires: foo" spec syntax which has "if and only if foo is present in transaction, order the transaction as if this package required foo" semantics. While it looks, and in some ways is, a soft dependency, this is not the same as recommends/suggests etc: those have unknown depsolver policy dependent semantics attached to them, whereas ordering hints have a clear definition and is only relevant for rpm itself, depsolvers should not even look at the data. - This allows packages to express correct ordering for optional functionality, such as %post if [ -x %{_bindir}/register-component ]; then %{_bindir}/register-component %{name} fi If the package containing %{_bindir}/register-component is included in the same transaction, it makes sense to have it installed before the package(s) that use it. But as it is fully optional, Requires would not be appropriate. Using OrderWithRequires allows this to be expressed without dragging in extraneous dependencies for optional functionality.
2010-10-29Const-correctness: rpmCharCheck() doesn't modify field, make it constPanu Matilainen1-2/+2
2010-10-29Eliminate unused spectag and speclines goo from specPanu Matilainen1-25/+0
- These were used, back in the day, to implement a hidden --specedit switch, which in all its glory did: print a copy of a spec file, with group, summary and description looked up from specspo. This huge pile of junk was left behind from kicking out the useless "feature" in commits 7b95061d3b77d8e6b3c80e856b66f49b393511ba and 0f991a14209054da7c45c46e96750738fc62874d.
2010-10-22Brute-force s/rpmTag/rpmTagVal/ in entire librpmbuildPanu Matilainen1-15/+15
- Many of these cases would be true enums from preambleList & similar, except for the list terminating sentinel. Just switch all the remaining rpmTag's to rpmTagVals to bring our enum-whacking to a grande finale.
2010-10-12Add 'VCS' keyColin Walters1-0/+4
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.
2010-09-01Handle --nolang as another spec parse flagPanu Matilainen1-3/+1
2010-09-01Combine spec parsing options into a common flag bitfieldPanu Matilainen1-1/+1
2010-08-25Mass eviction of remaining internal helpers in librpmbuild APIPanu Matilainen1-1/+2
- Yank everything qualifying as "internal helper function" into internal-only headers, loosely grouped as follows: 1) Everything involving spec-manipulation goes into rpmbuild_internal.h 2) All other miscellaneous helpers go into rpmbuild_misc.h - This leaves us a rather minimal, and nearly useful API into librpmbuild: Users need to be able to parse a spec, query or build (parts of) it and free up the spec structure when done. This is what we have now, various still exposed structures not counting.
2010-08-24Eliminate addSource() from librpmbuild APIPanu Matilainen1-0/+123
- Nothing outside parsePreamble.c needs, bury it there and make static
2010-08-24Eliminate parseNoSource() from librpmbuild APIPanu Matilainen1-0/+57
- Nothing outside parsePreamble.c needs, bury it there and make static
2010-06-22Add new Collections preamble tagSteve Lawrence1-0/+4
This adds a new Collections preamble tag, which contains a space separated list of collection names that the package belongs to.
2010-03-29headerNextTag() fits the checkForDuplicates() use-case betterPanu Matilainen1-9/+5
- as we're only looking at tags, not their contents... avoid unnecessary data shuffling and the code is a little simpler too
2010-03-29Oops, being a bit too strict on dependency qualifiersPanu Matilainen1-7/+9
- 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 - Additionally build-dependencies dont take any qualifiers now
2010-03-29Teach rpm about pre-transaction dependenciesPanu Matilainen1-0/+1
- A pre-transaction dependency is generally anything that must be available at the start of the transaction, and cannot be resolved by packages *in* the transaction. This lets %pretrans scriptlet dependencies be expressed correctly, and could be also used for other kinds of pre-conditions. - rpmlib() dependencies are a special case of pre-trans dependencies but leaving them handled separately as they cannot be provided by anything in rpmdb either, whereas pretrans dependencies can.
2010-03-29Always fail build on unknown dependency qualifiersPanu Matilainen1-3/+6
- previously unknown qualifiers would go unnoticed if they happened be last (including being the only qualifier), eg Requires(pre,junk) or Requires(junk) would be cheerfully accepted but Requires(junk,pre) not.
2010-03-29Always initialize tagflags to RPMSENSE_ANYPanu Matilainen1-2/+1
2010-03-29Drop "support" for per-scriptlet build-requiresPanu Matilainen1-21/+2
- Rpm has never done anything useful with "BuildRequires(prep): foo" style dependencies other than recorded them in src.rpms, nor is there much point in properly supporting this in the future either - Frees up four more bits from rpmsenseFlags for better uses
2010-02-01Revert spec tag-macro concatenation changesPanu Matilainen1-25/+2
- Concatenating to global, non-namespaced tag macros is fundamentally broken for specs with sub-packages, RhBug:555926 is not fixable with tag macros tweaks. Revert back to the old behavior where tag macros are simply "the last line seen wins." This might not be what one expects in many cases but it is at least consistent, and changing the behavior in any way (such as not adding the macros for multiline-items like requires) breaks existing packages without a good reason. - Correctly handling the expected %{obsoletes} etc behavior in RhBug:555926 would require a new mechanism, such as permitting spec to access the (sub-)package headers. Probably doable, unlikely to be worth the effort as the issue can be easily avoided by writing the spec differently. - This reverts commits 3be37d9c78fd13424880fa1fe48f341103a51194 and e811ef56aa88588e16e0a80d48381a62631f8fc4
2010-01-20Concatenate multiline tags in macros only in case ofJindrich Novy1-12/+20
Requires/Obsoletes/Conflicts and Provides. Preserve older behaviour for other tags.
2010-01-16Correctly expand %{obsoletes}, %{requires}, etc. in spec (RhBug:555926)Jindrich Novy1-2/+17
- tags declared multiple times in spec were simply overwritten so referencing it via %{} just showed contents of the last one
2010-01-05Move <ctype.h> include out of system.h to the places that need itPanu Matilainen1-0/+2
2009-12-17Permit unexpanded macros to slip through spec tag sanity checks (RhBug:547997)Panu Matilainen1-2/+2
- For now, let %{} characters through our valid character set checks on specs. This isn't right really, but unexpanded, unrelated macros in spec can now cause failure to parse out buildrequires which would allow those macros to be expanded. This needs a better fix.
2009-09-02Take advantage of new header string gettersPanu Matilainen1-6/+2
2009-09-02Eliminate uses of headerNVR() and friends in librpmbuild codePanu Matilainen1-4/+3
2009-09-01Group tag inheritance doesn't need special treatment, just copy with othersPanu Matilainen1-8/+1
2009-08-31Replace equal/not equal uses of str[n]cmp() with rstreq[n] in build codePanu Matilainen1-8/+8
2009-08-13Add an option bug reporting URL tag to packages (RhBug:512774)Panu Matilainen1-0/+4
2009-07-23Kill off lclint remnants everywherePanu Matilainen1-1/+0
- remove ancient and likely irrelevant LCL comments and bogus NULL checks
2009-06-16Don't check Provides/Requires for bad characters, they could be UTF-8Jindrich Novy1-4/+4
- don't check Name but EVR in parseRCPOT() - use rpm namespacing for charCheck() - remove unused variable
2009-06-15Check for valid chars in Requires/Provides as wellJindrich Novy1-6/+13
2009-06-10Add new function to check valid characters in NVR (ticket #59)Jindrich Novy1-18/+32
2009-06-10Nuke useless compatibility stuff and put V/R checking where it belongsJindrich Novy1-16/+5
2009-06-09Make whitelist of characters allowed in NVR (ticket #59, rhbz#493157)Jindrich Novy1-1/+4
2009-06-01Generate preamble tag lengths at build time and make it constPanu Matilainen1-57/+45