1 |
Spider wrote: |
2 |
> Now.. .for my main source of irritation and something I'd require help |
3 |
> with. in this update, they also saw fit to remove the /latest directory, |
4 |
> which previously had a nice "sort by date" in the http interface, and |
5 |
> thus was really simple to keep abreast with added and changed packages |
6 |
> between our tree and theirs.. Now this is the question of listing all |
7 |
> packages one by one for each "major" version and checking against our |
8 |
> supported versions. as you can imagine this is nothing I look forward |
9 |
> to doing. |
10 |
> |
11 |
> So, I request the help of the creative scripters in the -dev list to |
12 |
> come up with a way to track changes in a ftp tree between two days, and |
13 |
> listing the new packages between dates. |
14 |
> |
15 |
> ls */*/*.tar* >$DATE ; diff $DATE(TODAY) $DATE(TODAY-1) : |
16 |
> or something ;) |
17 |
|
18 |
|
19 |
I don't have the time to actually write and test the scripts right now, |
20 |
so I'm just going to throw in some ideas, in the hope that they will be |
21 |
helpful: |
22 |
|
23 |
1) Explore the gnome source tree. |
24 |
|
25 |
wget -m -R "*.md5,*.zip,*.bz2,*.gz,*.tgz,*.tbz2" |
26 |
ftp://ftp.gnome.org/mirror/gnome.org/sources/ |
27 |
|
28 |
(All in a single line, of course) |
29 |
|
30 |
This will create the directory structure |
31 |
"ftp.gnome.org/mirror/gnome.org/sources/*" in the current directory. |
32 |
Inside "sources/", each directory will contain a file called ".listing" |
33 |
and possibly a symbolic link called "LATEST-IS-<something>" (not all of |
34 |
them will have this) , but none of the actual files will be downloaded. |
35 |
|
36 |
2) Build a list of files. |
37 |
|
38 |
for i in `find . -name ".listing"` |
39 |
do |
40 |
a=${i##*sources} |
41 |
a=${a%%.listing} |
42 |
for x in `cat $i | grep -v "^total" | awk '{print $(NF)}'` |
43 |
do |
44 |
echo "$a$x" |
45 |
done |
46 |
done | sort -u |
47 |
|
48 |
The commands above recombine the directory names with the contents of |
49 |
the ".listing" files to output something like what the results of a |
50 |
"find" command would be. The "LATEST-IS-*" symlinks are ignored. |
51 |
|
52 |
3) Find out what's new. |
53 |
|
54 |
Running the script in (2) e.g. once a day and saving its output to a |
55 |
file make it possible to use diff/comm to find out what changed. |
56 |
|
57 |
The command |
58 |
|
59 |
comm -1 -3 yesterday.txt today.txt |
60 |
|
61 |
will output only lines unique to today.txt, while |
62 |
|
63 |
comm -2 -3 yesterday.txt today.txt |
64 |
|
65 |
will output only lines unique to yesterday.txt. |
66 |
|
67 |
|
68 |
|
69 |
|
70 |
That's what I have for now. I hope this will be helpful. When I get the |
71 |
time, if nobody has done it yet, I'll be happy to write the actual scripts. |
72 |
|
73 |
[]'s |
74 |
Felipe Ghellar |
75 |
|
76 |
|
77 |
-- |
78 |
|
79 |
|
80 |
_______________________________________________________________________ |
81 |
Yahoo! GeoCities |
82 |
Tudo para criar o seu site: ferramentas fáceis de usar, espaço de sobra e acessórios. |
83 |
http://br.geocities.yahoo.com/ |