Commit Graph

1146 Commits

Author SHA1 Message Date
c56e3cf71d Merge branch 'altlinux-4.0' 2008-04-08 15:32:44 +00:00
6535b7f1cc rpmReadPackageManifest: Fix comments handling 2008-04-08 15:28:53 +00:00
Alexey Tourbin
47bd8eff65 shebang.req: don't read the whole script
$ (echo '#!/usr/bin/perl'; cat /dev/zero) |sed -n '1s|^#![[:space:]]*/|/|p;q'
/usr/bin/perl
$
2008-04-01 15:33:19 +04:00
Alexey Tourbin
b81a3b6b75 4.0.4-alt91
- build/files.c: check if the same files are packaged into a few subpackages
2008-03-31 06:30:33 +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
88cad0c2a0 4.0.4-alt90
- reverted the rest of dependency optimization
- stripped redundant librpm-devel dependencies
- build/files.c: fixed a few possibilities of invalid cpio entries, including
  `dir/.*' construct in %%files section (which globs `dir/.' and `dir/..',
  and thus should not be used in specfiles)
- lib/psm.c: in syslog messages, discriminate between no epoch and zero epoch
2008-03-30 05:57:16 +04:00
Alexey Tourbin
f44d07e126 spec: mention %_tmppath in 4.0.4-alt87 changelog entry 2008-03-30 05:53:28 +04:00
Alexey Tourbin
e60ab8fa21 lib/psm.c: in syslog messages, discriminate between no epoch and zero epoch 2008-03-30 05:15:45 +04:00
Alexey Tourbin
5ec676a259 spec: librpm-devel should require only libpopt-devel 2008-03-30 04:41:55 +04:00
Alexey Tourbin
f178514e7c find-{requires,provides}: fixed %buildroot/.files:* lists for PackagedFiles() 2008-03-30 03:26:30 +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
845a750521 spec: removed 'BuildConflicts: rpm-devel' (checked with buildreq) 2008-03-25 03:27:37 +03:00
Alexey Tourbin
c0e8d34d90 spec: buildreq 2008-03-25 03:27:14 +03:00
Alexey Tourbin
eb301af2f4 lib.req: do not optimize dependencies on standard ELF interpreter 2008-03-17 21:07:06 +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
f4371cc2a2 4.0.4-alt89
- platform.in: Changed several macro definitions to avoid extra
  autodependencies when used in shell scripts.
2008-03-03 17:40:38 +00:00
4c946a678d platform.in: Rewrite macros to avoid extra dependencies
Changed %update_menus, %clean_menus, %update_wms, %clean_wms,
%update_scrollkeeper, %clean_scrollkeeper macros definitions
to avoid extra autodependencies when used in shell scripts.
2008-03-03 17:39:04 +00:00
04fdf89aa4 4.0.4-alt88
- verify-elf: According to information from Kirill Shutemov,
  PIE executables on ARM always contain TEXTREL, so do not check them.
- find-package: Removed bulk dependencies optimization
  introduced in previous release.
- scripts: Replaced redundant paths to basic programs
  with program names.
