Gentoo Archives: gentoo-dev

From: William Kenworthy <billk@×××××××××.au>
To: "José Fonseca" <j_r_fonseca@××××××××.uk>
Cc: Nick Jones <carpaski@××××××.net>, gentoo-dev List <gentoo-dev@g.o>
Subject: Re: [gentoo-dev] Script to clean old files from /usr/portage/distfiles
Date: Tue, 12 Nov 2002 11:48:40
Message-Id: 1037100515.10897.4.camel@rattus.localdomain
In Reply to: Re: [gentoo-dev] Script to clean old files from /usr/portage/distfiles by "José Fonseca"
1 I get the messages below before the duplicates after running with the -p
2 flag. Is there a way to ensure the cache is up-to-date and clean before
3 running?
4
5 BillK
6
7 sed: can't read /var/cache/edb/dep/app-admin/metalog-0.6-r9: No such
8 file or directory
9 sed: can't read /var/cache/edb/dep/x11-themes/crux-1.9.3: No such file
10 or directory
11 sed: can't read /var/cache/edb/dep/x11-themes/gtk-thinice-engine-2.0.1:
12 No such file or directory
13 sed: can't read /var/cache/edb/dep/gnome-base/libgnome-2.0.1-r1: No such
14 file or directory
15 sed: can't read /var/cache/edb/dep/gnome-base/ORBit2-2.4.0-r2: No such
16 file or directory
17 sed: can't read /var/cache/edb/dep/app-arch/rpm-4.0.4-r2: No such file
18 or directory
19 sed: can't read /var/cache/edb/dep/app-text/ispell-3.2.06-r1: No such
20 file or directory
21 sed: can't read /var/cache/edb/dep/app-text/gnome-spell-0.4.1-r1: No
22 such file or directory
23 sed: can't read /var/cache/edb/dep/sys-devel/gcc-3.1.1-r1: No such file
24 or directory
25 sed: can't read /var/cache/edb/dep/sys-devel/make-3.79.1-r3: No such
26 file or directory
27 sed: can't read /var/cache/edb/dep/sys-devel/perl-5.6.1-r4: No such file
28 or directory
29 sed: can't read /var/cache/edb/dep/net-www/lynx-2.8.4a-r4: No such file
30 or directory
31 sed: can't read /var/cache/edb/dep/media-libs/lcms-1.08: No such file or
32 directory
33 sed: can't read /var/cache/edb/dep/sys-apps/hdparm-5.2: No such file or
34 directory
35 sed: can't read /var/cache/edb/dep/sys-apps/gawk-3.1.0-r2: No such file
36 or directory
37 sed: can't read /var/cache/edb/dep/sys-libs/pam-0.75-r6: No such file or
38 directory
39 sed: can't read /var/cache/edb/dep/sys-libs/glibc-2.2.5-r4: No such file
40 or directory
41 sed: can't read /var/cache/edb/dep/dev-libs/libsigc++-1.1.13: No such
42 file or directory
43 sed: can't read /var/cache/edb/dep/dev-libs/libxslt-1.0.18: No such file
44 or directory
45 sed: can't read /var/cache/edb/dep/dev-libs/expat-1.95.2: No such file
46 or directory
47 sed: can't read /var/cache/edb/dep/media-sound/sox-12.17.3: No such file
48 or directory
49 sed: can't read /var/cache/edb/dep/media-sound/ecasound-2.0.4: No such
50 file or directory
51 sed: can't read /var/cache/edb/dep/media-video/nvidia-kernel-1.0.2960:
52 No such file or directory
53 sed: can't read /var/cache/edb/dep/gnome-extra/gtkhtml-1.0.2-r2: No such
54 file or directory
55 sed: can't read /var/cache/edb/dep/gnome-extra/gal2-0.0.4-r1: No such
56 file or directory
57 sed: can't read /var/cache/edb/dep/net-dialup/ppp-2.4.1-r8: No such file
58 or directory
59 4.2.0-libGLU-bad-extern.patch
60 4.2.0-xlib-i18n-module.patch
61 4.2.0-zlib-security.patch
62 ExtUtils-F77-1.13.tar.gz
63
64
65 On Tue, 2002-11-12 at 18:21, José Fonseca wrote:
66 > On Mon, Nov 11, 2002 at 09:28:49PM -0600, Nick Jones wrote:
67 > > metadata is _not_ something you should be using. metadata is a
68 > > quick-search cache database that is updated remotely. It has a basic
69 > > link to your system, but should in no way be used to determine
70 > > settings and data as it can be out of date. It's primary purpose is
71 > > for searching. /var/cache/edb/dep is a valid, local system cache.
72 >
73 > Thanks! I hadn't noticed the existence of /var/cache/edb/dep. Using it
74 > instead of /usr/portage/metadata/cache works flawlessly.
75 >
76 > All interested, please check the attached new version. It includes all
77 > suggestions which were made so far. It requires >=sed-4.0, otherwise
78 > replace "xargs sed -s" by "xargs -l sed". If there aren't further
79 > corrections/suggestions then I'll create a bug in bugzilla for it.
80 >
81 > > Try this:
82 > >
83 > > FEATURES="mirror" emerge -efp world | ...
84 >
85 > Unfortunately when doing this, emerge starts complaining that it can't
86 > satisfy dependencies.
87 >
88 > Regards,
89 >
90 > José Fonseca
91 > ----
92 >
93
94 > #!/bin/sh
95 > #
96 > # distfiles-clean
97 > #
98 > # Cleans unused files from Portage's distfiles directory.
99 > #
100 > # José Fonseca <j_r_fonseca@××××××××.uk>
101 >
102 > PROGRAM=`basename "$0"`
103 >
104 > while [ ${#} -gt 0 ]
105 > do
106 > case "$1" in
107 > -h|--help)
108 > USAGE=y
109 > break
110 > ;;
111 > -p|--pretend)
112 > PRETEND=y
113 > ;;
114 > *)
115 > echo "$PROGRAM: Invalid option \'$1\'" 1>&2
116 > USAGE=y
117 > break
118 > ;;
119 > esac
120 > shift
121 > done
122 >
123 > # For PORTDIR and DISTDIR
124 > . /etc/make.globals
125 > . /etc/make.conf
126 >
127 > if [ "$USAGE" ]
128 > then
129 > echo "Usage: $PROGRAM [-h|--help] [-p|--pretend]"
130 > echo "Cleans unused files from $DISTDIR directory."
131 > exit
132 > fi
133 >
134 > DBDIR=/var/db/pkg
135 > CACHEDIR=/var/cache/edb/dep
136 >
137 > for DIR in "$PORTDIR" "$DISTDIR" "$DBDIR" "$CACHEDIR"
138 > do
139 > if [ ! -d "$DIR" ]
140 > then
141 > echo "$PROGRAM: \'$DIR\' not found."
142 > exit
143 > fi
144 > done
145 >
146 > TMPFILE=`mktemp /tmp/$0.XXXXXX`
147 >
148 > find $DBDIR -name '*.ebuild' | sed -n -e "s:^$DBDIR/\([^/]*\)/\([^/]*\)/\([^/]*\)\.ebuild$:$CACHEDIR/\1/\3:p" | xargs sed -s -e '4!d;s/[[:space:]]\+/\n/g' | sed -n -e 's:^.*/::p' | sort -u > $TMPFILE && ls -1 $DISTDIR | grep -v '^cvs-src$' | comm -23 - $TMPFILE | {
149 > if [ "$PRETEND" ]
150 > then
151 > cat
152 > else
153 > sed -e "s:^:$DISTDIR/:" | xargs rm -f
154 > fi
155 > }
156 >
157 > rm $TMPFILE
158 >
159 > ----
160 >
161
162 > --
163 > gentoo-dev@g.o mailing list
164
165
166
167 --
168 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] Script to clean old files from /usr/portage/distfiles "José Fonseca" <j_r_fonseca@××××××××.uk>