Gentoo Archives: gentoo-dev

From: pof <pau@××××××.org>
To: gentoo-dev@g.o
Cc: Paul <set@×××××.com>
Subject: Re: [gentoo-dev] my simple dependancy generator
Date: Wed, 21 Aug 2002 07:21:14
Message-Id: 20020821142100.48f49284.pau@eSlack.org
In Reply to: [gentoo-dev] my simple dependancy generator by Paul
1 On Wed, 21 Aug 2002 04:32:06 -0400
2 Paul <set@×××××.com> wrote:
3
4 > Hi;
5 >
6 > Not running gnome or kde, I prefer to be as tight as
7 > possible on dependancies.
8 > I whiped up this scrawny script to help me determine the
9 > dependancies for some ebuilds I write; does anyone want to
10 > improve it, or say why it sucks?
11 >
12 > ---
13 > [squish.home.loc] /home/set/mysrc/script (Set): cat pkg-depend
14 > #!/bin/sh
15 >
16 > FILE=$1
17 > if [ ! -f "$FILE" ] ; then
18 > FILE=`which $1`
19 > fi
20 >
21 > ldd "$FILE" | gawk '{ print $3 }' - | xargs -n1 qpkg -nc -f -v\
22 > | sort | uniq
23 > ---
24 >
25 > Paul
26 > set@×××××.com
27
28
29 It works well for me, made simple changes to look nicer:
30
31 ------8<---- cut here ---------
32 #!/bin/sh
33
34 if [ ${#} != 1 ]; then
35 echo "usage: `basename ${0}` binary"
36 exit 1
37 fi
38
39 FILE=`which ${1} 2>/dev/null`
40
41 if [ ${?} != 0 ]; then
42 echo "Error: file not found"
43 exit 2
44 fi
45
46 echo -e "\x1b[0;01mChecking \x1b[32;01m${FILE} \x1b[0;01mdependancies..."
47 echo
48 ldd "${FILE}" | gawk '{ print $3 }' - | xargs -n1 qpkg -f -v | sort | uniq
49 ------8<---- cut here ---------
50
51 Regards,
52
53 Pau.
54 --
55 .----------------------------------------------.
56 | Pau Oliva Fora http://pof.eslack.org |
57 | KeyID: 665D05B533539E02 available at keyserv |
58 `----------------------------------------------'