Age | Commit message (Collapse) | Author | Files | Lines |
|
Change-Id: I21bf1a3a7c25cbec43022202cf2e5865b603a309
Signed-off-by: wangbiao <biao716.wang@samsung.com>
|
|
- Further preliminaries for dynamic buffer resizing
|
|
- 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.
|
|
- 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.
|
|
- 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...
|
|
- 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)
|
|
|
|
- Just call rpmfiFree() directly, wtf?
|
|
- particularly, while doing "rpm -q --specfile <a spec file>"
|
|
- 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...
|
|
- 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
|
|
- 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.
|
|
- 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
|
|
- 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.
|
|
- 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.
|
|
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.
|
|
- Pretty dumb and all, but to avoid breaking some python users
(some folks apparently have found /some/ use for these...)
|
|
- 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
|
|
|
|
- We need to call rpmtsEmpty(), not rpmtsClean() to purge the
transaction elements in the set...
|
|
- This reverts commits 9ac127c35272772e0fc862608f4bde9748862b3d and
7abc26e300afd4da71f220db496f813571a37f5a
|
|
- The ts argument used to be necessary and used for rpmfiNew() and spec
query but not any more...
|
|
- 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.
|
|
- 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
|
|
|
|
- librpmbuild actually now has what remotely resembles an API, after
we broke every single thing there was ;)
|
|
|
|
- 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.
|
|
- 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
|
|
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
|
|
- 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.
|
|
- No much point explicitly NULL'ing calloc()'ed memory, only initialize
the values that are something else + other cosmetics.
|
|
- 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.
|
|
- 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.
|
|
- This is a spec-internal cleanup task, no need outside spec.c
|
|
- 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
|
|
- Nothing outside parseSpec.c needs, bury it there and make static
|
|
- Nothing outside parsePreamble.c needs, bury it there and make static
|
|
- Nothing outside parsePreamble.c needs, bury it there and make static
|
|
- 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
|
|
- this is visible in the librpmbuild exported goo, rename the member
to force build-breakage on the poor souls trying to use librpmbuild API
|
|
|
|
|
|
|
|
|
|
- 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
|
|
|
|
- switch-case on rpmTag enum makes gcc go crazy without a default case
|
|
|