]> git.pld-linux.org Git - packages/rpm.git/blob - rpm-find-provides-wrapper
- include --x-libraries=/usr/X11R6/%{_lib} in %configure macros
[packages/rpm.git] / rpm-find-provides-wrapper
1 #!/bin/sh
2
3 # _noauto* wrapper for builtin rpm Provides generator
4 # requires:             /bin/sh, /usr/bin/rpmdeps, coreutils, findutils
5 # input (stdin):        filenames (one per line)
6 # output (stdout):      Provides list (one per line)
7
8 # note that no large list is stored in shell variable - this was VERY slow
9
10 ulimit -c 0
11
12 PERLOPT="--define=__perl_provides /bin/sh -c 'cat >/dev/null'"
13 PERLOPT2="--define=__perl_requires /bin/sh -c 'cat >/dev/null'"
14 PHPOPT="--define=__php_provides /bin/sh -c 'cat >/dev/null'"
15 PHPOPT2="--define=__php_requires /bin/sh -c 'cat >/dev/null'"
16 noprovfiles=''
17 noprov=''
18 buildroot=''
19 while [ $# -gt 0 ]; do
20         case "$1" in
21           --with-perl)
22                 PERLOPT=""
23                 PERLOPT2=""
24                 ;;
25           --with-php)
26                 PHPOPT=""
27                 PHPOPT2=""
28                 ;;
29           --buildroot=*)
30                 buildroot="${1#--buildroot=}"
31                 ;;
32           --noautoprovfiles=*)
33                 for i in ${1#--noautoprovfiles=} ; do
34                         noprovfiles="${noprovfiles}\|${buildroot}${i}"
35                 done
36                 ;;
37           --noautoprov=*)
38                 for i in ${1#--noautoprov=} ; do
39                         noprov="${noprov}\|${i}"
40                 done
41         esac
42         shift
43 done
44
45 if [ -r /etc/rpm/noautoprovfiles ]; then
46         for i in `cat /etc/rpm/noautoprovfiles | grep -v '^#'`; do
47                 noprovfiles="${noprovfiles}\|${buildroot}${i}"
48         done
49 fi
50
51 if [ -r /etc/rpm/noautoprov ]; then
52         for i in `cat /etc/rpm/noautoprov | grep -v '^#'`; do
53                 noprov="${noprov}\|${i}"
54         done
55 fi
56
57 # rpmdeps output seems sorted, but resort it in case of long list split
58 grep -v -e "^\(${noprovfiles}\)\$" | tr '\n' '\0' | \
59         xargs -r -0 /usr/bin/rpmdeps "${PERLOPT}" "${PERLOPT2}" \
60                 "${PHPOPT}" "${PHPOPT2}" --provides | \
61         LC_ALL=C sort -u | grep -v -e "^\(${noprov}\)\$"
62
63 exit 0
This page took 0.025006 seconds and 3 git commands to generate.