Commit Graph

66 Commits

Author SHA1 Message Date
Alexey Tourbin
00ec5a8146 build/files.c: removed obsolete parseForRegexLang 2011-01-14 21:51:45 +03:00
cb105c88c8 build/files.c (parseForSimple): Fix potential NULL pointer dereference (ALT#23813) 2010-07-27 18:12:41 +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
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
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
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
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
Alexey Tourbin
6bb8647870 build/files.c: execute find-requires before find-scriptlet-requires 2008-09-22 18:59:26 +00: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
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
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
63003fbeb9 Fix typos 2008-02-25 20:07:05 +00: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
17dd47e199 fixed rpmExpand() usage in generateDepends()a 2005-10-06 18:20:37 +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
f3023c5d3b printDepMsg: enhanced output format a bit 2004-01-27 10:53:38 +00:00
592d03045b checkFiles(): be more verbose about command being executed 2003-11-08 23:01:40 +00:00
bbbaae5c81 checkFiles(): use %__spec_autodep_template/%__spec_autodep_post 2003-11-08 22:38:11 +00:00
7fbf427f43 made it compileable 2003-11-08 22:29:43 +00:00
e9567d1274 made it compileable 2003-11-08 22:26:24 +00:00
60e3bed786 checkFiles(): use %__spec_install_template/%__spec_install_post 2003-11-08 22:10:34 +00:00
ad5afe3ba5 fixed error reporting 2003-11-08 21:30:11 +00:00
25d07065d2 checkFiles(): use %{___build_cmd} like in generateDepends() 2003-11-08 21:18:06 +00:00
14a7cd51a4 fixed compilation warning 2003-11-08 20:59:59 +00:00
04408005de spelling fixes 2003-11-08 20:50:58 +00:00
8752de9a5f checkFiles: return OK if no files packaged 2003-11-08 20:36:35 +00:00
721a03b360 made it compileable 2003-11-08 20:21:04 +00:00
fe9941aa17 Backported %%_unpackaged_files_terminate_build support. 2003-11-08 20:03:25 +00:00
62c081a169 fixed RPMTAG_SIZE calculation 2003-09-27 15:26:14 +00:00