Commit Graph

13285 Commits

Author SHA1 Message Date
Neal Gompa (ニール・ゴンパ) 3ad7495442 Fix pkgconfig reference to Lua in Libs.private 2016-03-17 09:52:30 -04:00
Neal Gompa (ニール・ゴンパ) 50905f4a59 Use fuzz settings for %autopatch/%autosetup
In the %apply_patches that inspired %autopatch, patch application
respects the fuzz settings that are used for %patch. %autopatch
and %autosetup weren't using this, which led to an inconsistent
patch application behavior.
2016-03-17 11:39:05 +01:00
Lubos Kardos 877d5b130c Fix non-working combination of %lang and %doc directive (rhbz:1254483) 2016-03-16 17:33:14 +01:00
Lubos Kardos 92a8babf1b Remove hopefully the last static buffer in rpm spec reading 2016-03-11 17:02:55 +01:00
Zbigniew Jędrzejewski-Szmek 19fe0d9ae1 Add posix.redirect2null
This is useful to silence output in forked programs:
https://bugzilla.redhat.com/show_bug.cgi?id=1287918

Tested with the following scriptlet:
%post -p <lua>
pid = posix.fork()
if pid == 0 then
    assert(posix.exec("/bin/sed"))
elseif pid > 0 then
    posix.wait(pid)
end
pid = posix.fork()
if pid == 0 then
    posix.redirect2null(2)
    assert(posix.exec("/bin/awk"))
elseif pid > 0 then
    posix.wait(pid)
end

As expected, the error message from sed is printed, the error message
from awk is not.
2016-03-10 14:22:01 +01:00
Lubos Kardos 5490887c3a Add option the select option --builtrpms to rpmspec(rhbz:961833)
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.
2016-03-09 14:51:27 +01:00
Lubos Kardos cc61141245 Fix memory leaks in rpmGetSubkeys() and pgpPrtParamsSubkeys() 2016-03-08 14:29:24 +01:00
Lubos Kardos 468726ece5 Display message when a hook function of some plugin fails (rhbz:1262424)
For a pre hook function display an error message and for a post hook
function display just a warning message. This corresponds with
the way how error/warning messages are displayed for scriptlets.

Also add a debug message into selinux plugin.
2016-03-07 13:26:35 +01:00
Lubos Kardos 00ebe2e59b Make --noplugins work with "rpm --verify"
This caused problems in rpm test suite.
2016-03-07 13:26:35 +01:00
Lubos Kardos cb88badcd6 Current plugins don't make sense in rpmbuild so disable them there
In rpmbuild only an init hook was called and no other hooks was called.
So the plugins were initialized in rpmbuild but they were never used
in rpmbuild. Even the init hook was called from place where calling
of init hook made no sense (it was called from rpmCheckDeps()).

Also it wasn't possible to disabled plugins in rpmbuild with --noplugins,
which caused problems in rpm test suite.
2016-03-07 13:26:35 +01:00
Zbigniew Jędrzejewski-Szmek f8a75ae6a2 Fix option parsing in pythondistdeps
Followup for d636ab1.
2016-03-02 14:10:43 -05:00
Florian Festi a8d41dbadf Remove long gone --nocollections option from man page 2016-03-02 12:09:11 +01:00
Nicolas Vigier b8a54d6a1e Allow SOURCE_DATE_EPOCH to override RPMTAG_BUILDTIME
SOURCE_DATE_EPOCH environment variable is a distribution-agnostic
standard for build systems to exchange a timestamp.

SOURCE_DATE_EPOCH specification is available at:
https://reproducible-builds.org/specs/source-date-epoch

