Commit Graph

300 Commits

Author SHA1 Message Date
c4a3fcd4ca Cleanup previous commit 2012-08-16 23:16:57 +00:00
Igor Vlasenko
f1e0f83d55 build/parsePrep.c: %patch -F, -d options and macros (ALT#27627)
Backport from rpm 4.10:
%patch -F <fuzz>
%patch -d <destdir>
support for macros:
%{_default_patch_fuzz}  Default fuzz level for %patch in spec file.
%{_default_patch_flags} Default patch flags
2012-08-16 22:57:17 +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
12538e4010 parseSpec: use getline() to fix long line processing
* build/rpmspec.h (OpenFileInfo): Change readBuf to a pointer,
add readBufSize.
(freeOpenFileInfo): New prototype.
* build/spec.c (freeSpec): Initialize readBuf and readBufSize.
(freeOpenFileInfo): New function.
* build/parseSpec.c (readLine): Use getline and freeOpenFileInfo.
(closeSpec): Use freeOpenFileInfo.
2012-03-19 19:02:25 +00:00
e870902a7b build: make size of line buffer for .spec parsing configurable via %_spec_line_buffer_size
Based on http://rpm5.org/cvs/chngview?cn=9215

In the meantime, decrease this default line buffer size from 80K to 64K.
2012-03-19 01:29:03 +00:00
a470a11bac parseSpec: enhance line buffer overflow diagnostics 2012-03-19 18:18:03 +00:00
060fd2e340 parseSpec: implement line buffer overflow protection
* build/parseSpec.c (copyNextLine): Protect spec->lbuf line buffer
from overflow.
2012-03-19 01:13:13 +00:00
2aa342e60b rpmbuild: add "-bt" %check-only option 2011-12-06 16:25:14 +00:00
Alexey Tourbin
f491d6e6c4 build/files.c: fixed SIGPIPE to avoid "broken pipe" messages in scripts
SIGPIPE SIG_IGN handler was installed before the fork, which means that,
in autodep scripts, SIGPIPE was ignored as well.  This is why in
commands like

	cmd1 | cmd2

cmd1 was not killed graceully with SIGPIPE, but instead writing to cmd2
resulted in EPIPE.  For which some commands apparently were not ready.

This fixes messages like
/usr/lib/rpm/files.req: line 33: echo: write error: Broken pipe
2011-10-03 06:11:54 +04:00
Igor Vlasenko
c9505d67b9 build.c,parsePrep.c: quoted buildSubdir, to allow spaces. 2011-08-06 18:38:30 +03:00
0358825884 pruneRDeps1: fix check for cycles
The check for cycles introduced in 4.0.4-alt100.17-6-ga71e004 appeared
to be incomplete.  For example, it fails to recognize a cycle in the
following example:

%package -n test
Requires: libtest = %version-%release

%package -n libtest
Requires: libtest-common = %version-%release

%package -n libtest-common
Requires: libtest = %version-%release
2011-03-14 02:27:17 +00:00
37ca0532c0 addReqProv: fix optimization of subpackage self-requirements
Optimization of subpackage self-requirements never worked before because
version-release is normally not defined for subpackages at parse time.
2011-03-14 01:49:42 +00:00
Alexey Tourbin
57ecc37f6f build/files.c: fixed RPMTAG_SIZE for src.rpm packages 2011-02-09 14:15:54 +03:00
Alexey Tourbin
d5b1a5e2f2 build/interdep.c: missing alFree 2011-02-08 08:28:24 +03:00
Alexey Tourbin
7891bc3a46 build/interdep.c: diagnose non-strict dependencies between subpackages
warning: util-linux: non-strict dependency on libblkid
warning: util-linux: non-strict dependency on libuuid
warning: util-linux: non-strict dependency on libmount
warning: mount: non-strict dependency on libblkid
warning: cfdisk: non-strict dependency on libblkid
warning: fdisk: non-strict dependency on libblkid
warning: libblkid: non-strict dependency on libuuid
warning: libblkid-devel: non-strict dependency on libuuid-devel
warning: libmount-devel: non-strict dependency on libblkid-devel
warning: util-linux-debuginfo: non-strict dependency on libblkid-debuginfo
warning: util-linux-debuginfo: non-strict dependency on libuuid-debuginfo
warning: util-linux-debuginfo: non-strict dependency on libmount-debuginfo
warning: mount-debuginfo: non-strict dependency on libblkid-debuginfo
warning: cfdisk-debuginfo: non-strict dependency on libblkid-debuginfo
warning: fdisk-debuginfo: non-strict dependency on libblkid-debuginfo
warning: libblkid-debuginfo: non-strict dependency on libuuid-debuginfo

Note that the right time for this check is after strict dependencies
are propagated, and also after debuginfo dependencies have been lifted.
2011-02-08 07:19:01 +03:00
Alexey Tourbin
d92517ed56 build/interdep.c: diagnose mssing Epoch in subpackage dependencies
warning: libX11-devel: dependency on libX11 needs Epoch
warning: libX11: dependency on libX11-locales needs Epoch
2011-02-08 05:21:38 +03:00
Alexey Tourbin
a71e004bdf build/interdep.c: cycles must not be pruned completely
%package -n test
Requires: libtest = %version-%release
Requires: libtest-common = %version-%release

%package -n libtest
Requires: libtest-common = %version-%release

%package -n libtest-common
Requires: libtest = %version-%release

Here libtest and libtest-common make a cycle, and the "test" package
requires a cycle.  Naiive optimization against a cycle can simply
wipe out all dependencies: the dependency on libtest-common will be
optimized out, because libtest-common is already required by libtest;
likewise, the dependency on libtest will be optimized out, because
libtest is already required required by libtest-common.
2011-02-07 07:38:04 +03:00
Alexey Tourbin
e9d4612abe build/interdep.c: recognize %_deps_optimization
%_deps_optimization is now treated as optimization level 0, 1, or 2
(the default is 2).  Level 1 will make single-package optimizations.
Level 2 will additionally optimize dependencies between subpackages.
2011-02-07 06:26:02 +03:00
Alexey Tourbin
f5ed7f870a build/interdep.c: prune already required deps between dependent subpackages 2011-02-07 06:03:02 +03:00
Alexey Tourbin
705b043ac2 build/reqprov.c, rpmbuild.h: export compare_deps() 2011-02-07 04:28:18 +03:00
Alexey Tourbin
856fad26a6 build/checkFiles.c: disable intersection check for /usr/src/debug
Though the intersection check can be useful even for /usr/src/debug
(it indicates binary code duplication and/or poor dependencies between
subpackages), it is too noisy and can eat up quite a bit of output.
The same information is still available directly within the packages
or via contents_index.
2011-02-05 23:54:19 +03:00
Alexey Tourbin
a7b7111110 build/files.c (processBinaryFiles): fixed return after find-requires failure 2011-02-05 09:22:40 +03:00
Alexey Tourbin
8d0056fd39 build/interdep.c: also prune rpmlib(SetVersions) dependency 2011-02-05 07:25:46 +03:00
Alexey Tourbin
e061586385 build/files.c (finalizePkg): calculate RPMTAG_SIZE after optimizations
Note that checkHardLinks function is now removed.  It was unclear
whether it was supposed to verify %lang attributes (returning non-zero
on error) or indicate if all hardlinks are packaged within the package.

It turns out that only a single package in our repo has
PartialHardlinkSets dependency:

$ cd /ALT/Sisyphus/files/x86_64/RPMS/
$ rpm -qp --qf '[%{NAME}\t%{REQUIRENAME}\n]' *.rpm |fgrep 'PartialHardlinkSets'
$ cd /ALT/Sisyphus/files/noarch/RPMS/
$ rpm -qp --qf '[%{NAME}\t%{REQUIRENAME}\n]' *.rpm |fgrep 'PartialHardlinkSets'
freeciv-common  rpmlib(PartialHardlinkSets)
$

This probably means that freeciv-common has hardlinks with different
%lang attributes (which probably was supposed to be an error).  So
the whole issue should be reconsidered.  A leave XXX marks in the
code and suggest new PartialHardlinkSets implementation (however,
the dependency is not being added yet).
2011-02-05 03:49:54 +03:00
Alexey Tourbin
a6c78a83c9 build/interdep.c: prune extra deps between dependent subpackages
When pkg1 has strict dependency on pkg2, all other non-strict/virtual
dependencies on pkg2 will be reaped off pkg1.  Note that the are subtle
cases: though I try to make something about merging dependency flags,
it is not always possible, as the dependency on pkg2 can be obtained
via a transitive chain.  I see this being a non-critical issue which
is worthwhile to be mentioned.
2011-02-05 01:26:16 +03:00
Alexey Tourbin
e81ad7e376 build/interdep.c (liftDebuginfoDeps): social lift for debuginfo
Basically, if pkg1 has strict dependency on pkg2, the question
is whether pkg1-debuginfo should possess a strict dependency on
pkg2-debuginfo.  The answer is "yes" provided that pkg1-debuginfo
is already dependent on pkg2-debuginfo (i.e. has new soname-based
debuginfo dependencies resolved to pkg2-debuginfo).  This provides
an opportunity for dependency optimization between dependend
debuginfo subpackages.
2011-02-04 23:45:01 +03:00
Alexey Tourbin
43261c6111 build/interdep.c (processDependentDebuginfo): factored from pruneDebuginfoSrc 2011-02-04 02:56:14 +03:00
Alexey Tourbin
83147e6c03 implemented debuginfo.req and debuginfo.prov 2011-02-04 02:55:25 +03:00
Alexey Tourbin
140d6de605 build/interdep.c: do not propagate self-Requires 2011-02-03 23:10:49 +03:00
Alexey Tourbin
61736ed63a build/pack.c: recognize %_debuginfo_payload macro 2011-02-03 09:33:28 +03:00
Alexey Tourbin
2e38d0ef4c build/interdep.c: prune debuginfo src dups, Vierter und letzter Theil 2011-01-31 06:22:29 +03:00
Alexey Tourbin
31fc3dcd6f build/interdep.c: prune debuginfo src dups, part 3 - directories 2011-01-31 06:22:28 +03:00
Alexey Tourbin
c7567ffb9a build/interdep.c: prune debuginfo src dups, part 2
The output now is like this:
removing 12 sources from rpm-debuginfo and adding dependency on librpm-debuginfo
removing 11 sources from rpm-debuginfo and adding dependency on librpmbuild-debuginfo
removing 13 sources from rpm-build-debuginfo and adding dependency on rpm-debuginfo
removing 14 sources from rpm-static-debuginfo and adding dependency on rpm-debuginfo
removing 20 sources from librpmbuild-debuginfo and adding dependency on librpm-debuginfo
removing 13 sources from rpm-build-debuginfo and adding dependency on librpm-debuginfo
removing 80 sources from rpm-static-debuginfo and adding dependency on librpm-debuginfo
removing 12 sources from python-module-rpm-debuginfo and adding dependency on librpm-debuginfo
removing 12 sources from rpm-build-debuginfo and adding dependency on librpmbuild-debuginfo
removing 35 sources from rpm-static-debuginfo and adding dependency on librpmbuild-debuginfo
2011-01-31 06:22:25 +03:00
Alexey Tourbin
e00c43536c build/interdep.c: prune debuginfo src dups, part 1
The output is like this:
remove sources from rpm-debuginfo because it requires librpm-debuginfo
remove sources from rpm-debuginfo because it requires librpmbuild-debuginfo
remove sources from rpm-build-debuginfo because it requires rpm-debuginfo
remove sources from rpm-static-debuginfo because it requires rpm-debuginfo
remove sources from librpmbuild-debuginfo because it requires librpm-debuginfo
remove sources from rpm-build-debuginfo because it requires librpm-debuginfo
remove sources from rpm-static-debuginfo because it requires librpm-debuginfo
remove sources from python-module-rpm-debuginfo because it requires librpm-debuginfo
remove sources from rpm-build-debuginfo because it requires librpmbuild-debuginfo
remove sources from rpm-static-debuginfo because it requires librpmbuild-debuginfo
2011-01-31 06:22:11 +03:00
Alexey Tourbin
2213cb3f56 build/interdep.c: propagate dependencies 2011-01-31 04:54:22 +03:00
Alexey Tourbin
2c673900ce build/interdep.c: initial revision 2011-01-31 04:53:26 +03:00
Alexey Tourbin
818e61d012 build/files.c (makeDebugInfo): implemented automatic *-debuginfo packages 2011-01-31 03:23:32 +03:00
Alexey Tourbin
2c2529cf98 build/files.c (runPkgScript): new helper function for autodep-like scripts 2011-01-31 03:02:36 +03:00
Alexey Tourbin
dfbf1203ee build/checkFiles.c: skip /usr/lib/debug and /usr/src/debug for now 2011-01-30 03:56:47 +03:00
Alexey Tourbin
a3ba18acbf build/checkFiles.c: avoid fts warning for no buildroot 2011-01-23 02:31:00 +03:00
Alexey Tourbin
5a1601ed3d build/checkFiles.c: fixed %exclude vs unpackaged regression 2011-01-21 20:48:10 +03:00
Alexey Tourbin
e80861fd52 4.0.4-alt100.11
- build/files.c (addFile): Replaced myftw() with fts(3).
- build/checkFiles.c: Reimplemented check for unpackaged files using fts(3).
- python: Backported forceArray changes from rpm5.org (Alexander Myltsev).
2011-01-16 10:26:25 +03:00
Alexey Tourbin
252c8b7aed build/checkFiles.c: reimplemented checkIntersect() using fiIntersect() 2011-01-15 11:49:07 +03:00
Alexey Tourbin
d3c57d3ee4 build/checkFiles.c: reimplemented checkFiles() using fts(3) 2011-01-15 11:48:33 +03:00
Alexey Tourbin
6528547c06 build/files.c: warn on fts error 2011-01-15 10:58:11 +03:00
Alexey Tourbin
324d08015d build/files.c (addFile): factored addFile1 to save lstat calls
When addFile() is called with file path obtained from specfile,
various checks must be performed, so that only valid paths can
enter the package.  However, when a path is passed down to fts,
it is no longer possible to obtain ill-formed paths.  So a lot
of lstat calls for intermediate path components can be saved.
2011-01-15 10:36:01 +03:00
Alexey Tourbin
161864908a build/files.c (addFile): replaced myftw() with fts(3) 2011-01-15 10:35:58 +03:00
Alexey Tourbin
d3842e8715 build/files.c (addFile): updated from rpm.org 2011-01-15 10:35:18 +03:00
Alexey Tourbin
592b51b3a3 build/files.c: removed ancient fl->prefix stuff 2011-01-14 22:11:52 +03:00
Alexey Tourbin
00ec5a8146 build/files.c: removed obsolete parseForRegexLang 2011-01-14 21:51:45 +03:00
16213bfa27 Link librpmbuild with librpmio, librpmdb, and libpopt 2010-10-20 09:08:22 +00:00
Alexey Tourbin
146732d397 build/reqprov.c: handle set-versions properly 2010-10-04 02:11:25 +04:00
Alexey Tourbin
e1f0ef1fe5 build/parseReqs.c: make dependencies on rpmlib(SetVersions) feature 2010-10-04 01:20:22 +04:00
cb105c88c8 build/files.c (parseForSimple): Fix potential NULL pointer dereference (ALT#23813) 2010-07-27 18:12:41 +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
Alexey Tourbin
58fdd159bc build/files.c (checkHdrIntersect): avoid quadratic behaviour
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.
2010-03-26 19:00:43 +03:00
Alexey Tourbin
4c4d73c44e 4.0.4-alt98.21
- rpmio, rpmbuild: Added support for .xz/.lzma compressed sources and patches.
- Removed old scripts in /usr/lib/rpm.
2009-09-29 16:38:57 +04:00
Alexey Tourbin
f68c71a2d5 4.0.4-alt97.M50.18
- rpmio, rpmbuild: Added support for .xz/.lzma compressed sources and patches.
- Removed old scripts in /usr/lib/rpm.
2009-09-29 16:30:39 +04:00
Alexey Tourbin
1ccf0dd03c 4.0.4-alt95.M41.28
- rpmio, rpmbuild: Added support for .xz/.lzma compressed sources and patches.
- Removed old scripts in /usr/lib/rpm.
2009-09-29 16:20:33 +04:00
Alexey Tourbin
6795a36bb1 great removal 2009-09-29 15:29:52 +04:00
Alexey Tourbin
19e6de9d5e added support for .xz/.lzma compressed sources and patches
This also fixes some bugs:
- %uncompress macro never worked;
- %patch -s -b .orig never worked.
2009-09-29 14:18:01 +04:00
Alexey Tourbin
0eb07b8c21 4.0.4-alt95.M41.27
- build/parsePrep.c (doUntar): Remove "-L" option from "unzip" invocation
  (Igor Vlasenko; closes: ALT#17407).
2009-09-29 12:09:31 +04:00
Igor Vlasenko
4e4aa34d9d build/parsePrep.c (doUntar): Remove "-L" option from "unzip" invocation
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)
2009-09-29 09:09:08 +04:00
Alexey Tourbin
295cc50be1 4.0.4-alt98.19
- rpmio: Updated lzma compression routines for xz-5.0 API.
- Packaged /usr/bin/rpm2cpio.static.
2009-09-24 12:49:32 +04:00
Alexey Tourbin
79be480d0e 4.0.4-alt97.M50.16
- rpmio: Updated lzma compression routines for xz-5.0 API.
- Packaged /usr/bin/rpm2cpio.static.
2009-09-24 12:48:17 +04:00
Alexey Tourbin
776a15f6b8 4.0.4-alt95.M41.25
- rpmio: Updated lzma compression routines for xz-5.0 API.
- Packaged /usr/bin/rpm2cpio.static.
2009-09-24 12:46:31 +04:00
Alexey Tourbin
7407fd6de4 pack.c, rpmlibprov.c: updated for xz compression 2009-09-24 12:35:43 +04:00
91df1fd7c8 build/Makefile.am: Bump librpmbuild soname
%check section support changes constant values and inserts new fields
into public structures.  This ABI change forces library soname change.
2009-09-09 10:40:34 +00:00
41f343617a build/parseSpec.c (tags_common_list): Add "check" 2009-09-08 21:31:52 +00:00
31914b95af Backport %check from rpm-4.2 2009-09-08 20:46:26 +00:00
Alexey Tourbin
31dc64497c 4.0.4-alt97.M50.12
- Removed _noDirTokens support (producing legacy filelist format).
- Disabled rpmlib(PayloadFilesHavePrefix), rpmlib(CompressedFileNames),
  and rpmlib(VersionedDependencies) dependencies.
- Disabled versioning for rpmlib(PayloadIsBzip2) and rpmlib(PayloadIsLzma)
  dependencies.
2009-06-17 06:43:27 +04:00
Alexey Tourbin
fbac8f2ea4 4.0.4-alt95.M41.21
- Removed _noDirTokens support (producing legacy filelist format).
- Disabled rpmlib(PayloadFilesHavePrefix), rpmlib(CompressedFileNames),
  and rpmlib(VersionedDependencies) dependencies.
- Disabled versioning for rpmlib(PayloadIsBzip2) and rpmlib(PayloadIsLzma)
  dependencies.
2009-06-17 06:42:20 +04:00
Alexey Tourbin
2b87185206 pack.c: disabled versioning for rpmlib(PayloadIsBzip2) and rpmlib(PayloadIsLzma) dependencies 2009-06-17 06:34:49 +04:00
Alexey Tourbin
ad02667313 reqprov.c (rpmlibNeedsFeature): allow NULL featureEVR 2009-06-17 06:34:23 +04:00
Alexey Tourbin
9476a4b41a disabled rpmlib(VersionedDependencies) dependencies 2009-06-17 06:32:50 +04:00
Alexey Tourbin
35ca8f78ab disabled rpmlib(PayloadFilesHavePrefix) and rpmlib(CompressedFileNames) dependencies 2009-06-17 06:32:19 +04:00
Alexey Tourbin
23317f11b7 removed _noDirTokens (producing legacy filelist format)
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.
2009-06-17 06:32:18 +04:00
Alexey Tourbin
9889b7db55 build/parseReqs.c: allow versioned path-like dependencies
(cherry picked from commit 3dff3cd285)
2009-06-17 06:30:31 +04: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
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
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
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
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
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
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
Alexey Tourbin
72ad101add 4.0.4-alt113
- 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.
2018-06-26 13:03:42 +03:00
Alexey Tourbin
4d777d01d2 changed a few more vars int -> uint32_t/size_t
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"
2018-06-26 12:42:44 +03:00
Alexey Tourbin
d410a87e93 configure.ac: enabled large-file support
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
2018-06-26 12:42:44 +03:00
Alexey Tourbin
3df35b4d63 build/pack.c: automatically downgrade lzma levels 7-9 on smaller inputs 2018-06-26 12:42:44 +03:00
Alexey Tourbin
d85641818b build/pack.c: pre-calculate cpio archive size, fail gracefully on >= 4G
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.)
2018-06-26 12:42:44 +03:00
Ivan Zakharyaschev
4347c5f9d0 turn on running %%__find_{conflicts,obsoletes} if they are defined 2018-05-23 17:00:54 +03:00
f4d876f935 build/interdep.c: add upgradeInterdep function
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.
2018-04-18 22:51:40 +03:00
7161802b38
respect device ID when remap inodes
The inode collision probably would never have happened (especially in
chroot environment), but this make the code more correct.
2018-03-27 20:37:22 +03:00
d6fec7f8ea genCpioListAndHeader: remap device and inode numbers (ALT#34398)
Inspired by rpm.org commits rpm-4.10.0-beta1~80 and rpm-4.10.0-beta1~67.

Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
2018-01-05 23:20:22 +00:00
a555b44bb5 compare_deps: fix a bug in handling epochs
Fixes: 4.0.4-alt100.63~1
2018-01-05 23:20:22 +00:00
96a5445b98 Drop bzdio support
There is no use in supporting bzip2 compressed payloads in rpmbuild nowadays.
2017-11-20 01:42:20 +00:00