Commit Graph

15492 Commits

Author SHA1 Message Date
Florian Festi c495d73449 %autopatch: Fix patch number parameters
Those where not converted to integers for to lookup though not converted
to the actual file name.

Thanks to Vít Ondruch for pointing this out, suggesting the fix and
insisting on a test case!

Resolves: #1766
2021-09-17 09:44:23 +03:00
Panu Matilainen b7f188dd08 Update Doxygen config for 1.9.x to silence deprecation warnings 2021-09-16 09:53:35 +03:00
Ørjan Malde 3237bf9b2e Allow disabling libelf with --enable/--disable-libelf
Signed-off-by: Ørjan Malde <red@foxi.me>
2021-09-14 11:10:44 +02:00
Marek Kulik 50bf7c6336 Fix indentation in brp-compress 2021-09-14 11:06:05 +02:00
Marek Kulik f3f763e54d Fix handling filenames with spaces in brp-compress 2021-09-14 11:06:05 +02:00
Emily ad87ced399 Fix fstat64 handling on macOS with Apple Silicon
The Apple Silicon toolchain removes the *64 stat symbols (deprecated
since 10.6) in favour of their unprefixed form.

This change might not work properly before 10.6, but 10.5 has been out
of support for over a decade, so that hopefully shouldn't be relevant.

