Source

pbtools / vars / reposrc

Full commit
juster 021a744 
juster cefdc41 


juster 021a744 




















juster cefdc41 
juster 021a744 
#!/bin/sh
##
# Downloads official abs tarballs and extracts them to current dir.
# Output: names of repo directories.

PROG=reposrc

case $# in
0)	echo "usage: $PROG [repo names]"
	exit 2
esac

case "$*" in
*/*)	echo "$PROG: repo name cannot contain slashes"
	exit 2
esac

[ "$ARCH" ] || ARCH=i686
[ "$MIRROR" ] || MIRROR=ftp://ftp.archlinux.org

for repo
do
	rm -fr "$repo"
	url="$MIRROR/$repo/os/$ARCH/$repo.abs.tar.gz"
	curl --silent "$url" | gzip -dc | tar -xf - || exit 1
	find "$repo" -type f -a \( \! -name PKGBUILD \) | xargs rm
	echo "$repo"
done