#!/bin/bash set -e targetDir=$1 url=$2 if [ -z "$targetDir" -o -z "$url" ]; then echo echo "repofetch.sh downloads all rpm's from a rpm repostiroy and creates a local repo out of it" echo echo " usage: repofetch.sh " echo echo " : target directory on local filesystem where the rpms should go (repodata will be one directory higher)" echo " : url of the repo including the path to the directory where the repodata directory is located" echo exit 1 fi echo "creating target directory $targetDir" mkdir -p $targetDir cd $targetDir echo "fetch repomd.xml" wget -nd $url/repodata/repomd.xml echo "fetch primary.xml" primaryxml=$(grep -A 20 '' repomd.xml | grep "