summaryrefslogtreecommitdiff
path: root/build/spec.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-16Upgrade version to 4.14tizen/4.14.1.1.tizen20230628wangbiao1-38/+99
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309 Signed-off-by: wangbiao <biao716.wang@samsung.com>
2012-07-31Allocate spec line buffer separately from spec structPanu Matilainen1-0/+3
- Further preliminaries for dynamic buffer resizing
2012-05-16Push special doc directory generation next to other special doc foobarPanu Matilainen1-1/+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-05-16Refactor special doc handling out of parseForSimple()Panu Matilainen1-1/+0
- Change parseForSimple() to return all filenames it finds, moving most sanity checking and decision making of what goes where to processPackageFiles() which has a better overall view of things. This also means we could trivially handle more than one file per %files line, but keeping the (now artificial) limitation for now at least. - Collect special %doc arguments individually to a local ARGV, split the script generation and execution to a separate helper function. - Actual semantics / behavior is not supposed to change (other than 'cp' now getting called once per %doc arg, not per %doc line), but knock wood, this is a larger at-once change than I care for.
2012-03-07Revert to former spec query behavior + commentPanu Matilainen1-0/+7
- Various tools expect to get the full package list, not just those that would actually be built. There are of just as valid reasons for only wanting the packages that would be built, but we need to make this caller specifiable, just changing the behavior breaks existing tools unnecessarily. Add reminder comment why the thing is the way it is...
2011-06-17Support retrieving the spec contents in parsed formatPanu Matilainen1-0/+3
- Collect the preprocessed (conditionals, macros etc evaluated) lines to a separate stringbuf, make rpmSpecGetSection() return that on RPMBUILD_NONE "section" (hack, but so is abusing RPMBUILD_FOO for the section here so shrug)
2011-05-27Eliminate bunch of obvious dead NULL-assingments from misc build partsPanu Matilainen1-5/+5
2011-05-27Rip hysterical hoop-jumping on spec/pkg cpiolist freeingPanu Matilainen1-11/+2
- Just call rpmfiFree() directly, wtf?
2011-04-04Don't list packages which will not be created in spec query (RhBug:693338)Jindrich Novy1-1/+3
- particularly, while doing "rpm -q --specfile <a spec file>"
2011-03-04Make rpmspecQuery() return match the descriptionPanu Matilainen1-4/+3
- It's supposed to return the number of errors, instead of silently ignoring errors from qva->qva_showPackage() to unused variable, count them. That qva->qva_showPackage() currently never returns errors is another story...
2010-12-23Require %files section for package generation againPanu Matilainen1-1/+1
- Turns out this change does more harm than good, people are actually relying on this behavior to avoid zillion conditionals in the spec. We'll want a saner way to conditionally disable/enable packages but until we have that, revert to the former longstanding behavior. - This effectively reverts commit d010ec1c9026b35f5b2521be965c03c826894ce8
2010-10-29Eliminate unused spectag and speclines goo from specPanu Matilainen1-35/+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-28Use ARGV_t for package fileFile, fileList and policyListPanu Matilainen1-4/+5
- Similar to commit 1e3db59b568b1ff7f7e1f3285fc9b18567f2f2d6, all these end up being passed to argvSplit() to process them line by line in the end, collect them in the argv to start with saving a whole lotta huffing and puffing in the process
2010-10-22Brute-force s/rpmTag/rpmTagVal/ in entire librpmbuildPanu Matilainen1-1/+1
- 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 support for querying source rpm from spec tooPanu Matilainen1-2/+6
- Handle source rpm query as a new query source type RPMQV_SPECSRPM, rename the binary query to RPMQV_SPECRPMS, with RPMQV_SPECFILE as a backwards compatibility alias to RPMQV_SPECRPMS.
2010-10-12Add a getter for the source header.Eric W. Biederman1-1/+6
It appears the access to the source header has started to get buried into usability so add an getter so the implementation can change a little without breaking callers.
2010-10-01Add getter for spec script sections too, bah...Panu Matilainen1-0/+14
- Pretty dumb and all, but to avoid breaking some python users (some folks apparently have found /some/ use for these...)
2010-10-01Add minimal API for spec packages and sourcesPanu Matilainen1-0/+79
- Iterators for both (these could easily done as self-iteration over ->next but to keep the api similar to other rpm iterators...) - Minimal getters to satisfy python bindings needs
2010-09-21Return explicit NULL from various fooFree() functions everywherePanu Matilainen1-2/+4
2010-09-14Plug memleak from rpmSpecCheckDeps()Panu Matilainen1-2/+2
- We need to call rpmtsEmpty(), not rpmtsClean() to purge the transaction elements in the set...
2010-09-08Urk, mixed up in branches and wrong stuff getting pushed. Revert.Panu Matilainen1-1/+1
- This reverts commits 9ac127c35272772e0fc862608f4bde9748862b3d and 7abc26e300afd4da71f220db496f813571a37f5a
2010-09-07Mark ts argument unused in bunch of query APIsPanu Matilainen1-1/+1
- The ts argument used to be necessary and used for rpmfiNew() and spec query but not any more...
2010-09-02Add a new public function for retrieving build dependencies from specPanu Matilainen1-0/+5
- Not needed by rpmbuild itself currently, but permits retrieving the build dependency information in a format that's better suited for further processing than an rpm problem set.
2010-09-02Move build dependency checking from cli tool to librpmbuildPanu Matilainen1-0/+14
- Add new public rpmSpecCheckDeps() function which can be used for checking build dependencies of a spec against a transaction set. - Change checkSpec() in rpmbuild cli to use the new interface - rpmbuild.c is now free of direct spec structure accesses
2010-09-01Combine spec parsing options into a common flag bitfieldPanu Matilainen1-2/+1
2010-09-01Rename freeSpec() -> rpmSpecFree() for namespacingPanu Matilainen1-3/+3
- librpmbuild actually now has what remotely resembles an API, after we broke every single thing there was ;)
2010-09-01Update callers to use the new rpmSpecParse() interfacePanu Matilainen1-11/+3
2010-09-01Eliminate silly and unused timecheck feature from (lib)rpmbuildPanu Matilainen1-2/+0
- This was broken for years without anybody complaining, should be safe to conclude nobody will miss it later either. And if somebody misses it, this is a job for rpmlint really.
2010-09-01Spec rootDir is only relevant for building, eliminate from parseSpec()Panu Matilainen1-2/+1
- The whole rootDir seems dubious for build purposes, but in any case its only relevant during the actual build process, not for spec parsing. Set spec->rootDir from buildSpec() for the duration of the build to avoid having to refactor doScript() and all right now.
2010-09-01Eliminate cookie from spec structurePanu Matilainen1-5/+1
- Cookies are not a property of spec but a given build, handle this internally to buildSpec() except for --rebuild which passes the srpm identifier cookie through buildArgs
2010-09-01Add new %sepolicy section to the spec file formatSteve Lawrence1-0/+2
The %sepolicy section is used to describe SELinux policy to be included in a package. It's syntax is similar to other sections (%files, %pre, %post, etc.) in that you can provide a string and -n after the declaration to specify policy should be added to a subpackage. For example: %sepolicy # policy in this section will be added to the main package %sepolicy foo # policy in this section will be added to the '<mainpackage>-foo' subpackage %sepolicy -n bar # policy in this section will be added to the 'bar' subpackage The %sepolicy section contains zero or more %semodule directives, with the following format: %semodule [OPTIONS] path/to/module.pp The available options are: -b, --base The module is a base module -n, --name=NAME The name of the module. If not given, assumes the name is the basename of the module file with file extensions removed. -t, --types=TYPES One or more comma-separated strings specifying which policy types the module can work with. To explicitly state that a module can work with any policy type, "default" can be specified as the value. If not specified, assumes the module can work with any policy type, and assigns the types as "default". Below is an example of this new format: %sepolicy %semodule -n foo -t mls policy/foo.pp %semodule -n bar -t strict,targeted,mls -b policy/bar.pp This also adds new header tags to store the new information: RPMTAG_POLICYNAMES (string array) RPMTAG_POLICYTYPES (string array) RPMTAG_POLICYTYPESINDEXES (uint32 array) RPMTAG_POLICYFLAGS (uint32 array) The index of NAMES and FLAGS maps directly to the index of RPMTAG_POLICIES. However, because a single policy can have multiple types, the mapping for TYPES is not direct. For this, the index maps to TYPESINDEXES, which contains the index of the policy that the type maps to. This is similar to how DIRINDEXES is used to map DIRNAMES and BASENAMES. As an example, the previous %sepolicy section would have the following header tags: RPMTAG_POLICIES: 0: <foo.pp data, base64 encoded> 1: <bar.pp data, base64 encoded> RPMTAG_POLICYNAMES: 0: foo 1: bar RPMTAG_POLICYFLAGS: 0: 0 1: 1 # assumes flag 1 == BASE RPMTAG_POILCYTYPES: RPMTAG_POLICYTYPESINDEXES: 0: mls 0: 0 1: strict 1: 1 2: targeted 2: 1 3: mls 3: 1
2010-08-26Permit packages with no files to omit %files entirelyPanu Matilainen1-0/+1
- Fixes the long standing obscure behavior of missing %files section causes build to complete without errors but without producing any packages either. Packages without files in them are perfectly valid (eg metapackages), requiring empty %files section for those is just unnecessary spec noise. - Remove %files section on one of the test-suite specs to create a test-case for this as a side-effect. - This of course introduces a slight incompatibility with older rpm's, if compatibility is required then just add those empty %files in the spec, they dont hurt anything but the readers eyes.
2010-08-26Clean up newPackage() a bitPanu Matilainen1-30/+2
- No much point explicitly NULL'ing calloc()'ed memory, only initialize the values that are something else + other cosmetics.
2010-08-25Mass eviction of remaining internal helpers in librpmbuild APIPanu Matilainen1-1/+1
- 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-25Eliminate freePackage() from librpmbuild APIPanu Matilainen1-1/+1
- The only thing that should ever call this is freePackages() which was already made static. As newPackage() links the package structure with the spec, its not safe for others to call it.
2010-08-24Eliminate freePackages() from librpmbuild APIPanu Matilainen1-1/+1
- This is a spec-internal cleanup task, no need outside spec.c
2010-08-24Eliminate now unnecessary buildio.hPanu Matilainen1-1/+1
- readRPM() is not used or needed by anything, shred it - make writeRPM() static inside the only place needing it: pack.c - move struct cpioSourceArchive_s inside pack.c
2010-08-24Eliminate newOpenFileInfo() from librpmbuild APIPanu Matilainen1-15/+0
- Nothing outside parseSpec.c needs, bury it there and make static
2010-08-24Eliminate addSource() from librpmbuild APIPanu Matilainen1-122/+0
- Nothing outside parsePreamble.c needs, bury it there and make static
2010-08-24Eliminate parseNoSource() from librpmbuild APIPanu Matilainen1-59/+0
- Nothing outside parsePreamble.c needs, bury it there and make static
2010-08-20Remove signing support from (lib)rpmbuildPanu Matilainen1-4/+1
- Signing is better done in an environment completely separated from the process of actually building packages. This is how its generally done anyway by distros, this change just forces the issue. - While signing on build seems handy and saves some io-churn, this is very insecure as your precious secret passphrase remains unencrypted in memory for the entire duration of the build where it's accessible to whatever happens to be building. This change doesn't affect fix the issue of unencrypted passphrase residing in memory and potentially getting swapped out, it only limits the exposure to the actual signing process which isn't subject to unknown scripts poking around. - Minimally preserve rpmbuild's --sign functionality via popt --pipe hack to call rpm --addsign when build completes
2009-10-16Since we really want a FILE* then get one in the first placePanu Matilainen1-1/+1
- this is visible in the librpmbuild exported goo, rename the member to force build-breakage on the poor souls trying to use librpmbuild API
2009-09-07Move rl to the scope where its needed, dont bother assigning NULLPanu Matilainen1-3/+2
2009-09-02Fix dumb thinko from commit 4177fdffd6e7414123062e8716afb22596608531Panu Matilainen1-1/+1
2009-09-02Eliminate uses of headerNVR() and friends in librpmbuild codePanu Matilainen1-2/+2
2009-08-31Replace equal/not equal uses of str[n]cmp() with rstreq[n] in build codePanu Matilainen1-1/+1
2009-08-17Avoid adding Lua sources and patches twice when recursing (ticket #82)Panu Matilainen1-10/+10
- parseSpec() operates on newly created empty spec structures even when "recursing" but the lua variables are global and need recursion protection to avoid adding multiple times
2009-06-23Teach %files to accept multiple filelists (ticket #70, rhbz#475359)Jindrich Novy1-1/+1
2008-09-02Avoid dumb castsPanu Matilainen1-1/+4
- switch-case on rpmTag enum makes gcc go crazy without a default case
2008-08-08Add parenthesis to make gcc happyPanu Matilainen1-2/+2