source: people/kazutaka/compare_packages-vine5.sh @ 410

Revision 410, 1.4 KB checked in by kazutaka, 14 years ago (diff)
  • Property svn:executable set to *
Line 
1#!/bin/sh
2
3# define target arch and URL
4ARCH=i386
5#ARCH=x86_64
6URL_BASE=ftp://updates.vinelinux.org/pub/Vine/
7#URL_BASE=ftp://ftp.jaist.ac.jp/pub/Linux/Vine/
8USE_MELD=Yes
9
10# define URLs and files
11URL_MAIN=$URL_BASE/Vine-5.0/$ARCH/Vine/RPMS.main/
12URL_PLUS=$URL_BASE/VinePlus/5/$ARCH/
13
14CAT_FILE=packages-vine5x.list
15URL_CAT=$URL_BASE/VineSeed/category/$CAT_FILE
16
17# define temporary directory/files
18TMP_DIR=/var/tmp
19TMP_CAT=$TMP_DIR/5category.list
20TMP_FTP=$TMP_DIR/5ftpfiles.list
21TMP_PKG=$TMP_DIR/5ftp_pkgs.list
22
23# column width for diff output
24COLS=80
25
26#####
27
28# clrear temp files
29rm -rf $TMP_CAT $TMP_FTP
30
31# get packages-vine5
32wget $URL_CAT -O $TMP_DIR/$CAT_FILE
33
34# get actual package list by lftp
35lftp -c find $URL_MAIN > $TMP_PKG
36lftp -c find $URL_PLUS | grep -v /pool/ >> $TMP_PKG
37
38# sort packages-vine5.list by package name
39sort -t "," -k2 $TMP_DIR/$CAT_FILE | sed 's/,,/,/' > $TMP_CAT
40
41# create package list for actual files on ftp
42for 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
47done
48
49sort -t "," -k2 $TMP_FTP > $TMP_DIR/tmp.list
50mv $TMP_DIR/tmp.list $TMP_FTP
51
52# compare
53if [ $USE_MELD == Yes ]; then
54    meld $TMP_CAT $TMP_FTP &
55else
56    diff $TMP_CAT $TMP_FTP --side-by-side --suppress-common-lines --width=$COLS
57fi
Note: See TracBrowser for help on using the repository browser.