Signed-off-by: Dhiru Kholia <dhiru@openwall.com>
2016-02-29 17:45:16 +01:00
Florian Festi d93c97b606 Check if binary packages is passed instead of spec file
and give proper error message
2016-02-29 10:15:20 +01:00
Florian Festi d53499d156 Use %_build_cpu instead of noarch when evaluating ExcludeArch and ExclusiveArch
Some noarch packages need build tools not available on all architectures.
By using %_build_cpu you can restrict the architectures those noarch
packages can be build on.
2016-02-26 11:15:23 +01:00
Florian Festi 21661336c3 Use pkg->dpaths during dependency generation instead of buildRoot + filename
This passes the filenames with the actual file content to the dependency
generators when using RemovePathPostfixes (rhbz#1306559).
2016-02-25 16:54:31 +01:00
Peter Eisentraut 4749a08a9e Fix symlinks for installations outside /usr/bin
rpmquery and rpmverify are symlinks to rpm.  The former are usually
installed in /usr/bin, the latter in /bin, so the symlink points to
../../bin/rpm.  But for installations into other prefixes, the synlimk
should just point to the same directory.
2016-02-24 17:59:48 +01:00
Neal Gompa (ニール・ゴンパ) c67aeced99 Properly support BeeCrypt option in build system 2016-02-24 17:45:55 +01:00
Neal Gompa (ニール・ゴンパ) aa4c0d478b digest_beecrypt: Use correct header locations
BeeCrypt installs its headers to beecrypt/ subdirectory
2016-02-24 17:45:55 +01:00
Lubos Kardos 54d664cb92 ndb: fix regression from 20f2c51053
If there was need to regenerate indexes and index file was open readonly
then index file was closed and open again as readwrite. But problem was
that index file may have already been memory mapped so closing it wasn't
right solution.

Now if it is possible then index file is open as readwrite from
the beggining no matter of requested open flags.
2016-02-22 14:56:39 +01:00
Lubos Kardos efd696d32d Fix --noghost option (rhbz:1306438) 2016-02-19 13:17:48 +01:00
Michal Toman cd02e0675e Add support for MIPS release 6 - Add mips32 mips64 mipsel and mipseb macros 2016-02-19 12:06:39 +01:00
Florian Festi 83219d023b Also block idle and sleep in the systemd-inhibit plugin
We really should not suspend or hibernate during rpm operations. Chances are
too high to not wake up properly and damage the system (see rhbz#1297984).
2016-02-19 10:00:58 +01:00
Lubos Kardos 46b482e9d4 ndb: write also usergeneration in rpmxdbWriteHeader() 2016-02-17 22:02:22 +01:00
Lubos Kardos 20f2c51053 ndb: fix regenerating missing indexes
Previously ndb backend detected missing indexes wrongly and not all
missing indexes was recreated automatically.
2016-02-16 18:22:17 +01:00
Lubos Kardos ffe1ab0840 ndb: add rpmpkgLockInternal()
Previously it wasn't able to get an exclusive lock with rpmpkgLock() if
pkgdb was open readonly. That's ok for pkgdb  but rpmpkgLock() is also
used in rpmxdbLock() which is used for locking indexes. And when pkgdb
was open rdonly even if indexes were open rw, it wasn't possible to
write into them because it wasn't possible to get exclusive lock with
rpmxdbLock()->rpmpkgLock().

Having pkgdb readonly and indexes rw can happen when pkdb is open as
readonly but during opening of indexes some missing index is detected
so it is necessary to open indexes as rw and regenerate them.

Now rpmpkgLock() enables to get exclusive lock without having pkgdb
open as rw. New function rpmpkgLockInternal() behaves as rpmpkgLock()
previously and it is used only for pkgdb.
2016-02-16 18:22:08 +01:00
Neal Gompa (ニール・ゴンパ) ff43da89ab Add all the BSDs that support setprogname() and getprogname() 2016-02-15 10:08:25 -05:00
Florian Festi 0534715479 Fix Makefile for rename scripts/pythoneggs.py -> scripts/pythondistdeps.py 2016-02-15 15:57:55 +01:00
Peter Eisentraut 0d74691d37 Additional fixes for getprogname()/setprogname() on BSD systems 2016-02-15 15:57:55 +01:00
Michael Schroeder 1332bfe70e ndb: auto-repair interrupted transactions 2016-02-15 15:52:08 +01:00
Neal Gompa (ニール・ゴンパ) 29abb07fbf Rename to pythonX.Ydist, read .dist-info, support legacy pythoneggs()()
Per the recommendation of Nick Coghlan and Toshio Kuratomi,
pythonXegg(M) is being renamed to pythonX.Ydist(M).

An option has also been added to add a pythonXdist(M)
Provides for distributions that may prefer to have it.
The option '--majorver-provides' is intended for use
if only one Python stack per major version will be
available at a given time, as unexpected results may
occur if there are multiple independent Python stacks
per major version available.

Consequently, it will not be on by default when using
the generator for generating Provides.

Additionally, .egg-info data is being replaced with
.dist-info data, so we need to handle that case, too.

See for more details:
https://lists.fedoraproject.org/archives/list/python-devel%40lists.fedoraproject.org/thread/SQBSAS4T25HK5YJBNBSFDD7KDQWDELL6/

Also, Thierry Vignaud brought up on rpm-maint that Mageia
currently uses "pythonegg(X)(M)" (e.g. "pythonegg(3)(rpm)"
for python3 rpm bindings package) in their Python packages
to pull in Python dependencies and requested a way to
not break Mageia.

After discussing with Florian Festi about it, Mageia's
pythonegg(X)(M) will be supported by adding '--legacy'
as a switch to generate legacy Provides/Requires to maintain
compatibility with Mageia's existing usage.

The '--legacy-provides' switch will enable pythonegg(X)(M)
Provides in addition to the new pythonX.Ydist(M) format to
allow for a easier transition.
2016-02-11 18:23:19 +01:00
Florian Festi 2e0e0a433a Use new xsetprogname() in rpm2archive 2016-02-11 14:09:26 +01:00
Florian Festi ad5ab9cf07 White space fixes 2016-02-11 14:08:58 +01:00
Kamil Rytarowski 61109446ac Reimplement setprogname() and getprogname() to be generic and portable
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.
2016-02-11 14:05:25 +01:00
Peter Eisentraut 159351d7f3 Add missing header files
They are generating warnings.
2016-02-11 11:06:26 +01:00
Peter Eisentraut 92ed1c43a4 Supply declaration of fdatasync if missing
OS X has the function but doesn't have a declaration for it.
2016-02-11 11:06:26 +01:00
Peter Eisentraut c611487b5d Don't define htonll() if already defined
OS X already has it as a macro in the system headers.
2016-02-11 11:06:26 +01:00
Thierry Vignaud d636ab156f kill unimplemented -O option
let's not over-engineering
2016-02-11 10:09:43 +01:00
Thierry Vignaud 8f0ddfe072 kill now unused is_exe() 2016-02-11 10:09:43 +01:00
Thierry Vignaud e6cc5a5a51 kill now useless --buildroot option 2016-02-11 10:09:42 +01:00
Thierry Vignaud f5168b4619 do not call typelib deps generator
rationale:
1) typelib deps are unrelated to python
2) typelib deps are computed by suse generator
3) suse generator is not present upstream
4) let's not reinvent internal deps generator here...
2016-02-11 10:09:42 +01:00
Lubos Kardos 3938685a8f Sync parent directory after creating db files 2016-02-08 17:16:18 +01:00
Lubos Kardos 6151ac9a29 Replace fdatasync() with fsync()
fdatasync() is not enough in some filesystems because blocks with data
are flushed to a disk but the structure which references these data
blocks is not.
2016-02-08 15:14:31 +01:00
Lubos Kardos 6225060752 Just warn for non-empty blob in ndb otherwise transaction can be blocked 2016-02-08 15:01:03 +01:00
Lubos Kardos 55cfae631b Revert the previous change, it caused regressions (rhbz:1303265)
Some tools like yum parse error messages from rpm so the change of
that error message broke yum and maybe other tools.