2008-02-29 12:30:30 +00:00
f1ed4d2bdd scripts: Replace paths to basic programs with their names
Absolute pathnames in shell scripts are redundant, $PATH is enough.
2008-02-29 12:30:29 +00:00
0ecfddcdcd Reduce macro abuse in %pre and %post scripts 2008-02-29 12:30:18 +00:00
10a67f5ef4 Revert "find-package (FindByPath): optimize out /bin/sh /bin/cat etc."
This reverts commit 54e8a1cff1.
2008-02-27 15:08:12 +00:00
86452d3194 Revert "find-package (FindByName): optimize out sh cat etc."
This reverts commit a93f78c60a.
2008-02-27 15:06:08 +00:00
63003fbeb9 Fix typos 2008-02-25 20:07:05 +00:00
816b34cd86 verify-elf.in: PIE executables on ARM always has TEXTREL, do not check them 2008-02-24 23:10:38 +00:00
Alexey Tourbin
cd04e08abc 4.0.4-alt87
- implemented automatic dependencies for %%pre, %%preun, %%post,
  and %%postun scriptlets (#7409)
- find-package: when possible, keep file-level dependencies as is,
  without mapping them to package names
- find-package: relax file-level dependencies on unpackaged directories
- find-package: optimize out bulk dependencies on sh, cat, rm, mv etc.
- build/parseScript.c: optimize out RPMSENSE_INTERP dependencies on /bin/sh
- lib.req: enabled ELF_INTERP dependencies except for standard /lib/ld-linux.so.2
- functions (ValidateBuildRoot): require RPM_BUILD_ROOT path be canonical
2008-02-24 18:55:54 +03:00
Alexey Tourbin
93b2b8bf15 spec: restored 4.0.4-alt84.1 changelog entry 2008-02-23 09:09:31 +03:00
Alexey Tourbin
3b998b2e3c Merge branch 'master' of git.alt:/people/ldv/packages/rpm 2008-02-23 08:23:37 +03:00
b740527bf1 4.0.4-alt86
- pam.req: Added substack support.
- Renamed rpm-python subpackage to python-module-rpm.
2008-02-22 22:38:13 +00:00
067f680afd Rename rpm-python subpackage to python-module-rpm 2008-02-22 22:38:12 +00:00
c20d7af1d2 pam.req.in: Add substack support 2008-02-22 22:38:08 +00:00
Alex V. Myltsev
4db6d078da 4.0.4-alt85
- rpm-python: fix segfaults with Python 2.5.
2008-02-22 23:02:53 +03:00
Alex V. Myltsev
9e49acf8d1 python: remove some dead code. 2008-02-22 22:33:11 +03:00
Alex V. Myltsev
9969c3a92d python: warning fixes. 2008-02-22 22:33:11 +03:00
Alex V. Myltsev
63f03dce06 python: replace sprintf + PyString_FromString with PyString_FromFormat
and fix a couple of warnings.

This is a heap of stinking old code.
1000 more commits and it will be a heap of stinking new code.
2008-02-22 22:33:11 +03:00
Alex V. Myltsev
8f2f44d63b python: deallocate object with PyObject_Del.
It was always illegal to deallocate objects with PyMem_DEL,
but it worked before Python 2.5. Now it just segfaults.

Also, I replace PyObject_NEW with PyObject_New
and "if(ptr) free(ptr)" with "free(ptr)".
2008-02-22 22:33:11 +03:00
Alex V. Myltsev
6e86f3b6c9 python: use METH_NOARGS where appropriate. 2008-02-22 22:33:11 +03:00
Alexey Tourbin
810f4045ed find-package: removed findpackage_xbroot stuff 2008-02-19 06:29:30 +03:00
Alexey Tourbin
e0598b6fe3 functions (ValidateBuildRoot): require canonical RPM_BUILD_ROOT
Some scripts like lib.req rely on the fact that RPM_BUILD_ROOT
should not end with trailing slashes or something.  Other
scripts like find-package explicitly assume that RPM_BUILD_ROOT
can be relocated within filesystem; they use something like
"real_buildroot" variables.  The code gets complicated,
fragile, and error-prone.

Therefore, guys, hereby I FORBID non-canonical RPM_BUILD_ROOT path.
Note that RPM_BUILD_ROOT actually does not have to exist.
This is another problem...
2008-02-19 06:28:14 +03:00
Alexey Tourbin
17b1c6b296 lib.req: return early if there is no dynamic section, to stop ldd failures with klibc executables
(before this commit)
$ ./scripts/lib.req.in /lib/mkinitrd/udev/lib/udev/usb_id
/lib/klibc-LqkyBjjvuUwwxYg5B9IteGNsWsI.so
ldd: ERROR: /lib/mkinitrd/udev/lib/udev/usb_id: trace failed
$

(after this commit)
$ ./scripts/lib.req.in /lib/mkinitrd/udev/lib/udev/usb_id
/lib/klibc-LqkyBjjvuUwwxYg5B9IteGNsWsI.so
$
2008-02-19 00:43:21 +03:00
Alexey Tourbin
e1bb17d070 lib.req.files: check "uses shared libs" as well as "dynamically linked", for klibc binaries 2008-02-19 00:22:23 +03:00
Alexey Tourbin
903c1810f3 lib.req: enabled ELF interp dependencies except for standard glibc's /lib*/ld-linux*.so.2 2008-02-18 22:31:29 +03:00
Alexey Tourbin
bf4a93fd36 s/\.packaged-files:/.files:/g 2008-02-18 18:26:21 +03:00
Alexey Tourbin
b4569b6236 spec (rpm-build): replaced "sh" dependency with "bash >= 0:3.1.17-alt4" 2008-02-02 01:33:35 +03:00
Alexey Tourbin
cb01bdf610 find-package (FindByName): buildroot topdir goes sbin-ish, for scriptlets 2008-02-02 01:21:10 +03:00
Alexey Tourbin
b523e1fd5c find-package (FindByPath): paths already required are safe enough, too 2008-02-02 00:57:33 +03:00
Alexey Tourbin
d2f98fca79 find-package (FindByPath): do raw dependencies for explicitly provided paths 2008-02-02 00:49:40 +03:00