Fixes #1752.
2021-09-14 09:08:40 +02:00
Michal Domonkos 949dc7c31a Add support for RPMDBI_BASENAMES on file queries
There are legitimate reasons (such as rhbz#1940895 or the included test)
for wanting the former behavior where all file states were considered in
file queries prior to commit 9ad57bda4a,
so celebrate the tenth anniversary of that commit by adding a CLI switch
(a new package selector --path), as contemplated back then.

Update the man page for --file to reflect it's current behavior and make
--path that more obvious.

Resolves: rhbz#1940895
2021-09-13 16:24:20 +03:00
Michal Domonkos d1aebda010 Add test for file query
This has been missing, so add a simple one.
2021-09-13 16:24:20 +03:00
Panu Matilainen b88f43b9a3 Explicitly protect automatic macros from being redefined and undefined
All current automatic macros are named in a way that do not pass the
name check in validName(), but that's kinda implicit. Specifically
test for ME_AUTO along with ME_BUILTIN.

No functional change due to the implicit protection from the naming.
2021-09-01 10:35:04 +03:00
Panu Matilainen 80ca959e32 Drop arbitrary macro name minimum length limit (RhBug:1994223)
Traditionally rpm has required user defined macro names to be at least
three characters long, but outlaws all sorts of useful names like %cc
for no particularly good reason - on unix a *lot* of commands are two
characters, and then there are programming languages named R and whatnot.
For macros starting with underscore, require one additional character
though so `r` is okay and so is `_r` but plain `_` is not.

The name validation and error reporting is buggy in multiple ways but not
in the mood to chase all those now, this is just the bare minimum change.
2021-09-01 10:35:04 +03:00
Florian Festi fd57fc7162 Don't segfault on missing priority tag
Resolves: #1636
Related: #1638
2021-08-25 13:29:44 +03:00
Gustavo Costa ddb3977a12 Translated using Weblate (Portuguese (Brazil))
Currently translated at 84.5% (749 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 84.1% (746 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/pt_BR/

Translated using Weblate (Portuguese (Brazil))

Currently translated at 79.3% (703 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/pt_BR/
2021-08-18 15:00:54 +03:00
simmon 13a2f87659 Translated using Weblate (Korean)
Currently translated at 100.0% (886 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/ko/
2021-08-18 15:00:54 +03:00
Thierry Vignaud 22cb3b1c41 Translated using Weblate (Breton)
Currently translated at 18.6% (165 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/br/
2021-08-18 15:00:54 +03:00
Jan Kuparinen 3448166612 Translated using Weblate (Finnish)
Currently translated at 84.3% (747 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 81.2% (720 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 81.0% (718 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 78.3% (694 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 77.4% (686 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 74.2% (658 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 72.2% (640 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 70.0% (621 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 69.6% (617 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/
2021-08-18 15:00:54 +03:00
Charles Lee fec7e6e9ac Translated using Weblate (Chinese (Simplified) (zh_CN))
Currently translated at 83.1% (737 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/zh_CN/
2021-08-18 15:00:54 +03:00
Florian Festi 2a03b8fa12 Add dbus-announce plugin
The plugin announces start and end of transactions
2021-08-12 13:42:34 +03:00
Michael Schroeder 297b7be14b ndb: only invalidate the database cache if we must
We now only invalidate the cache if the cached entry gets written
or deleted. This is needed for the code in rpmdbNextIterator()
which first reads the next header and then writes the modified
old header to the database. Therefore we must not free the cached
entry if a modified header with a different id is written.
2021-08-09 10:03:53 +03:00
Peter Pentchev 24b6c45423
Bump the Lua minimum version to 5.3. (#1738)
Bump the Lua minimum version to 5.3.

The 986be669fb commit introduced a use of
lua_rotate(), which is not available in Lua 5.2, unintentionally causing a dependency on 5.3. Rather than work around it, just bump the requirement to 5.3, it's almost seven years old by now...
2021-08-06 09:54:21 +03:00
Florian Festi 3cb4b8b051 Extend CONTRIBUTING.md
Add brief introduction, section about comments and commit messages
Bit more details on code formatting
2021-08-04 14:05:11 +03:00
Demi Marie Obenour 7af8691e58 Add CONTRIBUTING.md 2021-08-04 14:05:11 +03:00
Michal Domonkos cfdb8300f6 Don't brp-strip .ko files
Otherwise SecureBoot signatures may be stripped too.

We used to exclude shared libraries from this strip as they were
supposed to be covered by another brp script (brp-strip-shared), however
it turned out the latter was never really used, so we removed the
exclusion in commit 0ab151ab13.

As it turns out, that was a little too ambitious, since we may now
inadvertently strip SecureBoot signatures from kernel modules too,
provided that they're made during the build, prior to the invocation of
brp-strip.

Note that this regression currently does *not* affect the following two
cases on Fedora/RHEL systems with redhat-rpm-config installed:

  - in-tree kernel modules; these are built from kernel.spec which
    already contains a hack ensuring that module signing only happens
    *after* any stripping (see %__modsign_install_post in kernel.spec)

  - out-of-tree kernel modules built with debuginfo enabled; this is
    because brp-strip is only called when %debug_package is set to
    %{nil}

Any other combinations may be affected, depending on the macros and
.spec files used, so let's fix this by effectively "reverting" said
commit for .ko files only.

Fixes: rhbz#1967291
2021-07-12 13:45:09 +02:00
Daniel Mach 513d04db9f Set an extremely high sqlite3 timeout
We must avoid the "database is locked" errors at every cost because
otherwise the rpmdb gets corrupted and system ends up in inconsistent
state.

Resolves: rhbz#1946046
2021-07-08 11:41:27 +02:00
Peter Pentchev 822c3dc204 Exclude the xlateTags symbol from librpm's public API.
The d6a86b5e69 commit introduced
a new variable that is only used internally by headerMergeLegacySigs().
2021-06-30 10:58:59 +02:00
Michal Domonkos b7a1e99632 Fix memory leaks in Lua rex extension
This covers the following usage:

expr = rex.newPOSIX(<regex>)
expr:match(<string>)           # A leak occurred here
expr:gmatch(<string>, <func>)  # A leak occurred here

Found by Coverity.
2021-06-28 13:22:53 +02:00
Michal Domonkos 590b2fc062 Fix memory leak with multiple %lang-s in one line
We permit two equivalent forms of specifying a list of languages per
file:

  %lang(xx,yy,zz) /path/to/file
  %lang(xx) %lang(yy) %lang(zz) /path/to/file

The leak was when parsing the second form.

Found by Coverity.
2021-06-28 13:22:53 +02:00
Michal Domonkos 9c093c4f09 Fix memory leak in decodePkts()
Found by Coverity.
2021-06-28 13:22:53 +02:00
Michal Domonkos 39b7bf8579 Fix memory leak in fts_build()
Turns out this leak is already fixed in glibc's current version of fts.c
(where our copy originates from), so let's just backport that.

Original commit in glibc:
https://sourceware.org/git/?p=glibc.git;\
a=commit;h=db67c2c98b89a5723af44df54f38b779de8d4a65

Found by Coverity.
2021-06-28 13:22:53 +02:00
Michal Domonkos 3c8b01b67e Fix resource leak in Fts_children()
This function is not used anywhere within our codebase (and neither is
it part of the public API) so it's basically a no-op... Still, rather
than yanking it completely, let's just silence the Coverity error here.

Found by Coverity.
2021-06-28 13:22:53 +02:00
Michal Domonkos 5baf73feb4 Always free the arg list passed to rpmGlob()
Even though the actual implementation of rpmGlob() does not allocate the
passed arg list (av) if the return code (rc) is non-zero or arg count
(ac) is 0, it's the responsibility of the caller (rpmInstall() here) to
free that memory, so make sure we do that irrespectively of the above
conditions.

Found by Coverity.
2021-06-28 13:22:53 +02:00
Michal Domonkos d8dc4fd37b Fix memory leak in sqlexec()
Callers are supposed to free the error strings themselves:
https://www.sqlite.org/capi3ref.html#sqlite3_exec

Found by Coverity.
2021-06-28 13:22:53 +02:00
simmon b79bc6872d Translated using Weblate (Korean)
Currently translated at 100.0% (886 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/ko/
2021-06-28 13:10:38 +02:00
Michal Domonkos c7d7c5acd0 Add quoting to literal curly brackets
These curly brackets are already treated as literals by the shell, so
let's make that explicit for clarity, and silence a ShellCheck warning
at the same time.

More info: https://github.com/koalaman/shellcheck/wiki/SC1083

Found by ShellCheck.
2021-06-28 12:43:27 +02:00
Florian Festi 89eb448b6c Don't depend on translation sub directories
just create them. Otherwise their date messes up the man page
genenration and triggers a rebuild when on wanted (e.g. when building
form the tar ball)

Resolves: #1729
2021-06-23 07:51:51 +03:00
Florian Festi 9772abc058 Also add rendered Japanese man pages 2021-06-23 07:51:51 +03:00
Charalampos Stratakis 2cfd1a1fde Allow /usr/libexec/* rpaths
An RPATH or RUNPATH pointing to directories owned by a package in /usr/libexec/*
is a valid case and should be allowed by the check-rpath script.

Related: #1719
2021-06-22 14:36:35 +03:00
Panu Matilainen d71cfc276d Use a pre-built package for the hardlink test for reproducability
Besides rpm version string length, the file offsets also depend on
at least libmagic version and probably something else I'm missing now,
this is just too fragile to be useful. Use a pre-built package to
avoid delaying 4.17 beta just because of such a dumb thing, figure out
something better later (pre-built is not ideal as inevitably the
pre-built will need to be re-built too and that gets difficult
sometimes)
2021-06-22 13:22:10 +03:00
Panu Matilainen 8e2a488c91 Revert "Make hardlink test independent of rpm version string"
This didn't actually cure the thing it was supposed to, and there are
more factors at play anyhow (libmagic strings and all).

This reverts commit 9db0b6fbc3.
2021-06-22 13:22:10 +03:00
Florian Festi 3fd35871f3 Add generated man pages to tar ball
This requires generating all man pages even those not going to be
installed as their plugin in not going to be built.
As a result building from the tarball should not need pandoc for
generating the man pages.
2021-06-22 12:18:08 +03:00
Florian Festi 3080254024 Create directories for man pages right away
to avoid rebuilding the man pages over and over again
2021-06-22 12:18:08 +03:00
Florian Festi 5417bffe37 check-rpaths: Look for RPATH and RUNPATH in one go
Calculate $lower from the actual match
2021-06-22 09:24:41 +03:00
Florian Festi e2b4fdda31 Don't break readelf output at 80 characters
by adding -W

Related: #1713
2021-06-22 09:24:41 +03:00
Florian Festi 9b94a9a8f1 Run rpath check in parallel
using RPM_BUILD_NCPUS

Related: #1713
2021-06-22 09:24:41 +03:00
Panu Matilainen 9db0b6fbc3 Make hardlink test independent of rpm version string
A nice little WTF this one: changing the version string length affects
the manipulated offsets in the built package. The offsets were done with
the development time 4.16.90 version, but with eg 4.17.0-beta1 the
offsets are different and the test fails.
2021-06-21 15:59:53 +03:00
Oğuz Ersen 5f0a1162e6 Translated using Weblate (Turkish)
Currently translated at 53.3% (473 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/tr/

Translated using Weblate (Turkish)

Currently translated at 50.9% (451 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/tr/
2021-06-21 14:44:57 +03:00
Jan Kuparinen 680087b2cf Translated using Weblate (Finnish)
Currently translated at 69.1% (613 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 67.4% (598 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 67.2% (596 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/

Translated using Weblate (Finnish)

Currently translated at 64.8% (575 of 886 strings)

Translation: rpm/master
Translate-URL: https://translate.fedoraproject.org/projects/rpm/master/fi/
2021-06-21 14:44:57 +03:00
Panu Matilainen 5fc9783372 Bump version to appear newer than 4.17 and begin another cycle 2021-06-21 14:42:42 +03:00
Panu Matilainen 4e688653df Bump libtool version info in preparation of 4.17.x branch
We've only added APIs so no soname bump required.
2021-06-21 14:42:42 +03:00
Demi Marie Obenour 56917aaffe Make a bounds check easier to read
The undefined behavior is not an issue on modern GCC, but the new code
is easier to read.
2021-06-21 14:42:13 +03:00
Demi Marie Obenour 1dc59e028c Use a variable for h + hlen
instead of recomputing it four places.
2021-06-21 13:31:34 +03:00