Commit Graph

15652 Commits

Author SHA1 Message Date
Panu Matilainen ad7b47e43f Add some missing version info for Lua extensions 2021-10-15 11:12:39 +03:00
Florian Festi 9cc5aad54e Require package names to be valid provides
Only allow  alphanumeric or _ as first character.
Also check the name of Obsoletes.

Resolves: #1694
2021-10-14 13:50:52 +03:00
Florian Festi 16ccdb704b Make brp-strip-comment-note multi process
Run at least the file classification in parallel

Resolves: #1230
2021-10-14 13:48:37 +03:00
Panu Matilainen 74ddf22d2e Extend contributing guidelines a bit 2021-10-13 14:19:55 +03:00
Panu Matilainen 5e97c0a3ac Clean up shescape macro implementation
Realizing that we have dynamic string buffer available in the macro
engine... so we don't need a dumb worst case malloc and all the other
crap in the old tag format era implementation.
2021-10-08 14:36:27 +02:00
Florian Festi 470498bd5a Check file iterator for being NULL consistently
No point in allowing NULL only for one of the arguments.

Thanks to ex0z3 (https://github.com/ex0z3) for reporting!

Resolves: #1782
2021-09-28 11:27:56 +02:00
Florian Festi 3161ce3284 Don't strip ELF files with "no machine"
as strip fails on them (if they are Guile object files).
This adds another layer of protection as *.go files are already filtered
out.

Resolves:  #1765
2021-09-28 11:10:33 +02:00
Florian Festi ee5d150aea Don't strip *.go files
as those may be Guile object files. Those are ELF files but cannot be
stripped. This may also exclude other files (like Golang sources) but
that should not be an issue.

Resolves: #1765
2021-09-28 11:10:33 +02:00
Panu Matilainen 04de5e6c85 Use the new shescape macro for :shescape query format too
No functional changes, just remove code duplication.
2021-09-24 14:55:44 +02:00
Panu Matilainen f64ad44ccd Add %{shescape:...} macro for single quoting with escapes for the shell
This is exactly the same as :shescape query format, hence the name.
2021-09-24 14:55:44 +02:00
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