IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
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)
Since the list of files is sorted, it is possible to avoid quadratic
behaviour by implementing merge-like intersection.
However note that directory names are not sorted (this is why it is
needed to build full file name for strcmp).
Tested with gnome-icon-themes-oxygen-refit2-2.3-alt1.src.rpm,
3 subpackages each 13-16K files. Old behaviour: 18 seconds,
new behaviour: less than 1 second.
This unzip mode is more compatible with rpm4.4 and rpm5.
Fixes ALT#17407
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
(cherry picked from commit 01431efc01)
Some code (e.g. apt/genpkglist) explicitly relies on the fact that
header file list is represented with baseNames+dirNames+dirIndexes
arrays. Thus, generating legacy headers might have issues, and should
be disabled.
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")
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".
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.]
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.
- Implemented limited support for large files: a 2GB+ file can now be packaged,
but the total size of uncompressed cpio payload is capped at 4 GB.
- Automatically downgrade LZMA compression levels 7-9 -> 6 on small payloads.
This is probably the last change of such kind. There are many other
instances left, and fixing them all is hopeless. On the other hand,
the way mod 2^32 arithmetic works, although technically not always
well defined, is to our advantage. I suggest that only user-visible
discrepancies further be fixed.
The following comparison to st_size looks particularly bad.
The code turns out to be unused!
lib/signature.c:
> verifySizeSignature(const char * datafile, int_32 size, /*@out@*/ char * result)
> [...]
> if (size != st.st_size) {
> sprintf(result, "Header+Archive size mismatch.\n"
This turns out to be a bit easier than I thought yesterday. When mmap
fails in lib/fsm.c, it falls back to file descriptor IO. So by simply
enabling AC_SYS_LARGEFILE, I'm already able to package a 3G file, which
can be written like this:
perl -e 'seek STDOUT,3<<30,0 and print 1 or die' >out
The nearest goal is to be able to package files up to 4G, on both 32-bit
64-bit architectures, provided that cpio payload size also does not
exceed 4G. More specifically, the limit is 2^32-2, while 2^32-1 remains
special (this is not my own invention, I adopt it from rpm.org).
If the limit is exceeded, rpmbuild should fail gracefully instead of
writing malformed packages with truncated integer tags.
(Supporting 4G+ files is a distant goal - neither rpm-4.0 nor apt-rpm
can handle them yet. Besides, it's not clear if producing such big
packages is even a good idea, unless one wishes to package p0rn.)
If RPM_STRICT_INTERDEPS environment variable is set and not empty, this
function replaces every strict requirement on NEVR with
".${RPM_STRICT_INTERDEPS}-NEVR", and adds to every package which
provides NEVR ".${RPM_STRICT_INTERDEPS}-NEVR" provide if some other
package requires this ".${RPM_STRICT_INTERDEPS}-NEVR".
This is needed to able to build a source package to different repo
branches with the same NEVR, and to rebuild the source package as well
with same NEVR within one branch and avoid interdep collisions.
- implemented post-transaction filetriggers, loosely based on filetriggers.patch
from Mandriva Linux (see %_rpmlibdir/posttrans-filetriggers for details)
- implemented %_rpmlibdir/0ldconfig.filetrigger, so that packages with
shared libraries need not to invoke ldconfig(1) in they %%post-scriptlets
- build/reqprov.c: when folding duplicate dependencies, Requires(pre)
or Requires(post) should not opimitze out bare Requires
- build/files.c: execute find-requires before find-scriptlet-requires
- 0common-files.req.list: added /etc/rc.d/init.d (service)
Both "Requires(post): foo" and "Requires: foo" should be kept.
The first dependency is only for %post-script: after the package
is installed, rpm allows to remove "foo" (though apt-get does not).
This is only a quick fix, perhaps the code should be rewritten.
For instance, if with have both "Requires(pre): foo" and
"Requires(post): foo", those can be folded into single
"Requires(pre,post): foo".
Based on rpm5.org code. However, I do not introduce special variables
to distinguish between toplevel package and subpackages -- we can tell
the difference simply by checking if current "pkg" and "spec->packages"
point to the same record (which is toplevel package in the linked list).
This idiom is already used in e.g. parsePreamble().
$ rpm -bl util-linux.spec
...
warning: file /bin/taskset is packaged into both util-linux and schedutils
warning: file /usr/bin/chrt is packaged into both util-linux and schedutils
warning: file /usr/bin/ionice is packaged into both util-linux and schedutils
warning: file /usr/bin/taskset is packaged into both util-linux and schedutils
warning: file /usr/share/man/man1/chrt.1.gz is packaged into both util-linux and schedutils
warning: file /usr/share/man/man1/ionice.1.gz is packaged into both util-linux and schedutils
warning: file /usr/share/man/man1/taskset.1.gz is packaged into both util-linux and schedutils
$
This fixes invalid cpio entries for `/dir/.*' constructs.
Consider this:
%install
install -pD /dev/null %buildroot/root/.bashrc
%files
/root/.*
Old behaviour:
$ rpm -qlvp /home/at/RPM/RPMS/athlon/test-1.0-alt1.athlon.rpm
drwxr-xr-x 2 root root 0 Mar 30 01:47 /root/.
drwxr-xr-x 2 root root 0 Mar 30 01:47 /root/..
drwxr-xr-x 2 root root 0 Mar 30 01:47 /root/../root
-rwxr-xr-x 1 root root 0 Mar 29 16:51 /root/../root/.bashrc
-rwxr-xr-x 1 root root 0 Mar 29 16:51 /root/./.bashrc
-rwxr-xr-x 1 root root 0 Mar 29 16:51 /root/.bashrc
$
New behaviour:
$ LD_LIBRARY_PATH=... rpm -bi test.spec
...
Processing files: test-1.0-alt1
error: File path must be canonical: /root/.
error: File path must be canonical: /root/..
RPM build errors:
File path must be canonical: /root/.
File path must be canonical: /root/..
$
The problem here is that glob(3) `dir/.*' globs both '.' and '..'.
It is not clear whether or not glob(3) should glob '.' and '..'.
$ bash -c 'echo /var/empty/.*'
/var/empty/. /var/empty/..
$ ksh -c 'echo /var/empty/.*'
/var/empty/.*
$
/bin/sh dependency is still there, because scriptlets are written
with "!#/bin/sh" first line, and bulk dependency optimization was
removed. However, having RPMSENSE_INTERP flag is still good idea --
maybe rpm can check that RPMSENSE_INTERP file is actually X_OK
or something.
This reverts commit 5224b77cbd.
When I write e.g. 'Requires(pre): /usr/bin/perl' in specfile,
I get the following flags:
$ perl -le 'printf "%16b\n", 576'
1001000000
$
which is RPMSENSE_PREREQ|RPMSENSE_SCRIPT_PRE.
Before this change, I do not specify what flags were generated
for scriptlet dependencies. After this change, autogenerated
flags for %pre-script are:
$ perl -le 'printf "%16b\n", 16960'
100001001000000
$
which is RPMSENSE_PREREQ|RPMSENSE_SCRIPT_PRE|RPMSENSE_FIND_REQUIRES.
I belive it looks sane now.
PS:
alias rpmdump='perl -MData::Dumper -MRPM::Header -e "print Dumper(RPM::Header->new(@ARGV))"'
Note that this works only for automatic dependencies, because file list
is not ready when specfile dependencies are added. This is okay.
Also note that this will optimize out directory-like dependencies
if the package owns the directory. This is yet okay, but this is
a bit more subtle point.