From 2674eed1f281f976bed2bd0ee6daee000f488c0b Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Mon, 22 Apr 2013 12:30:00 +0200 Subject: [PATCH] autodist-upstream-updates: get archlinux packages list from mirror directory listings --- autodist-upstream-updates | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/autodist-upstream-updates b/autodist-upstream-updates index 995a1ff..05a9986 100755 --- a/autodist-upstream-updates +++ b/autodist-upstream-updates @@ -175,26 +175,23 @@ tail -n+2 $BUILDS_FILE > $buildstmp # parse Arch Linux package list [ "$quiet" ] || echo -n "Parsing Arch Linux packages list..." >&2 -for page in `seq 1 45`; do - SOURCEURL="https://www.archlinux.org/packages/?page=$page&sort=-last_update&q=&arch=i686&maintainer=&flagged=" +#for page in `seq 1 45`; do +for rep in core community extra; do +# SOURCEURL="https://www.archlinux.org/packages/?page=$page&sort=-last_update&q=&arch=i686&maintainer=&flagged=" + SOURCEURL="http://lug.mtu.edu/archlinux/$rep/os/i686/" curl -s "$SOURCEURL" | \ - grep "View package details" | \ + grep ".pkg." | grep -v ".sig\"" | \ while read line; do - line=`echo $line | html2text -nobs` -echo $line - set -- $line - pkg=$3 - ver=${4/-*} - ver=${ver/*:} + line=`echo $line | sed "s|.*href=\"\([^\"]*\)\">.*|\1|"` + pkg=`echo $line | sed "s|\(.*\)-[^-]*-[^-]*-[^-]*|\1|"` + ver=`echo $line | sed "s|.*-\([^-]*\)-[^-]*-[^-]*|\1|"` alias=`grep "^$pkg" $ALIASES_DB` [ "$alias" ] || alias=`grep "^lib$pkg " $ALIASES_DB` [ "$alias" ] && pkg=$alias line=`grep -i "^$pkg:" $buildstmp || grep -i "^lib$pkg:" $buildstmp || grep -i " $pkg[^-_A-Za-z0-9]" $buildstmp` if [ "$line" ]; then pkg=${line/:*} -echo "$pkg" [ "$pkg" -a "$ver" ] && { -echo "$pkg $ver $SOURCEURL ${alias/* /}" echo "$pkg $ver $SOURCEURL ${alias/* /}" >> $tmpfile } fi