Commit Graph

300 Commits

Author SHA1 Message Date
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
55b07cb0ff Add support for SOURCE_DATE_EPOCH environment variable (ALT#34200)
This allows rpmbuild to override file timestamps.

Based on rpm.org commit 8d84878ee05b2e63858af3a5a49d98e9e2933b1b.
2017-11-15 15:29:28 +00:00
e8c780c2b0 Disable build and install of unpackaged files
These are no longer packaged anyway, so no need to bother.
2017-01-14 13:42:53 +00:00
1ccc182f71 build: rewrite without using nested functions
gcc generates trampolines for pointers to nested functions.
This implies executable stack - the thing we want to avoid.
2015-01-28 17:04:30 +00:00
32171d0cb5 build/reqprov.c (deps_opt_enabled): cleanup 2014-11-19 17:23:34 +00:00
Igor Vlasenko
83f32e64e2 Finer control for %_deps_optimization (ALT#30476)
0: disabled
1: old behaviour with %_deps_optimization=0
2: old behaviour with %_deps_optimization=1
3: old behaviour with %_deps_optimization=2
2014-11-19 17:22:58 +00:00
Gleb Fotengauer-Malinovskiy
4ebe39ba25 Backport Disttag: syntax to spec file parser and header content.
Original commit by jbj@ (10336f1):
- add Disttag: syntax to spec file parser and header
content.
2014-06-24 19:00:52 +04:00
4e5557519f build/parseSpec.c (parseSpec): Drop RPMTAG_PLATFORM support 2009-04-12 23:10:39 +00:00
26545f3846 Drop deprecated RPMTAG_RHNPLATFORM support 2009-04-12 22:39:46 +00:00
Alexey Tourbin
07c1a647d4 4.0.4-alt97.M50.2
- Removed prehistoric multilib support.
2009-03-10 14:39:35 +03:00
Alexey Tourbin
3995f6a271 4.0.4-alt95.M41.14
- Removed prehistoric multilib support.
2009-03-10 14:37:49 +03:00
Alexey Tourbin
aebc9a42dd removed prehistoric multilib support 2009-03-10 14:27:38 +03:00
Alexey Tourbin
82d6fbdfe6 4.0.4-alt95.M41.8
- fixed crash in previous release (Dmitry V. Levin)
2008-11-13 07:12:42 +03:00
3d4f77766e rpmmacro.h (rpmGetPath, rpmExpand): Add __attribute__ ((sentinel))
(cherry picked from commit 328d65def9)
2008-11-13 06:46:42 +03:00
328d65def9 rpmmacro.h (rpmGetPath, rpmExpand): Add __attribute__ ((sentinel)) 2008-11-13 01:46:57 +00:00
Alexey Tourbin
4acd4051a0 4.0.4-alt95.M41.6+
- 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
2008-11-13 00:55:42 +03:00
389d7864cf build/files.c, lib/signature.c: Do not include unused md5.h
(cherry picked from commit fe6df19341)
2008-11-12 05:29:08 +03:00
fe6df19341 build/files.c, lib/signature.c: Do not include unused md5.h 2008-10-20 11:39:45 +00:00
Alexey Tourbin
e4ee0c28f8 4.0.4-alt96.7
- 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)
2008-10-06 10:00:15 +04:00
Igor Vlasenko
01431efc01 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>
2008-10-02 16:01:32 +00:00
Alexey Tourbin
6bb8647870 build/files.c: execute find-requires before find-scriptlet-requires 2008-09-22 18:59:26 +00:00
Alexey Tourbin
0d54c4a6f0 4.0.4-alt95.M41.4+
- build/reqprov.c: when folding duplicate dependencies, Requires(pre)
  or Requires(post) should not opimitze out bare Requires
2008-09-22 18:56:46 +00:00
Alexey Tourbin
f5c325744d reqprov.c: Requires(post) should not optimize out bare Requires
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".
2008-09-22 10:34:53 +00:00
Alexey Tourbin
f444e26e8e 4.0.4-alt95.M41.4
- build/spec.c: don't allow multiple definition of PatchX or SourceX
  (Jindrich Novy, rhbz#458261, rhbz#458260)
2008-09-16 11:09:57 +04:00
Panu Matilainen
52f50790ff Add parenthesis to make gcc happy 2008-09-15 14:17:37 +04:00
Jindrich Novy
33a4004746 Don't allow multiple definition of PatchX or SourceX (rhbz#458261, rhbz#458260) 2008-09-15 14:17:34 +04:00
Alexey Tourbin
9b88480ee9 Merge branch 'altlinux-4.0' 2008-06-22 16:20:33 +04:00
Alexey Tourbin
faeab68da2 build/files.c: re-fixed RPMTAG_SIZE calculation (cf. #2634) 2008-06-17 05:56:35 +04:00
Alexey Tourbin
96f8c331e6 Revert "fixed RPMTAG_SIZE calculation"
This reverts commit 62c081a169.
2008-06-17 04:54:46 +04:00
ace47d0fd2 build/parseSpec.c (readLine): Fix chomp in preprocess mode 2008-06-15 08:43:51 +00:00
Alexey Tourbin
70b853bb1f Merge branch 'altlinux-4.0' 2008-06-13 05:29:00 +04:00
Alexey Tourbin
63d7ecd4a7 parseSpec.c: fixed duplicating 'rpmbuild -bE' output (Kirill A. Shutemov, #5662) 2008-06-13 04:29:14 +04:00
Alexey Tourbin
3ad2b101d0 parsePreamble.c, parseSpec.c: allow noarch subpackages
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().
2008-06-13 01:08:51 +04:00
Alexey Tourbin
4a557675fc Merge branch 'altlinux-4.0' 2008-05-30 22:25:55 +04:00
Alexey Tourbin
9814453966 backported LZMA payload compression from SuSE 2008-05-24 13:47:41 +04:00
Alexey Tourbin
3a5f6ded0a build/files.c (isDoc): rewrite 2008-05-13 03:03:26 +04:00
Panu Matilainen
cb7e8900d4 Make docdir checking stricter (rhbz#246819) 2008-05-13 02:51:23 +04:00
Alexey Tourbin
3dff3cd285 build/parseReqs.c: allow versioned path-like dependencies 2008-05-12 22:11:25 +04:00
Alexey Tourbin
cfbf60d59c build/files.c: added /usr/share/gtk-doc/html to hardcoded docDirs list 2008-05-10 04:46:58 +04:00
Alexey Tourbin
3bd864026e build/files.c: check if the same files are packaged into a few subpackages
$ 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
$
2008-03-30 23:58:15 +04:00
Alexey Tourbin
a0e8d41006 Merge branch 'altlinux-4.0' 2008-03-30 03:00:44 +04:00
Alexey Tourbin
0c38145bf9 files.c (addFile): check that each intermediate path component is directory (not symlink)
%install
install -pD /dev/null %buildroot/etc/rc.d/init.d/functions
ln -s rc.d/init.d %buildroot/etc/init.d
%files
/etc/init.d/functions
/etc/init.d

Old behaviour:
lrwxrwxrwx    1 root    root               11 Mar 26 01:15 /etc/init.d -> rc.d/init.d
-rwxr-xr-x    1 root    root                0 Mar 20 18:50 /etc/init.d/functions

New behaviour:
error: File path component must be directory (/tmp/.private/at/test-buildroot/etc/init.d): /tmp/.private/at/test-buildroot/etc/init.d/functions
2008-03-30 01:56:31 +03:00
Alexey Tourbin
14762e9fa9 files.c (addFile): file path must be canonical (new function pathIsCanonical)
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/.*
$
2008-03-30 01:53:27 +03:00
Alexey Tourbin
bbcc1b2fe2 files.c (addFile): reassure that file path starts with '/' 2008-03-25 04:40:21 +03:00
Alexey Tourbin
b842bf5b4a files.c (addFile): file path must match buildroot
Sample %files section:

%files
/../gcc-common-buildroot

Old behaviour:
$ rpm -bb test.spec
...
Wrote: /home/at/RPM/RPMS/athlon/test-1.0-alt1.athlon.rpm
$ rpm -qlvp /home/at/RPM/RPMS/athlon/test-1.0-alt1.athlon.rpm |head
drwxr-xr-x    2 root    root                0 Mar 22 22:20 ldroot
-rw-r--r--    1 root    root               73 Mar 22 22:20 ldroot/.files:gcc-c++-common
-rw-r--r--    1 root    root              508 Mar 22 22:20 ldroot/.files:gcc-common
-rw-r--r--    1 root    root              147 Mar 22 22:20 ldroot/.files:gcc-fortran-common
-rw-r--r--    1 root    root              348 Mar 22 22:20 ldroot/.files:gcc-java-common
-rw-r--r--    1 root    root               66 Mar 22 22:20 ldroot/.files:gcc-treelang-common
-rw-r--r--    1 root    root              117 Mar 22 22:20 ldroot/.files:libgcj-common
-rwxr-xr-x    1 root    root               80 Mar 22 22:20 ldroot/.post:gcc-common
-rwxr-xr-x    1 root    root              124 Mar 22 22:20 ldroot/.preun:gcc-common
drwxr-xr-x    2 root    root                0 Mar 22 22:20 ldroot/etc
$

New behaviour:
$ LD_LIBRARY_PATH=... rpm -bl test.spec
Processing files: test-1.0-alt1
error: File doesn't match buildroot (/tmp/.private/at/test-buildroot): /tmp/.private/at/gcc-common-buildroot

RPM build errors:
    File doesn't match buildroot (/tmp/.private/at/test-buildroot): /tmp/.private/at/gcc-common-buildroot
$
2008-03-25 04:09:52 +03:00
Alexey Tourbin
d1ff200f04 Revert "build/parseScript.c: opitimize out RPMSENSE_INTERP dependencies on /bin/sh"
/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.
2008-03-17 20:58:55 +03:00
63003fbeb9 Fix typos 2008-02-25 20:07:05 +00:00
Alexey Tourbin
5224b77cbd build/parseScript.c: opitimize out RPMSENSE_INTERP dependencies on /bin/sh 2008-02-01 16:07:59 +03:00
Alexey Tourbin
d98ede246c build/files.c: fixed thinko: (pkg->fileList == NULL) means no %files section at all, not empty %files list 2008-01-26 19:26:25 +03:00
Alexey Tourbin
87d7449617 build/files.c: scriptlet dependencies need their flags
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))"'
2008-01-25 23:17:01 +03:00
Alexey Tourbin
4516457883 build/files.c (generateDepends,processBinaryFiles): do %pre/%post/... scriptlet dependencies 2008-01-25 21:27:01 +03:00
Alexey Tourbin
2e8a4a1722 build/files.c: new function hasSomeInstScript(), for diagnostics 2008-01-25 20:49:02 +03:00
Alexey Tourbin
1ceb28dc6e build/files.c: new function saveInstScript(), to find dependencies in %pre/%post/... scriptlets
This is based on the first part of my eariler patch:
https://bugzilla.altlinux.org/show_bug.cgi?id=7409
2008-01-25 20:48:28 +03:00
Alexey Tourbin
8119ee01ac reqprov.c (addReqProv): eliminate dependencies on the package name
perl-base will no longer require 'perl-base >= 1:5.7.3'.
2007-11-23 10:59:39 +03:00
Alexey Tourbin
dee7e797ef reqprov.c (addReqProv): eliminate dependencies on packaged files
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.
2007-11-22 16:48:30 +03:00
Alexey Tourbin
92093bf1f0 reqprov.c (addReqProv): prepare for more self-requires elimination 2007-11-22 15:28:16 +03:00
86ad8ff400 build/expression.c (doPrimary): Read closing parenthesis, patch from Michael Schroeder 2007-02-23 00:05:37 +00:00
5ed9fe36e1 build/parsePrep.c: Change %setup to enable -q option by default, introduce -v option to make %setup as verbose as before this change. 2006-11-19 00:24:59 +00:00
1e771d2a5a build/parsePrep.c: Change %patch to be more verbose by default, introduce -s option to make %patch as silent as before this change (#10261). 2006-11-19 00:21:38 +00:00
bbddd38759 Removed const from getBuildTime(). 2006-05-15 04:54:03 +04:00
df61ee0b9e Include local headers. 2006-05-15 03:26:57 +04:00
8787ee5d55 Fixed "type qualifiers ignored on function return type" issue. 2006-05-15 02:48:59 +04:00
ed45223b24 Ignore RPMTAG_BUILDROOT completely. 2006-04-03 16:41:43 +00:00
f4d4d3fe83 parseSpec: do not delete _target_cpu macro in PART_BUILDARCHITECTURES parser 2006-02-24 02:40:09 +00:00
b397ca0085 Ignore RPMTAG_BUILDROOT completely. 2006-01-11 13:53:32 +00:00
7c858e2594 parseSpec: in preprocess mode, allow undefined macros 2005-10-25 11:01:42 +00:00
c653aa8345 copyNextLine: set rpmSetBuiltinMacroLookupFailedOK for comments 2005-10-12 23:55:57 +00:00
b23ff9b127 implemented rpmSetBuiltinMacroLookupFailedOK 2005-10-12 23:35:17 +00:00
26dfd3df04 revision 2.55
date: 2004/04/08 20:27:53;  author: niemeyer;  state: Exp;  lines: +2 -1
Implemented multiline macro support.
2005-10-10 14:59:14 +00:00
d1c90ba20f revision 2.98
date: 2004/04/08 20:27:53;  author: niemeyer;  state: Exp;  lines: +41 -3
Implemented multiline macro support.
2005-10-10 12:57:57 +00:00
78ab7cf4b4 revision 2.95
date: 2003/05/15 13:53:41;  author: jbj;  state: Exp;  lines: +3 -1
- fix nested %if handling
2005-10-10 12:50:41 +00:00
7668e35c2e added docdir to tags_files_list 2005-10-10 12:26:34 +00:00
45504c22d2 disabled check for undefined macros in %prep, %build, %install and %clean 2005-10-06 21:06:44 +00:00
d04814401c Fixed rpmBuiltinMacroLookup support 2005-10-06 20:31:10 +00:00
019f77ade6 introduced _allow_undefined_macros 2005-10-06 19:15:36 +00:00
35877f4306 fixed spacing 2005-10-06 18:21:40 +00:00
0b1e0e9ee4 Implemented rpmBuiltinMacroLookup support 2005-10-06 18:21:26 +00:00
17dd47e199 fixed rpmExpand() usage in generateDepends()a 2005-10-06 18:20:37 +00:00
c0a2a76a04 fix readLine() usage 2005-10-06 15:24:35 +00:00
9fcb008b58 fixed rpmExpand() usage 2005-10-06 01:21:27 +00:00
a2f087de09 fixed rpmExpand() usage in fillOutMainPackage() 2005-10-05 23:42:30 +00:00
6a14cbc258 fixed rpmExpand usage 2005-09-29 17:10:24 +00:00
4086557633 fixed rpmExpand usage 2005-09-29 16:01:17 +00:00
8fe647ebd6 corrected rpmExpand usage 2005-09-29 15:50:56 +00:00
ce8ad9b9f0 fix rpmExpandNumeric handling 2005-09-29 15:46:13 +00:00
b59b7dcd44 if AutoReq is disabled, do not add automatic interp deps 2005-08-17 13:48:55 +00:00
a90ad7ec38 parseRCPOT: better error reporting 2004-04-25 10:34:53 +00:00
b098983ecf implemented %_deps_optimization support
addReqProv: implemented old "provided requires" optimization
2004-01-29 13:46:42 +00:00
e6100cca84 indent 2004-01-29 12:57:54 +00:00
a56e2cad60 addReqProv: enhanced duplication elimination algorithm 2004-01-27 14:54:15 +00:00
1ab810455b fixes in duplicates detection algorithm 2004-01-27 12:45:26 +00:00
84c595d9ef parseRCPOT: tokens must not contain '%<=>' symbols - it's common error 2004-01-27 10:56:42 +00:00
f3023c5d3b printDepMsg: enhanced output format a bit 2004-01-27 10:53:38 +00:00
aab4974613 duplicates detection algorithm rewritten 2004-01-26 18:01:37 +00:00
383f52a1a0 addReqProv: optimize rpmRangesOverlap call 2004-01-25 22:26:23 +00:00
562bad0363 addReqProv: in RPMTAG_REQUIRENAME checks, allow RPMTAG_REQUIRENAME 2004-01-25 16:17:03 +00:00
627a1f74b4 optimized recent changes 2004-01-25 10:50:18 +00:00
47e6eacc52 addReqProv: do not add provided requires 2004-01-24 23:31:06 +00:00
f34648ca99 indented 2004-01-24 20:16:41 +00:00
7a2a0b3d61 addReqProv: enhanced duplicates detection algorithm 2004-01-24 19:05:04 +00:00
304991a92b parseRCPOT: Tokens must not contain '%' symbol - it's common error 2004-01-24 14:00:51 +00:00