This reverts commit 3620b7faec.
2016-02-01 09:43:58 +01:00
Lubos Kardos 3620b7faec Improve the error showed when a filesystem is read only (rhbz:1142386) 2016-01-29 14:22:59 +01:00
Lubos Kardos bb2294c411 Show warning when ftruncate() fails
Failing ftruncate() at this place is not critical but show at least
warning that something goes wrong and quiet the compiler warning
about unused result.
2016-01-29 11:56:55 +01:00
Michal Domonkos 448db68ceb Add RPMCALLBACK_ELEM_PROGRESS callback type
Currently, there's no callback type that would be issued per each
transaction element.  RPMCALLBACK_TRANS_PROGRESS is only issued during
the prepare phase but not when packages are actually installed or
erased.  Likewise, RPMCALLBACK_INST_ST* and RPMCALLBACK_UNINST_ST* won't
be issued if an install or erase operation is skipped for some reason (a
script or package upgrade failure).

Having such a callback would allow the Python API consumers to always
know upfront which element is about to be processed, before any other
callbacks are issued.  This is important since not every callback type
carries enough data about the subject package; while the INST types
provide the user object passed to a former addInstall call, the UNINST
types only provide the package name (which may not be unique within the
transaction set).

This commit adds such a callback.
2016-01-28 17:03:54 +01:00
Andreas Scherer ff30bf02b5 Permit dynamic selection of SCM.
Invoking '%__scm_setup_$__scm' without looking at option '-S' in the
specfile, permits dynamic selection of the SCM on the commandline

   rpmbuild --define="__scm SCM"

Tested with rpmbuild 4.13, git, svn, ... on Linux Mint 17.2.
2016-01-28 16:33:00 +01:00
Thierry Vignaud ebe0ce5e26 mention --rpmfcdebug in man pages 2016-01-28 14:42:47 +01:00