Commit Graph

2184 Commits

Author SHA1 Message Date
Ivan Zakharyaschev
48bd55e50d shell.req: correctly detect #!/bin/env bash (ALT#35376)
The patterns used were OK for the output of "file -NF$'\t'": it would
put a space after the separator (the default separator being ":").
But not for the output of "file -b": we need to pad the result with a
space to use the same patterns.

Putting a space at the beggining is convenient, because it allows to
match independently for "* sh" or "* bash", otherwise "*sh" would
consume "bash", too.

Other uses of "file -b" in scripts/ don't suffer from this problem.
2019-01-31 21:58:32 +03:00
b1264af4f8 4.0.4-alt125
- spec: replaced deprecated PreReq tags with Requires tags.
- Added automatic conversion of deprecated PreReq tags to Requires tags.
- Disallowed extra qualifiers with BuildPreReq tag.
- Disallowed unknown qualifiers with Requires and BuildRequires tags.
- Allowed abbreviated qualifiers with Requires and BuildRequires tags.
- Moved ProvidedSymbols() and SuggestBPP() to separate files.
- lib.prov: Added printing of the number of provided symbols
  and the bpp value for each library.
- lib.req: Updated the list of standard libraries with guaranteed versioning.
- suggest_bpp: Fixed harmless off-by-one error in bpp estimation.
2019-01-20 23:40:39 +00:00
dc293615c9 spec: replace deprecated PreReq tags with Requires 2019-01-20 23:40:39 +00:00
0ea2deffe3 suggest_bpp: fix harmless off-by-one error in bpp estimation
Give detailed explanation of the formulae which makes the mistake obvious.

Also rewrite suggest_bpp from perl to C.
2019-01-20 23:40:39 +00:00
132ca8f9e1 lib.req: update the list of standard libraries with guaranteed versioning
Add more libraries from glibc:
libresolv, libmvec, librt, libutil, and libanl.
2019-01-14 20:56:55 +00:00
92f91356e0 lib.prov: print the number of provided symbols and the bpp value for each library 2019-01-14 20:56:55 +00:00
2107482334 scripts: move ProvidedSymbols() and SuggestBPP() to separate files
ProvidedSymbols() used to be defined both in lib.prov.in and lib.req.in,
fix this code duplication by moving ProvidedSymbols() to separate
provided_symbols executable script.

Likewise, SuggestBPP() used to be defined both in lib.prov.in and
lib.req.in, fix this code duplication by moving SuggestBPP() to separate
suggest_bpp executable script.
2019-01-14 20:56:55 +00:00
c5d7a2ddf2 Remove isLegacyPreReq() checks from compare_deps() and addReqProv()
Since we no longer use legacy PreReq tags, all calls to isLegacyPreReq()
can be safely removed.
2019-01-14 20:56:55 +00:00
efc8d3637c Drop %__find_prereq support
It has never been used anyway, and now it stands in the way of replacing
deprecated PreReq with Requires(pre,postun).
2019-01-14 20:56:55 +00:00
e05c6cf019 Map deprecated PreReq tags to Requires
Convert PreReq tags without qualifiers into Requires(pre,postun)
and PreReq tags with qualifiers into Requires tags with those qualifiers.

This matches compare_deps() behaviour and opens the way
for additional optimizations of dependencies.
2019-01-14 20:56:55 +00:00
f7280d8302 parseBits: disallow unknown qualifiers, allow abbreviated qualifiers
Before this change unknown qualifiers were silently ignored if they
happened to be the last or the only qualifier, e.g. Requires(trash) or
Requires(pre,trash) were accepted but Requires(trash,post) were not.
Now all unknown qualifiers are treated as errors.

Before this change abbreviated qualifiers like BuildRequires(pre)
were silently ignored as unknown, now unambiguously abbreviated qualifiers
are handled like non-abbreviated.
2019-01-14 20:56:55 +00:00
e612cf937e handlePreambleTag: disallow extra qualifiers with BuildPreReq
Extra qualifiers (prep, build, install, clean) used to be allowed
but useless with BuildPreReq.
2019-01-14 20:56:55 +00:00
Panu Matilainen
31d64932f7 "prereq" is not a valid qualifier to regular Requires
(cherry picked from commit cce0fb4387089db4b860a042bf0a163fd3ea7b6f)
2012-08-07 05:24:57 +00:00
Panu Matilainen
e7b0e4fa4e Oops, being a bit too strict on dependency qualifiers
Forgot how nasty hack parseBits() was... its abusing multilang
support and the multilang support passes "C" if no lang is specified,
which certainly isn't a valid qualifier. Make multilang vs tag with
optional qualifiers different types in PreambleRec, which allows
handling this more sanely.

