Age | Commit message (Collapse) | Author | Files | Lines |
|
- 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.
|
|
|
|
|
|
|
|
|
|
- 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.
|
|
- doScript() doesn't do anything special with the script buffer,
this lets us use const for the argument.
|
|
- 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
|
|
- 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...
|
|
- Add another flag set to control package generation, passing around
as necessary. Use this to implement --nodirtokens functionality
in a cleaner manner.
|
|
- 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.
|
|
- Avoids having to access rpmBTArgs from deep packageBinaries(),
API changing is not an issue anymore...
|
|
|
|
- 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.
|
|
- 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
|
|
|
|
- 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
|
|
|
|
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
|
|
- 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.
|
|
- buildSpec() is sufficient interface for accomplishing the same,
avoid exposing internal helpers
|
|
|
|
- no point conditionalizing what we cant live without
|
|
- export doRmSource() and make it more consistent with the API
|
|
removal is requested (rhbz #472427)
|
|
- the correct exit code should be 127 accoring to bash(1),
we want to keep the same exit code behaviour as bash for rpm
|
|
- rename rpmMkTemp() (back) to rpmMkTempFile()
- rpmMkTemp() is now a lower level thin wrapper around mkstemp()
|
|
- 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...
|
|
- this is a bit nasty as it changes public interfaces but rename to make
it explicit they're just plain paths, not urls
|
|
|
|
- the temp name is malloced and needs to be freed by caller
|
|
|
|
|
|
|
|
- adjust include paths accordingly
|
|
|
|
|
|
- we only care about local files
|
|
- probably not very useful outside rpm but used all over the tree,
- rename to rpmMkTempFile() for namespacing since we're exporting it now
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|