summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJavier Villavicencio <the_paya@gentoo.org>2008-06-22 11:11:14 -0300
committerJavier Villavicencio <the_paya@gentoo.org>2008-06-22 11:11:14 -0300
commitb0f80c819709241b02badeb6ac19b87585e989a2 (patch)
treeb28949343ca0771bd5af733da633cbd3eaed467b /scripts
parentFreeBSD-7 cddl ebuild (zfs). (diff)
downloadgentoo-bsd-b0f80c819709241b02badeb6ac19b87585e989a2.tar.gz
gentoo-bsd-b0f80c819709241b02badeb6ac19b87585e989a2.tar.bz2
gentoo-bsd-b0f80c819709241b02badeb6ac19b87585e989a2.zip
Script to generate the source tarballs.
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/extract.sh46
1 files changed, 46 insertions, 0 deletions
diff --git a/scripts/extract.sh b/scripts/extract.sh
new file mode 100755
index 0000000..4972fbd
--- /dev/null
+++ b/scripts/extract.sh
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+if [[ $# -lt 1 ]]; then
+ echo "You must specify the version of the packages to build."
+ exit 1
+fi
+
+# These are the base packages recognized by original script:
+# base bin contrib crypto etc games gnu include krb5 lib libexec release
+# rescue sbin secure share sys tools ubin usbin
+# Added cddl and compat.
+
+if [[ -z $2 ]]; then
+ dists="bin cddl compat contrib crypto gnu include lib libexec sbin share ubin usbin sys etc rescue "
+else
+ dists="$2"
+fi
+
+MIRROR=${FTPMIRROR:-ftp.FreeBSD.org}
+echo "Using mirror ${MIRROR}"
+
+P=$1
+MY_P=${P/_rc/-RC}
+MY_P=${MY_P/_beta/-BETA}
+echo "Getting version ${P} [${MY_P}].."
+if [[ ${MY_P} == ${P} ]]; then
+ MY_P="${MY_P}-RELEASE"
+fi
+
+echo "Downloading files..."
+wget -nv -c "ftp://${MIRROR}/pub/FreeBSD/releases/i386/${MY_P}/src/CHECKSUM.MD5"
+
+sed -e 's:MD5 (\(.*\)) = \(.*\):\2 \1:' CHECKSUM.MD5 > MD5SUM
+
+for i in $dists; do
+ wget -nv -c -t0 "ftp://${MIRROR}/pub/FreeBSD/releases/i386/${MY_P}/src/s$i*"
+done
+echo "Done downloading files."
+
+echo "Repackaging files..."
+for i in $dists; do
+ echo " Repackaging source component: $i"
+ cat s${i}.?? | zcat - | bzip2 - > freebsd-${i}-$P.tar.bz2
+done
+echo "Done repackaging sources."
+exit 0