Commits

juster committed fb940a0

Rename fetchabs to reposrc. Change calling semantics, check args.

  • Participants
  • Parent commits 6ddff03

Comments (0)

Files changed (2)

 useful for viewing the network of dependencies in a graph using graphviz.
 
 NAME		PURPOSE
-graph/fetchabs	Downloads abs tarballs from the official repository. An abs tree for
+graph/reposrc	Downloads abs tarballs from the official repository. An abs tree for
 		each repository is extracted to the current directory. By default
 		core, extra, and community are fetched. You can specify the repo
 		as arguments.

File graph/reposrc

+#!/bin/sh
+
+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
+	echo "$repo"
+	rm -fr "$repo"
+	curl --silent "$MIRROR/$repo/os/$ARCH/$repo.abs.tar.gz" | gzip -dc | tar -xf -
+	find "$repo" -type f -a \( \! -name PKGBUILD \) -delete
+done