From 1106b0c08db09620050a6ad247c07244851c7a77 Mon Sep 17 00:00:00 2001 From: Yorhel Date: Mon, 10 Oct 2016 17:19:08 +0200 Subject: [PATCH] Add FreeBSD 10.0 --- sql/schema.sql | 3 ++- util/freebsd.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 53 insertions(+), 3 deletions(-) diff --git a/sql/schema.sql b/sql/schema.sql index 60fbecc..dfa5c96 100644 --- a/sql/schema.sql +++ b/sql/schema.sql @@ -143,7 +143,8 @@ INSERT INTO systems (id, name, release, short, relorder) VALUES (91, 'Debian', '8.0', 'debian-jessie', 12), (92, 'Ubuntu', '15.10', 'ubuntu-wily', 22), (93, 'Ubuntu', '16.04', 'ubuntu-xenial', 23), - (94, 'FreeBSD', '9.3', 'freebsd-9.3', 55); + (94, 'FreeBSD', '9.3', 'freebsd-9.3', 55), + (95, 'FreeBSD', '10.0', 'freebsd-10.0', 56); -- Removes any path components and compression extensions from the filename. diff --git a/util/freebsd.sh b/util/freebsd.sh index fc663a8..ecc18f3 100755 --- a/util/freebsd.sh +++ b/util/freebsd.sh @@ -122,7 +122,7 @@ EOP } -# For FreeBSD 9.3+ +# For FreeBSD 9.3 check_pkg2() { SYSID=$1 URL=$2 @@ -148,7 +148,7 @@ check_pkg2() { } -# Fetch packages from the FreeBSD 9.3+ package repositories. +# Fetch packages from the FreeBSD 9.3 package repositories. check_pkgdir2() { SYSID=$1 URL=$2 @@ -166,6 +166,45 @@ check_pkgdir2() { check_pkg2 $SYSID $URL $NFO done <"$TMP/pkglist" + rm -f "$TMP/packagesite.yaml" "$TMP/pkglist" "$TMP/index" +} + + +# For FreeBSD 10.0+ +check_pkg3() { + SYSID=$1 + URL=$2 + NAME=$3 + VER=$4 + CAT=$5 + FN=$6 + + echo "===> $NAME $VER" + $CURL "$URL/All/$FN" -o "$TMP/pkg.txz" || return 1 + + # Get the highest last modified time and use that as the package release + # date. Not super reliable, but for the lack of a simple alternative... + DATE=`tar -tPvf "$TMP/pkg.txz" | awk '{print $4}' | sort -r |head -n 1` + + add_pkginfo $SYSID $CAT $NAME $VER $DATE + add_tar "$TMP/pkg.txz" $PKGID + rm -f "$TMP/pkg.txz" +} + + +# Fetch packages from the FreeBSD 10.0+ package repositories +# (Same as FreeBSD 9.3, but without all the uglyness to guess versions, the packagesite.yaml file is correct this time) +check_pkgdir3() { + SYSID=$1 + URL=$2 + $CURL "$URL/packagesite.txz" | tar -C "$TMP" -xJf- packagesite.yaml || return 1 + + perl -lne '($n)=/"name":"([^ "]+)"/; ($v)=/"version":"([^ "]+)"/; ($c)=m{"origin":"([^ "/]+)}; ($f)=m{"path":"All/([^ "]+)"}; print "$n $v $c $f"' < "$TMP/packagesite.yaml" >"$TMP/pkglist" + + while read NFO; do + check_pkg3 $SYSID $URL $NFO + done <"$TMP/pkglist" + rm -f "$TMP/packagesite.yaml" "$TMP/pkglist" } @@ -786,6 +825,15 @@ f9_3() { check_pkgdir2 94 "$PKG" } +f10_0() { + MIR="http://ftp-archive.freebsd.org/mirror/FreeBSD-Archive/old-releases/i386/10.0-RELEASE/" + PKG="http://pkg.freebsd.org/freebsd:10:x86:32/release_0/" + echo "============ $MIR" + check_dist 95 "$MIR/base.txz" "core-base" "2014-01-20" + check_dist 95 "$MIR/games.txz" "core-games" "2014-01-20" + check_pkgdir3 95 "$PKG" +} + old() { f1_0 @@ -844,6 +892,7 @@ old() { f9_1 f9_2 f9_3 + f10_0 } "$@"