Commit Graph

955 Commits

Author SHA1 Message Date
3d4f77766e rpmmacro.h (rpmGetPath, rpmExpand): Add __attribute__ ((sentinel))
(cherry picked from commit 328d65def9)
2008-11-13 06:46:42 +03:00
e350f7fcf1 psm.c (saveTriggerFiles): Fix missing sentinel in rpmGetPath() call
(cherry picked from commit dc9343e541)
2008-11-13 03:47:30 +03:00
619c3251eb configure.in: AC_CHECK_HEADERS(locale.h)
(cherry picked from commit a6d12fe94c)
2008-11-13 03:47:28 +03:00
Alexey Tourbin
5b8a602896 4.0.4-alt77.M40.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:54:40 +03:00
Alexey Tourbin
2de9c0ce48 psm.c (psmTriggerPosttrans): try to increase "Running %s" message verbosity (for apt-get) 2008-11-13 00:41:02 +03:00
Alexey Tourbin
764606da7f rpmlibprov.c: added "rpmlib(PosttransFiletriggers)" 2008-11-12 06:02:13 +03:00
Alexey Tourbin
699a24ad65 psm.c (psmTriggerPosttrans): downgrade database lock, for e.g. update-menus 2008-11-12 06:01:08 +03:00
Alexey Tourbin
bffe630760 psm.c (psmTriggerPosttrans): missing sentinel in rpmGetPath() call 2008-11-12 06:00:27 +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
f7593429ff posttrans-filetriggers: minor changes 2008-11-12 05:10:51 +03:00
Alexey Tourbin
bd1897e46c psm.c (psmTriggerPosttrans): do not set RPM_INSTALL_ARG1 and RPM_INSTALL_ARG2 2008-11-12 05:10:51 +03:00
Alexey Tourbin
b97cda599e 0ldconfig.filetrigger: simplified system library check 2008-11-12 05:10:51 +03:00
Alexey Tourbin
a70594a4a3 0ldconfig.filetrigger: execute "/sbin/update_chrooted lib" for /lib and /lib64 2008-11-12 05:10:51 +03:00
Alexey Tourbin
639f3382c9 0ldconfig.filetrigger: new script 2008-11-12 05:10:51 +03:00
Alexey Tourbin
ed6095e54a posttrans-filetriggers: better description 2008-11-12 05:10:11 +03:00
Alexey Tourbin
5fffe7272e psm.c (saveTriggerFiles): don't write filenames with '\n' character 2008-11-12 05:10:11 +03:00
Alexey Tourbin
4ada155008 implemented posttrans filetriggers, vaguely based on Mandriva patch 2008-11-12 05:10:11 +03:00
Alexey Tourbin
0d6020f2bf 4.0.4-alt77.M40.5
- improved install/upgrade package reordering (in tsort algorithm,
  changed "presentation order" to "chainsaw order")
2008-11-10 05:30:09 +03:00
Alexey Tourbin
b8767dceb1 depends.c: disabled tsort presentation order
This should facilitate library upgrades, e.g. glibc-prthread.
Consider that we upgrade gcc-* and glibc-* packages; and glibc
has new subpackage glibc-pthread (with libpthread and librt
shared libraries).

Old order was:
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0   14    0    0  glibc-preinstall-2.8.90-alt3
D:     1    1   21    0    1    glibc-core-2.8.90-alt3
D:     2    1    9    0    2      cpp4.3-4.3.2-alt5
D:     3    1    5    0    2      libgcc4.3-4.3.2-alt5
D:     4    2   13    0    3        glibc-pthread-2.8.90-alt3
D:     5    2   20    0    4          glibc-core-debug-2.8.90-alt3
D:     6    2   17    0    4          glibc-gconv-modules-2.8.90-alt3
D:     7    2   16    0    4          glibc-locales-2.8.90-alt3
D:     8    2   15    0    4          glibc-nss-2.8.90-alt3
D:     9    2   12    0    4          glibc-timezones-2.8.90-alt3
D:    10    2   11    0    4          glibc-utils-2.8.90-alt3
D:    11    2   10    0    5            iconv-2.8.90-alt3
D:    12    8   22    0    6              glibc-2.8.90-alt3
D:    13    4   19    0    7                glibc-devel-2.8.90-alt3
D:    14    1   18    0    8                  glibc-devel-static-2.8.90-alt3
D:    15    4    8    0    8                  gcc4.3-4.3.2-alt5
D:    16    1    4    0    2      libgfortran4.3-4.3.2-alt5
D:    17    2    3    0    3        libgfortran4.3-devel-4.3.2-alt5
D:    18    3    6    0    4          gcc4.3-fortran-4.3.2-alt5
D:    19    2    2    0    3        libstdc++4.3-4.3.2-alt5
D:    20    2    1    0    4          libstdc++4.3-devel-4.3.2-alt5
D: ========== successors only (presentation order)
D:    21    3    7    0    5            gcc4.3-c++-4.3.2-alt5

