summaryrefslogtreecommitdiff
path: root/rpmspec.c
Commit message (Collapse)AuthorAgeFilesLines
* Reset global macro state after each spec query/parsePanu Matilainen2020-02-121-4/+8
| | | | | | | | | Parsing a spec, even unsuccessfully, will affect the global macro state in any number of ways that may affect the following operations in unpredictable ways. Lacking any saner way to do this, reset the entire global macro state after each spec parse in rpmspec and spec query code (rpmbuild already does this) while maintaining possible cli-specified target and rcfile.
* Remove unused target variable from rpmspec.cHoward Johnson2019-06-051-7/+0
| | | | | | | | Commit d2f48e93d32e222d4727b9684d2032f9bb9fc498 moved the --target argument to be global, but didn't completely remove the local target variable from rpmspec.c, or the code that used it to trigger re-loading the rpm configuration files (which is now handled by the global argument callback in poptALL.c).
* Add --target as global optionPer Øyvind Karlsen2017-04-041-2/+0
| | | | | | | | | | As specifying target will load & set macro definitions according to target specified, it's still useful to provide it anywhere where ie. --eval may be used, as by specifying --target first, it'll change the target specific macros to load which is perfectly sane and useful for checking macro specific definitions. Remove now redundant --target= argument for rpmspec as it's now global.
* Add option the select option --builtrpms to rpmspec(rhbz:961833)Lubos Kardos2016-03-091-0/+2
| | | | | | | When --builtrpms is used then rpmspec operates only on the binary package headers of packages which would be built from spec. That means ignoring package headers of packages that won't be built from spec i. e. ignoring package headers of packages without file section.
* Reimplement setprogname() and getprogname() to be generic and portableKamil Rytarowski2016-02-111-1/+2
| | | | | | | | | | | | | | | | | The RPM code contains setprogname()/getprogname() support implemented through compatiblity layer with very old GLIBC (internals supported back to '95 and earlier), before stabilization of the GNU C library. This compatiblity layer (__progname, __assert_progname, setprogname()) is supposed to support well archaic GLIBC, but on the other hand it pollutes the library namespace and introduces unpredicable compillation errors on BSD systems. The functions setprogname() and getprogname() are natively supported in NetBSD and work the same way as __progname from the GNU C library (they are even implemented in the same way - but with a slightly changed logic). The support for very old (20 years and older) GNU C Library is obfuscating the code, because it uses defines over defines without a word of explaination why to do so. It's important to note that the setprogname()/getprogname() was inconstiently implemented in the codebase, duplicating the code and/or functionality. Add new generic functions getprogname() and setprogname() and bind it to: - the current and for two decades stable GNU LIB C implementation, - the current NetBSD implementation (introduces to NetBSD in 2002), - fallback reimplementation functions of the setprogname() and getprogname() functionality for other systems. Don't support anymore old GNU Lib C internals and don't support older NetBSD systems, as they aren't supported for many years. Add to the codebase comments explaining the relevant codeparts.
* Adjust rpmspec -P to invoke non-build parseAlexey Tourbin2013-01-221-1/+1
| | | | | | | | | | In the query mode, rpmspecQuery puts the parser into non-build mode by invoking rpmSpecParse with (RPMSPEC_ANYARCH|RPMSPEC_FORCE) flags. The same flags should be applied in the parse mode, so that it is possible to preprocess specfiles separately, i.e. without also installing sources and patches. Signed-off-by: Panu Matilainen <pmatilai@redhat.com>
* Make --pipe command failures reflect our exit codes (RhBug:735481)Panu Matilainen2011-09-051-1/+2
|
* Add --parse option to rpmspec tool to dump parsed spec contentsPanu Matilainen2011-06-171-0/+20
| | | | | - This is somewhat like 'gcc -E', useful for analyzing/troubleshooting what happens inside the preprocessing.
* Eliminate dead NULL-assignments at scope-end in main cli utilsPanu Matilainen2011-05-301-2/+2
|
* Rearrange new cli utilities' popt tables for nicer outputPanu Matilainen2010-11-151-2/+8
| | | | | - Use a separate table for the tool-specific options, include that from the "master" option table to get option group summary in --help.
* Rpm option descriptions begin with lowercase letters, follow suit in rpmspecPanu Matilainen2010-10-121-3/+3
|
* Only queryformat is relevant for specfilesPanu Matilainen2010-10-121-3/+6
| | | | | - Instead of including the entire rpmQueryPoptTable in rpmspec and showing several bogus options, support --qf/--queryformat "manually"
* Support overriding target for rpmspec queries tooPanu Matilainen2010-10-121-0/+9
|
* Support both binary/source queries in rpmspec tool (RhBug:540807, ticket #89)Panu Matilainen2010-10-121-1/+6
|
* Lift specfile query out of main rpm(query) into separate binaryPanu Matilainen2010-10-041-0/+77
- Avoids having to link /bin/rpm with librpmbuild and everything it might bring in (eg libmagic) which are not needed for core operation. - Minimally preserve backwards compatibility with popt exec alias