1 | #!/bin/sh |
---|
2 | |
---|
3 | # define target arch and URL |
---|
4 | ARCH=i386 |
---|
5 | #ARCH=x86_64 |
---|
6 | URL_BASE=ftp://updates.vinelinux.org/pub/Vine/ |
---|
7 | #URL_BASE=ftp://ftp.jaist.ac.jp/pub/Linux/Vine/ |
---|
8 | USE_MELD=Yes |
---|
9 | |
---|
10 | # define URLs and files |
---|
11 | URL_MAIN=$URL_BASE/Vine-5.0/$ARCH/Vine/RPMS.main/ |
---|
12 | URL_PLUS=$URL_BASE/VinePlus/5/$ARCH/ |
---|
13 | |
---|
14 | CAT_FILE=packages-vine5x.list |
---|
15 | URL_CAT=$URL_BASE/VineSeed/category/$CAT_FILE |
---|
16 | |
---|
17 | # define temporary directory/files |
---|
18 | TMP_DIR=/var/tmp |
---|
19 | TMP_CAT=$TMP_DIR/5category.list |
---|
20 | TMP_FTP=$TMP_DIR/5ftpfiles.list |
---|
21 | TMP_PKG=$TMP_DIR/5ftp_pkgs.list |
---|
22 | |
---|
23 | # column width for diff output |
---|
24 | COLS=80 |
---|
25 | |
---|
26 | ##### |
---|
27 | |
---|
28 | # clrear temp files |
---|
29 | rm -rf $TMP_CAT $TMP_FTP |
---|
30 | |
---|
31 | # get packages-vine5 |
---|
32 | wget $URL_CAT -O $TMP_DIR/$CAT_FILE |
---|
33 | |
---|
34 | # get actual package list by lftp |
---|
35 | lftp -c find $URL_MAIN > $TMP_PKG |
---|
36 | lftp -c find $URL_PLUS | grep -v /pool/ >> $TMP_PKG |
---|
37 | |
---|
38 | # sort packages-vine5.list by package name |
---|
39 | sort -t "," -k2 $TMP_DIR/$CAT_FILE | sed 's/,,/,/' > $TMP_CAT |
---|
40 | |
---|
41 | # create package list for actual files on ftp |
---|
42 | for f in `grep -e ".rpm$" $TMP_PKG`; do |
---|
43 | echo -n `echo $f | cut -d "/" -f9 | cut -d "." -f2` >> $TMP_FTP |
---|
44 | echo -n "," >> $TMP_FTP |
---|
45 | echo -n `basename $f | awk -F "-" '{S="-" $(NF-1) "-" $NF; sub(S,""); print $0}'` >> $TMP_FTP |
---|
46 | echo "," >> $TMP_FTP |
---|
47 | done |
---|
48 | |
---|
49 | sort -t "," -k2 $TMP_FTP > $TMP_DIR/tmp.list |
---|
50 | mv $TMP_DIR/tmp.list $TMP_FTP |
---|
51 | |
---|
52 | # compare |
---|
53 | if [ $USE_MELD == Yes ]; then |
---|
54 | meld $TMP_CAT $TMP_FTP & |
---|
55 | else |
---|
56 | diff $TMP_CAT $TMP_FTP --side-by-side --suppress-common-lines --width=$COLS |
---|
57 | fi |
---|