Note that #succesors value is actually changed using the package index
in the input list of packages (on the command line): earlier packages
have higher values.  This is called "successors from tsort are processed
in presentation order".  E.g. when choosing to upgrade between cpp4.3,
libgcc4.3, and libgfortran4.3, cpp4.3 gets upgraded first.  (The
collation is probably due to using shell glob on the command line.)

The problem is that, in cpp4.3 %post-script, some pthread-dependent
code might be called, and pthread shared library is simply mssing
at that point (after glibc-core upgrade and before glibc-pthread
install).

New order is:
D: ========== tsorting packages (order, #predecessors, #succesors, tree, depth)
D:     0    0    1    0    0  glibc-preinstall-2.8.90-alt3
D:     1    1   17    0    1    glibc-core-2.8.90-alt3
D:     2    1    3    0    2      libgcc4.3-4.3.2-alt5
D:     3    2    8    0    3        glibc-pthread-2.8.90-alt3
D:     4    2    2    0    4          glibc-gconv-modules-2.8.90-alt3
D:     5    2    2    0    4          glibc-nss-2.8.90-alt3
D:     6    2    1    0    5            iconv-2.8.90-alt3
D:     7    2    1    0    4          glibc-locales-2.8.90-alt3
D:     8    2    1    0    4          glibc-timezones-2.8.90-alt3
D:     9    2    1    0    4          glibc-utils-2.8.90-alt3
D:    10    8    1    0    5            glibc-2.8.90-alt3
D:    11    4    4    0    6              glibc-devel-2.8.90-alt3
D:    12    2    1    0    3        libstdc++4.3-4.3.2-alt5
D:    13    2    1    0    4          libstdc++4.3-devel-4.3.2-alt5
D:    14    1    1    0    2      cpp4.3-4.3.2-alt5
D:    15    4    2    0    3        gcc4.3-4.3.2-alt5
D:    16    1    1    0    2      libgfortran4.3-4.3.2-alt5
D:    17    2    1    0    3        libgfortran4.3-devel-4.3.2-alt5
D: ========== successors only (presentation order)
D:    18    2    0    0    4          glibc-core-debug-2.8.90-alt3
D:    19    1    0    0    7                glibc-devel-static-2.8.90-alt3
D:    20    3    0    0    4          gcc4.3-fortran-4.3.2-alt5
D:    21    3    0    0    4          gcc4.3-c++-4.3.2-alt5

Note that #succesors now indicates the number of immediate successors;
libgcc4.3 now has 3 immediate successors (glibc-pthread, gcc4.3, and
libstdc++4.3), while cpp4.3 and libgfortran4.3 have only one immediate
successor.

Also removed tools/rpmsort.c.

> The are various serial representations of a partially ordered set.
>
> The default is what I call "chainsaw", always emit the node that has
> the most children.  The "chainsaw" heuristic tries to emit nodes that
> are depended upon as early as possible to localize interactions
> amongst packages, but really should be
>     Always emit the node of the largest sub-tree.
> rather than the number of immediate children. I call this "buzzsaw".
>
> Anaconda has the constraint of changing cd's during install. So
> "presentation" ordering preserves the arrival ordering into a
> transaction set. Too bad that "presentation" ordering is often
> incorrect because of no loop analysis first.

https://lists.dulug.duke.edu/pipermail/rpm-devel/2005-June/000468.html
2008-11-10 05:21:23 +03:00
Alexey Tourbin
216ac45267 4.0.4-alt77.M40.4
- build/reqprov.c: when folding duplicate dependencies, Requires(pre)
  or Requires(post) should not opimitze out bare Requires
2008-09-22 18:52:58 +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
b81db19611 4.0.4-alt77.M40.3
- build/spec.c: don't allow multiple definition of PatchX or SourceX
  (Jindrich Novy, rhbz#458261, rhbz#458260)
2008-09-16 11:02:21 +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
b1b00af474 4.0.4-alt77.M40.2
- spec: In %post-script, removed /var/cache/apt/*.bin (Alexey Tourbin).
- pdeath_execute.c: Removed X_OK check, use execvp(3) (Alexey Tourbin).
- fixup-libtool, fixup-pkgconfig: Quote substitution text (Closes: #11437).
- build/files.c: Re-fixed RPMTAG_SIZE calculation (Alexey Tourbin. Closes: #2634).
- parseSpec.c: Fixed duplicating 'rpmbuild -bE' output
  (Kirill Shutemov, Alexey Tourbin. Closes: #5662).
- parsePreamble.c, parseSpec.c: Allow noarch subpackages (Alexey Tourbin).
- rpmrc.c: Added more modern CPU models (Alexey Tourbin, me).
- rpmio.c: Implemented cpio hints for rsyncable_gzwrite() (Alexey Tourbin).
- rpmio.c: Deal with partial rsyncable_gzwrite() return (Alexey Tourbin).
- rpmio.c: Implemented rscynable_gzwrite() (Alexey Tourbin).
- rpmio.c: Introduced rpmGZFILE wrapper for gzdio (Alexey Tourbin).
- scripts/rpm2cpio.sh: Deal with decompressors (Alexey Tourbin).
- spec: Added _binary_payload w9.gzdio (Alexey Tourbin).
- Plugged a memleak in lzclose() (Panu Matilainen).
- Backported LZMA payload compression from SuSE (Alexey Tourbin).
- rpmReadPackageManifest: Fix comments handling.
- files.c (addFile): Check that each intermediate path component
  is a directory (not symlink) (Alexey Tourbin).
- files.c (addFile): File path must be canonical (Alexey Tourbin).
- files.c (addFile): Reassure that file path starts with '/' (Alexey Tourbin).
- files.c (addFile): File path must match buildroot (Alexey Tourbin).
- spec: Removed 'BuildConflicts: rpm-devel' (Alexey Tourbin).
- relative: Fixed potential NULL dereference (Closes: #14067).
- platform.in (%__autoreconf): Added deprecation warning.
- platform.in: Added %warning() macro.
- platform.in: Added %autoreconf macro (Closes: #13925).
- relative.c: Changed to use heap for memory allocation, fix normalize(), cleanup.
- relative.c: Fixed an off-by-one (kind of) error. (Alex Myltsev).
- Added armv5tejl support (Kirill Shutemov).
- rpmrc.in: Removed -fsigned-char from optflags for arm* (Kirill Shutemov).
- Refresh ARM support (Kirill Shutemov).
- Do not check STACK entry in ARM ELF files (Kirill Shutemov).
- More %_target_platform tweaks: cleanup build_os filter; initialize
  %_gnueabi; replace %_gnu with %_gnueabi in %_target_platform.
- %_gnu appended to %_target_platform (Kirill Shutemov).
2008-07-08 14:45:31 +00:00
Alexey Tourbin
5165ed5fd0 spec: in %post-script, remove /var/cache/apt/*.bin
Note that I exepect pdeath_execute to use execvp(3).
2008-07-08 14:39:34 +00:00
Alexey Tourbin
c23e7c1c58 pdeath_execute.c: remove X_OK check, use execvp(3)
Both (F_OK|X_OK) cannot be tested at the same time, which means that
X_OK is X_OK for directories, too.  And anyway there's a huge period
of time between X_OK test and exec.  So I remove the test which cannot
be performed reliably.  As a bonus, I also replace execv() with execvp().
2008-07-08 14:39:01 +00:00
af29ee4d70 fixup-libtool, fixup-pkgconfig: Quote substitution text (ALT#11437) 2008-07-07 22:07:40 +00: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
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
5632ef5ac2 rpmrc.c: classify SSE2-capable CPUs as "pentium4" 2008-06-12 04:45:53 +04:00
9376fa4c22 rpmrc.c (is_pentium3): Add new p3 family models
http://download.intel.com/design/processor/applnots/24161832.pdf page 22
2008-06-05 21:52:02 +00:00
669c2e04c2 rpmrc.c (is_pentium4): Add new p4 models
http://download.intel.com/design/processor/applnots/24161832.pdf page 23
Patch from alexander@npo-inform.com
2008-06-05 21:52:02 +00:00
Alexey Tourbin
52b2499aff rpmio.c: implemented cpio hints for rsyncable_gzwrite() 2008-05-30 22:23:16 +04:00
Alexey Tourbin
8d5e355e06 rpmio.c: deal with partial rsyncable_gzwrite() return 2008-05-30 20:09:17 +04:00
Alexey Tourbin
f7b5ee1e80 rpmio.c: implemented rscynable_gzwrite() 2008-05-30 20:08:14 +04:00
Alexey Tourbin
c761902bcb rpmio.c: introduced rpmGZFILE wrapper for gzdio 2008-05-30 20:05:08 +04:00
Alexey Tourbin
dbfaf59314 scripts/rpm2cpio.sh: deal with decompressors 2008-05-24 20:24:39 +04:00
Alexey Tourbin
6f575ecded spec: _binary_payload w9.gzdio 2008-05-24 13:58:47 +04:00
Panu Matilainen
86679b599f Plug a memleak in lzclose() 2008-05-24 13:48:14 +04:00
Alexey Tourbin
9814453966 backported LZMA payload compression from SuSE 2008-05-24 13:47:41 +04:00
Alexey Tourbin
fdca55d311 spec: workaround config.rpath problem
(cherry picked from commit d78d0be4fd)
2008-05-24 12:28:57 +04:00
6535b7f1cc rpmReadPackageManifest: Fix comments handling 2008-04-08 15:28:53 +00: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