(cherry picked from commit dbec3664232852425d9e966058cb02e6c5f6689c)
2010-03-29 06:35:25 +00:00
Panu Matilainen
94ea8d6916 Always initialize tagflags to RPMSENSE_ANY
(cherry picked from commit 1ab0222b032d510f331cefa83fb0172673f89083)
2010-03-29 05:27:35 +00:00
Panu Matilainen
6d9d4fed64 Generate preamble tag lengths at build time and make it const
(cherry picked from commit 317533ce3134d05fc9f30fb29238d3fb2ed4bc6b)
2009-06-01 11:45:44 +00:00
a5760b4e0e 4.0.4-alt124
- addReqProv: fixed too aggressive merge of PreReqs introduced
  in 4.0.4-alt122.
- Applied llvm changes (by lakostis@; closes: #34671):
  + cpp.req: skip cpp checks for llvm;
  + verify-elf: bypass lint checks by request.
2019-01-14 00:32:44 +00:00
df7b7503b8 addReqProv: do not merge PreReqs with incompatible requirements
PreReqs differ from regular requirements, they need special treatment.
Also do not add RPMSENSE_FIND_REQUIRES unnecessarily.

Fixes: 4.0.4-alt122~2 ("addReqProv: implement dep flags merge")
2019-01-13 22:39:58 +00:00
Konstantin A. Lepikhov
d093bb9f0d cpp.req: skip cpp checks for llvm
Skip any cpp checks for llvm packages, anyway we don't know how to deal
with them.

Signed-off-by: Konstantin A. Lepikhov <lakostis@altlinux.ru>
2019-01-13 22:39:58 +00:00
Konstantin A. Lepikhov
169f3ece9a verify-elf: bypass lint checks by request
lld linked binaries differ by structure from GNU ld, so eu-lint will
always complaint about.  Allow to skip those checks by passing
%set_verify_elf_method lint=(skip|no)

Signed-off-by: Konstantin A. Lepikhov <lakostis@altlinux.ru>
2019-01-13 22:39:58 +00:00
dec047fee1 4.0.4-alt123
- Dropped %_allow_deps_with_beginning_dot support
  (introduced in 4.0.4-alt119).
2019-01-10 23:20:03 +00:00
f438f6b5df Revert "Add macro to allow dependencies beginning with a dot character in spec file"
These odd dependencies are no longer generated.

This reverts commit 443060d11a.
2019-01-10 23:20:03 +00:00
41f81eaa9c 4.0.4-alt122
- Dropped $RPM_STRICT_INTERDEPS support
  (introduced in 4.0.4-alt110).
- Made name, version, release, and disttag check stricter
  (by vseleznv@ and me).
- Changed the generator of package self-provides
  and the generator of strict intersubpackage dependencies
  to use [E:]V-R[:D] format instead of [E:]V-R
  (by vseleznv@ and me).
- addReqProv: implemented dep flags merge:
  when a stronger requirement is added while a weaker one already exists
  with incompatible flags, try to merge these flags to produce a new
  stronger requirement.  For example,
  "PreReq: %name = %version" + "Requires: %name = %version-%release"
  now results to "PreReq: %name = %version-%release".
2019-01-10 23:20:03 +00:00
b6be32e87e spec: downgrade "PreReq: librpmbuild = %version-%release" to Requires
as there seems to be no reason to use PreReq here.
2019-01-10 23:20:03 +00:00
bb2ead6131 addReqProv: implement dep flags merge
When a stronger requirement is added while a weaker one already exists
with incompatible flags, try to merge these flags to produce a new
stronger requirement.

For example,
"PreReq: %name = %version" + "Requires: %name = %version-%release"
now results to "PreReq: %name = %version-%release", and
"PreReq: %name = %EVR" + "Requires: %name = %EVRD"
now results to "PreReq: %name = %EVRD".
2019-01-10 23:20:03 +00:00
dfa67f87c4 Generate strict intersubpackage dependencies in [E:]V-R[:D] format
* build/interdep.c: Generate new strict intersubpackage dependencies.
* build/reqprov.c (compare_deps): Make EVRs with DistTag stronger.
* rpmdb/legacy.c (providePackageNVR): Package provides [E]V-R[:D],
refactor and clean code up.

[ldv: Rewritten]
2019-01-10 23:20:03 +00:00
3cb012d5c3 Introduce headerNVRD()
It's similar to headerNVR() but also returns disttag.
2019-01-10 23:20:03 +00:00
9618b8946f Introduce parseEVRD()
It's similar to parseEVR() but also returns disttag.
2019-01-10 23:20:03 +00:00
fa25b864cd Revert "build/interdep.c: add upgradeInterdep function"
This kind of interpackage dependencies appeared to be problematic.

This reverts commit f4d876f935.
2019-01-10 23:20:03 +00:00
75893575d7 build/parsePreamble.c: backport rpmCharCheck() from rpm-4.13.0.1-release
Backport rpmCharCheck() from rpm-4.13.0.1-release, replace rasprintf()
and risalnum() with asprintf() and isalnum() respectively, check
VERSION and RELEASE tags against whitelisted characters.  The whitelist
only contains all alphanumeric symbols as well as "._+" symbols.

[ldv:
 Rewritten, all code from rpm is terrible.
 Extended to NAME and DISTTAG.]
2019-01-10 23:20:03 +00:00
e048944ef8 Use xasprintf 2019-01-10 23:20:03 +00:00
5e8afe3990 Introduce xasprintf
As asprintf() tends to be used without proper error checking,
introduce xasprintf() that does the necessary error checking itself.
2019-01-10 23:20:03 +00:00
db62fbdc5a tools: build dump_ld_config and filesize with -D_FILE_OFFSET_BITS=64
... because they use stat().
2019-01-10 23:20:03 +00:00
17184e3759 4.0.4-alt121
- verify-elf: disabled stack verification and elflint on RISC-V (arei@).
- platform.in: removed harmless bash4 noise from %filter_from_* macros
  (closes: #35803).
2018-12-21 03:20:01 +00:00
133654713d platform.in: remove harmless bash4 noise from %filter_from_* macros (ALT#35803) 2018-12-21 03:20:01 +00:00
Nikita Ermakov (0x90)
835d775268 Disable stack verification and elflint on RISC-V 2018-12-20 11:46:01 +00:00
95a1edd1ce 4.0.4-alt120
- lib.prov, lib.req: enhanced ProvidedSymbols (glebfm@ and me).
- Added ppc64le support (glebfm@).
2018-12-16 23:44:22 +00:00
Gleb Fotengauer-Malinovskiy
4f4a1d1465 lib.prov, lib.req: enhance ProvidedSymbols
This enhances ProvidedSymbols() in two ways:
* fixes st_shndx check for the case when it is not $7 in
"readelf --wide --dyn-syms" output as it happens on some architectures
like ppc64le;
* filters out special symbols (__bss_start, _edata, _end, _fini, _init)
after stripping of versioning.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-12-16 23:09:47 +00:00
Gleb Fotengauer-Malinovskiy
3081d856c6 Add ppc64le support 2018-12-04 14:52:42 +03:00
Gleb Fotengauer-Malinovskiy
aa125cd61d 4.0.4-alt119
- Add _allow_deps_with_beginning_dot macro to allow dependencies
  beginning with a dot character (such as ones generated by replaceDeps
  function) in spec file (vseleznv@).
2018-10-03 14:41:25 +03:00
443060d11a Add macro to allow dependencies beginning with a dot character in spec file
After commit f4d876f93 rpm-build may generate dependencies beginning
with a dot character, but spec parser refuses such dependencies.
rpmrebuild fails to rebuild packages with such dependencies because it
builds packages with rpmbuild from generated spec files.
2018-10-03 14:33:17 +03:00
a2f575f8e4 4.0.4-alt118
- Added support for RPM_ADD_CHANGELOG_{NAME,TEXT,TIME} environment variables.
2018-09-24 18:07:32 +03:00
d831a6ed9a Add support for $RPM_ADD_CHANGELOG_{NAME,TEXT,TIME}
If all these environment variables are set, an entry based on their
contents is added to the changelog of source and all binary packages.
2018-09-24 18:07:32 +03:00
9d1b68fa8e 4.0.4-alt117
- 0common-files.req.list: removed /etc/syslog.d/.
2018-08-28 18:05:40 +00:00
6feb190125 0common-files.req.list: remove /etc/syslog.d
Since /etc/syslog.d has been moved from syslog-common to filesystem,
there is no need to keep /etc/syslog.d in the list.
2018-08-28 18:05:40 +00:00
f5ef46abda 4.0.4-alt116
- Removed alternatives from requirements.
2018-07-26 15:10:02 +00:00
Gleb Fotengauer-Malinovskiy
9d1cffa66c 4.0.4-alt115
- rpmrc: added mips64* and mips*r6 support.
- verify-elf: disabled stack verification and elflint on mips* (iv@).
- Fixed installation of platform macros on armh arch.
2018-07-26 18:10:02 +03:00
Ivan A. Melnikov
c038a07d61 Disable stack verification and elflint on mips*
Most of the binaries on mipsel do not contain the stack section,
so this check is not relevant for that architecture. Morover,
it fails, since it can't find the stack section, which is
(rightfully) not present.

eu-elflint does not understand mipsel binaries currently,
so here we disable that check, too.
2018-07-26 17:44:30 +03:00
Gleb Fotengauer-Malinovskiy
f835720d35 rpmrc: аdd mips64* and mips*r6 support 2018-07-26 17:44:30 +03:00
Alexey Tourbin
50f7517a73 4.0.4-alt114
- cpio.c: Fixed the conversion of 8-digit hex file sizes from cpio header.
  Packages with a 2GB+ file should now be installable.
2018-06-30 15:59:44 +03:00