Commit Graph

80 Commits

Author SHA1 Message Date
Alexey Tourbin
a7b7111110 build/files.c (processBinaryFiles): fixed return after find-requires failure 2011-02-05 09:22:40 +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
83147e6c03 implemented debuginfo.req and debuginfo.prov 2011-02-04 02:55:25 +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
5a1601ed3d build/checkFiles.c: fixed %exclude vs unpackaged regression 2011-01-21 20:48:10 +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
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