summaryrefslogtreecommitdiff
path: root/build/build.c
AgeCommit message (Collapse)AuthorFilesLines
2011-07-08If we need a FILE stream then get one...Panu Matilainen1-12/+7
- Replace the hysterical "lets see if the temp creation gave an fpio fd (it didn't), if not open another fd and then get its private FILE pointer" fiddling: since we need a FILE stream then open one with fdopen(), duh. Grabbing a rpmio fd to begin with is stupid enough when all we want is a stream, but wanting to use rpmMkTempFile() functionality... - Also fixes an fd+mem leak in the unlikely but possible case that rpmMkTempFile() succeeds but fdopen() fails.
2011-05-28Remove pointless variable and a dead assignment to itPanu Matilainen1-5/+2
2011-05-27Eliminate bunch of obvious dead NULL-assignments from build script codePanu Matilainen1-8/+8
2011-03-04Add missing exit status check for waitpid() while executing scriptletsJindrich Novy1-0/+7
2011-01-21Restore default SIGPIPE handling for build scriptlets (RhBug:651463)Panu Matilainen1-1/+2
2010-12-15Unify the user+group caching between librpm and librpmbuildPanu Matilainen1-1/+2
- The build version has getUidS() and getGidS() for which there is no counterpart in the rpmug api but there's not much point to them: they check whether the user/groupname exists but return our own string back to us even if it doesn't. - The build version also caches more than current rpmug, but has an ugly hardwired limit causing (in theory) errors that can't be nicely handled, and is the last piece relying on RPMLOG_CRIT actually terminating the process. The librpm version doesn't fail, in the worst case its just a bit slower. And that can be fixed anytime by making it to use hash tables for caching.
2010-10-28Pass the script to doScript() as const char *Panu Matilainen1-7/+13
- doScript() doesn't do anything special with the script buffer, this lets us use const for the argument.
2010-10-28Argument passing hysteria in doScript()Panu Matilainen1-19/+6
- Callers know perfectly well which part they're passing to doScript() so they can just as well pass in the name and the scriptlet to run, avoiding silly stuff in the switch-case
2010-09-02Swap rpmSpecBuild() arguments for consistency with other APIsPanu Matilainen1-1/+1
- What we're building comes first, /how/ we're building comes second - Update the sole caller, doesn't matter as this is a new interface...
2010-09-02Eliminate _noDirTokens from librpmbuild API+ABIPanu Matilainen1-2/+3
- Add another flag set to control package generation, passing around as necessary. Use this to implement --nodirtokens functionality in a cleaner manner.
2010-09-02Eliminate freeNames() from librpmbuild ABIPanu Matilainen1-0/+2
- Call freeNames() at end of buildSpec() instead of requiring API users to clean up after us. This does mean losing some of the supposed caching advantage when building on more than one spec, but hardly matters, one spec at a time is the typical build usage anyway.
2010-09-02Detect short-circuited build based on executed build steps from buildSpec()Panu Matilainen1-1/+3
- Avoids having to access rpmBTArgs from deep packageBinaries(), API changing is not an issue anymore...
2010-09-02Handle --nobuild as another buildAmount flagPanu Matilainen1-1/+1
2010-09-01Spec rootDir is only relevant for building, eliminate from parseSpec()Panu Matilainen1-0/+3
- 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-2/+4
- 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-01Sanitize buildSpec() arguments a bitPanu Matilainen1-5/+6
2010-09-01Replace buildSpec() with a new interface in the APIPanu Matilainen1-1/+6
- Accept the entire build arguments structure along with a spec, these contain everything that we'll need - Just a convenience wrapper for buildSpec() for now, more things to follow... - Update the sole existing caller accordingly
2010-09-01Eliminate useless hardwired build debug fooPanu Matilainen1-4/+0
2010-09-01Add new %sepolicy section to the spec file formatSteve Lawrence1-0/+4
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-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 doRmSource() from librpmbuild API againPanu Matilainen1-1/+1
- buildSpec() is sufficient interface for accomplishing the same, avoid exposing internal helpers
2010-01-05Move <errno.h> include out of system.h to the places that need itPanu Matilainen1-0/+1
2010-01-05Unconditionally include <sys/wait.h> where neededPanu Matilainen1-0/+2
- no point conditionalizing what we cant live without
2009-01-11Don't check package BuildRequires when doing --rmsource (rhbz#452477)Jindrich Novy1-2/+6
- export doRmSource() and make it more consistent with the API
2009-01-11Don't fail because of missing sources when only specJindrich Novy1-4/+0
removal is requested (rhbz #472427)
2008-11-04Return proper exit code when exec*() functions failJindrich Novy1-1/+1
- the correct exit code should be 127 accoring to bash(1), we want to keep the same exit code behaviour as bash for rpm
2008-05-03Temp file handling tweaksPanu Matilainen1-1/+1
- rename rpmMkTemp() (back) to rpmMkTempFile() - rpmMkTemp() is now a lower level thin wrapper around mkstemp()
2008-04-11Rewrite rpmMkTempFile() for sanityPanu Matilainen1-1/+2
- Actually use mkstemp() for creating the temp file and return a FD_t dupped from the file descriptor returned by mkstemp(). - Simplify the interface while at it. - Change callers for the new interface. - Yes we now require mkstemp() to work, mkstemp() is in POSIX.1-2001 and this is year 2008...
2008-04-09Yet more url ripping - buildroot is never an urlPanu Matilainen1-1/+1
- this is a bit nasty as it changes public interfaces but rename to make it explicit they're just plain paths, not urls
2008-04-09Remove remote host stuff from build doScript()Panu Matilainen1-55/+7
2007-12-16Remove const from rpmMkTempFile file name parameterPanu Matilainen1-1/+1
- the temp name is malloced and needs to be freed by caller
2007-12-15Another bunch of bogus const removalsPanu Matilainen1-3/+3
2007-12-15Remove bogus const from rpmGenPath() temporary targetsPanu Matilainen1-1/+1
2007-12-15Remove bogus const from rpmGetPath() temporary targetsPanu Matilainen1-2/+2
2007-12-08Switch to <rpm/foo.h> style for public headersPanu Matilainen1-3/+3
- adjust include paths accordingly
2007-12-07rpm5.org: fixup various places in rpmbuild from rpmerr.h eliminationPanu Matilainen1-14/+15
2007-12-07rpm5.org: use pid_t, not int in build doScriptPanu Matilainen1-3/+3
2007-12-03Use regular POSIX functions instead of "RPC" clonesPanu Matilainen1-5/+5
- we only care about local files
2007-11-22Move makeTempFile() from misc.h to rpmfileutil.hPanu Matilainen1-2/+2
- probably not very useful outside rpm but used all over the tree, - rename to rpmMkTempFile() for namespacing since we're exporting it now
2007-11-23Use #include <x.h> syntax to include public headers.Ralf Corsépius1-2/+2
2007-11-19Lose rpmerr.h for goodPanu Matilainen1-1/+1
2007-11-19Replace all RPMERR_* etc uses with corresponding RPMLOG_* levelsPanu Matilainen1-7/+7
2007-10-29Use fdGetFILE() instead of rpmio internal fdGetFp() everywherePanu Matilainen1-4/+2
2007-10-28Include "rpmbuild.h" instead of <rpmbuild.h>.Ralf Corsépius1-1/+1
2007-10-28Include "rpmio_internal.h" instead of <rpmio_internal.h>.Ralf Corsépius1-1/+1
2007-10-24Remove dead and unused, ifdef'ed HAVE_FCHMOD block of code.Ralf Corsépius1-11/+0
2007-10-24doScript: Change 'what' to rpmBuildFlags.Ralf Corsépius1-1/+1
2007-10-09Make rpmerr.h private, include directly where needed.Panu Matilainen1-0/+1
2007-10-09Replace all uses of RPMMESS_NORMAL with RPMLOG_NOTICEPanu Matilainen1-2/+2
2007-10-09Replace all rpmMessage() uses with rpmlog()Panu Matilainen1-2/+2