function PrimaryXml {
wget -q -O -
| grep primary.xml \
| sed -n -e 's/.*"\(.*\)".*/\1/p'
}
function GetPackages {
BaseUrl="$1"
# Packages end with - and start with /
Include=`echo $2 |
Exclude=`echo $3 |
wget -q -O -
| zcat \
| sed -n -e 's/.*href="\([^"]*\)\".*/\1/p' \
| grep -E "rpm$" \
| ( [ -z "$Include" ] && cat || grep -E "($Include)" ) \
| ( [ -z "$Exclude" ] && cat || grep -vE "($Exclude)" ) \
}
function DownloadPackages {
BaseUrl="$1"
Mode=0
Include=""
Exclude=""
shift
while (($#)); do
if [[ "$1" == "-v" ]] ; then
Mode=1
else
if [ $Mode -eq 1 ] ; then
Exclude="$Exclude $1"
else
Include="$Include $1"
fi
fi
shift
done
Packages=0
GetPackages
while read i ;
if [ ! -f
test -d `dirname $i` || mkdir -p `dirname
echo "Downloading $BaseUrl$i..."
fi
done
fi
Packages=$((Packages+1))
done
echo "Download
}
DownloadPackages https://dl.google.com/linux/chrome/rpm/stable/x86_64/ google-chrome-stable
}
}