1 |
Hi, |
2 |
|
3 |
first, sorry, no, I am not a dev, but wanted to show you a little |
4 |
(actually kind of trivial) script I wrote last night. The reason I didnt |
5 |
do it earlier is it just didnt come up my mind. |
6 |
|
7 |
emerge sync takes longer and longer to complete just because of the |
8 |
sheer number of files. Then I saw the RSYNC_EXCLUDEFROM variable, and |
9 |
had this idea. |
10 |
|
11 |
The script calculates the rsync_excludes' file's possible contents |
12 |
automatically, I even went into the effort to comment it. |
13 |
|
14 |
--- |
15 |
#!/bin/bash |
16 |
# |
17 |
# This script brought to you by Timo Lindemann aka anykey in 2004 |
18 |
# |
19 |
# This script calculates an excludefile for portage |
20 |
# based on all software you never installed. It excludes |
21 |
# only main branches of the tree. |
22 |
# To use it, you just uncomment the RSYNC_EXCLUDEFROM line |
23 |
# in /etc/make.conf and invoke the script as follows: |
24 |
# |
25 |
# getexcludes >/etc/portage/rsync_excludes |
26 |
# |
27 |
# Now, we filter what we have... |
28 |
INSTALLED=`qpkg -nc -I|sed -e "s/\ \*//g;s/\/.*//g"|sort -d|uniq` |
29 |
# ...from all that portage offers... |
30 |
AVAILABLE=`ls -d /usr/portage/* | sed "s:/usr/portage/::g;/\./d"|grep -e |
31 |
"\w.*\-.*"` |
32 |
# ...using a for loop and substitution. Works. |
33 |
for i in ${INSTALLED} |
34 |
do |
35 |
AVAILABLE=${AVAILABLE//${i}} |
36 |
done; |
37 |
# Then we print that list, or redirect it. |
38 |
for i in ${AVAILABLE} |
39 |
do |
40 |
echo "/${i}/" |
41 |
done; |
42 |
--- |
43 |
|
44 |
If this is unwanted, please ignore it. If it is too simple, laugh at it. |
45 |
But I thought it actually is useful (at least for me). |
46 |
|
47 |
Regards |
48 |
-- |
49 |
Timo Lindemann |
50 |
|
51 |
-- |
52 |
gentoo-dev@g.o mailing list |