Use Rust indexer for Ubuntu + script cleanup
This commit is contained in:
parent
2ee2f7495b
commit
46a6e2ff7c
6 changed files with 188 additions and 405 deletions
14
util/arch.sh
14
util/arch.sh
|
|
@ -2,12 +2,12 @@
|
||||||
|
|
||||||
. ./common.sh
|
. ./common.sh
|
||||||
|
|
||||||
|
MIRROR=http://ftp.nluug.nl/pub/os/Linux/distr/archlinux
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
active)
|
current)
|
||||||
MIRROR=http://ftp.nluug.nl/pub/os/Linux/distr/archlinux
|
index arch --sys arch --mirror $MIRROR --repo core
|
||||||
REPOS="core extra community"
|
index arch --sys arch --mirror $MIRROR --repo extra
|
||||||
for REPO in $REPOS; do
|
index arch --sys arch --mirror $MIRROR --repo community
|
||||||
index arch --sys arch --mirror $MIRROR --repo $REPO
|
;;
|
||||||
done
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,9 @@
|
||||||
#!/bin/bash
|
test -f .config && source .config
|
||||||
|
|
||||||
if test -f .config; then
|
|
||||||
source .config
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
index() {
|
index() {
|
||||||
echo "====> indexer -vv $@"
|
echo "====> indexer -vv $@"
|
||||||
./indexer -vv --dryrun $@ 2>&1
|
./indexer -vv $@ 2>&1
|
||||||
echo
|
echo
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -33,55 +29,3 @@ index_deb() {
|
||||||
index deb --sys "$SYS" --mirror "$MIRROR" --contents "$MIRROR$CONT" --packages "${MIRROR}dists/$DISTRO/$CMP/binary-i386/Packages.gz"
|
index deb --sys "$SYS" --mirror "$MIRROR" --contents "$MIRROR$CONT" --packages "${MIRROR}dists/$DISTRO/$CMP/binary-i386/Packages.gz"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
PSQL="psql -U manned -Awtq"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## THE STUFF BELOW IS OLD
|
|
||||||
# To be replaced with calls to index()
|
|
||||||
|
|
||||||
CURL="curl -fSs -A manual-page-crawler,info@manned.org --limit-rate 500k"
|
|
||||||
|
|
||||||
TMP=`mktemp -d manned.XXXXXX`
|
|
||||||
|
|
||||||
# bash-ism, remove the working directory when we're done.
|
|
||||||
trap "rm -rf $TMP" EXIT
|
|
||||||
|
|
||||||
|
|
||||||
# Usage: add_pkginfo sysid category name version date
|
|
||||||
# Returns 0 if the package is already in the database or if an error occured.
|
|
||||||
# Otherwise adds the package, sets PKGID to the new package_versions.id, and returns 1.
|
|
||||||
PKGID=
|
|
||||||
add_pkginfo() {
|
|
||||||
RES=`echo "SELECT pv.id FROM packages p JOIN package_versions pv ON pv.package = p.id
|
|
||||||
WHERE p.system = :'sysid' AND p.category = :'cat' AND p.name = :'name' AND pv.version = :'ver'"\
|
|
||||||
| $PSQL -v "sysid=$1" -v "cat=$2" -v "name=$3" -v "ver=$4"`
|
|
||||||
[ "$?" -ne 0 -o -n "$RES" ] && return 0
|
|
||||||
RES=`echo "
|
|
||||||
INSERT INTO packages (system, category, name) VALUES(:'sysid', :'cat', :'name') ON CONFLICT DO NOTHING;
|
|
||||||
INSERT INTO package_versions (version, released, package) VALUES(:'ver', :'rel',
|
|
||||||
(SELECT packages.id FROM packages WHERE system = :'sysid' AND category = :'cat' AND name = :'name'))
|
|
||||||
RETURNING id"\
|
|
||||||
| $PSQL -v "sysid=$1" -v "cat=$2" -v "name=$3" -v "ver=$4" -v "rel=$5"`
|
|
||||||
[ "$?" -ne 0 ] && return 0
|
|
||||||
PKGID=$RES
|
|
||||||
return 1
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
# Usage: add_tar <file> <pkgid> <flags>
|
|
||||||
# Requires a recent GNU tar for compression autodetect and xz support.
|
|
||||||
# TODO: tar throws an error if there are no man pages, but this isn't really an
|
|
||||||
# error.
|
|
||||||
add_tar() {
|
|
||||||
DIR=`mktemp -d "$TMP/tar.XXXXXXX"`
|
|
||||||
tar --warning=no-unknown-keyword --warning=no-alone-zero-block -C "$DIR" $3 -xf "$1" --wildcards '*man/*'\
|
|
||||||
&& ./add_dir.pl "$DIR" "$2"
|
|
||||||
RET=$?
|
|
||||||
rm -rf "$DIR"
|
|
||||||
return $RET
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
|
||||||
10
util/cron.sh
10
util/cron.sh
|
|
@ -1,9 +1,11 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
. ./common.sh
|
PSQL="psql -U manned -Awtq"
|
||||||
|
|
||||||
./arch.sh active
|
|
||||||
./debian.sh active
|
./arch.sh current
|
||||||
|
./debian.sh current
|
||||||
|
./ubuntu.sh current
|
||||||
|
|
||||||
echo "============ Updating SQL indices"
|
echo "============ Updating SQL indices"
|
||||||
$PSQL -f update_indices.sql
|
$PSQL -f update_indices.sql
|
||||||
|
|
|
||||||
|
|
@ -68,7 +68,7 @@ case "$1" in
|
||||||
$0 lenny
|
$0 lenny
|
||||||
$0 squeeze
|
$0 squeeze
|
||||||
;;
|
;;
|
||||||
active)
|
current)
|
||||||
$0 wheezy
|
$0 wheezy
|
||||||
$0 jessie
|
$0 jessie
|
||||||
;;
|
;;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,50 @@
|
||||||
. ./common.sh
|
. ./common.sh
|
||||||
|
|
||||||
|
|
||||||
|
CURL="curl -fSs -A manual-page-crawler,info@manned.org --limit-rate 500k"
|
||||||
|
|
||||||
|
TMP=`mktemp -d manned.XXXXXX`
|
||||||
|
|
||||||
|
# bash-ism, remove the working directory when we're done.
|
||||||
|
trap "rm -rf $TMP" EXIT
|
||||||
|
|
||||||
|
|
||||||
|
# Usage: add_pkginfo sysid category name version date
|
||||||
|
# Returns 0 if the package is already in the database or if an error occured.
|
||||||
|
# Otherwise adds the package, sets PKGID to the new package_versions.id, and returns 1.
|
||||||
|
PKGID=
|
||||||
|
add_pkginfo() {
|
||||||
|
RES=`echo "SELECT pv.id FROM packages p JOIN package_versions pv ON pv.package = p.id
|
||||||
|
WHERE p.system = :'sysid' AND p.category = :'cat' AND p.name = :'name' AND pv.version = :'ver'"\
|
||||||
|
| $PSQL -v "sysid=$1" -v "cat=$2" -v "name=$3" -v "ver=$4"`
|
||||||
|
[ "$?" -ne 0 -o -n "$RES" ] && return 0
|
||||||
|
RES=`echo "
|
||||||
|
INSERT INTO packages (system, category, name) VALUES(:'sysid', :'cat', :'name') ON CONFLICT DO NOTHING;
|
||||||
|
INSERT INTO package_versions (version, released, package) VALUES(:'ver', :'rel',
|
||||||
|
(SELECT packages.id FROM packages WHERE system = :'sysid' AND category = :'cat' AND name = :'name'))
|
||||||
|
RETURNING id"\
|
||||||
|
| $PSQL -v "sysid=$1" -v "cat=$2" -v "name=$3" -v "ver=$4" -v "rel=$5"`
|
||||||
|
[ "$?" -ne 0 ] && return 0
|
||||||
|
PKGID=$RES
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Usage: add_tar <file> <pkgid> <flags>
|
||||||
|
# Requires a recent GNU tar for compression autodetect and xz support.
|
||||||
|
# TODO: tar throws an error if there are no man pages, but this isn't really an
|
||||||
|
# error.
|
||||||
|
add_tar() {
|
||||||
|
DIR=`mktemp -d "$TMP/tar.XXXXXXX"`
|
||||||
|
tar --warning=no-unknown-keyword --warning=no-alone-zero-block -C "$DIR" $3 -xf "$1" --wildcards '*man/*'\
|
||||||
|
&& ./add_dir.pl "$DIR" "$2"
|
||||||
|
RET=$?
|
||||||
|
rm -rf "$DIR"
|
||||||
|
return $RET
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_splittar() { # <url-prefix> <last-sequence> <pkgid> <flags>
|
add_splittar() { # <url-prefix> <last-sequence> <pkgid> <flags>
|
||||||
$CURL "$1{"`perl -le "print join ',', 'aa'..'$2'"`'}' | add_tar - $3 $4
|
$CURL "$1{"`perl -le "print join ',', 'aa'..'$2'"`'}' | add_tar - $3 $4
|
||||||
}
|
}
|
||||||
|
|
|
||||||
463
util/ubuntu.sh
463
util/ubuntu.sh
|
|
@ -1,343 +1,136 @@
|
||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
# A fetcher for debian-style repositories.
|
|
||||||
|
|
||||||
. ./common.sh
|
. ./common.sh
|
||||||
|
|
||||||
checkpkg() {
|
AMIRROR=http://old-releases.ubuntu.com/ubuntu/
|
||||||
SYSID=$1
|
CMIRROR=http://nl.archive.ubuntu.com/ubuntu/
|
||||||
REPO=$2
|
|
||||||
NAME=$3
|
|
||||||
VERSION=$4
|
|
||||||
SECTION=$5
|
|
||||||
FILE=$6
|
|
||||||
echo "===> $NAME-$VERSION"
|
|
||||||
FN="$TMP/$NAME-$VERSION.deb"
|
|
||||||
$CURL "$REPO$FILE" -o "$FN" || return 1
|
|
||||||
|
|
||||||
# For 0.939000 formats:
|
|
||||||
# control.tar.gz = tail -n+3 $FILE | head -c"`head -n2 $FILE | tail -n1`"
|
|
||||||
# data.tar.gz = tail -n+3 $FILE | tail -c+"`head -n2 $FILE | tail -n1`" | tail -c+2
|
|
||||||
|
|
||||||
# Get the date from the last modification time of the debian-binary file
|
# Shortcut for a standard Ubuntu repo, usage:
|
||||||
# inside the .deb. Preferably, the date we store in the database indicates
|
# stdrepo name mirror
|
||||||
# when the *source* package has been uploaded, but this will work fine as
|
stdrepo() {
|
||||||
# an approximation, I guess.
|
index_deb ubuntu-$1 $2 $1 "main multiverse restricted universe"
|
||||||
if [ "`head -c8 \"$FN\"`" = "0.939000" ]; then
|
index_deb ubuntu-$1 $2 $1-updates "main multiverse restricted universe"
|
||||||
DATE=`tail -n+3 "$FN" | head -c"\`head -n2 \"$FN\" | tail -n1\`" | tar -tvzf - | grep control | perl -lne 's/.+ ([^ ]+ [^ ]+) [^ ]*control$/print $1/e'`
|
index_deb ubuntu-$1 $2 $1-security "main multiverse restricted universe"
|
||||||
else
|
|
||||||
DATE=`ar tv "$FN" debian-binary | perl -lne 's/^[^ ]+ [^ ]+ +\d+ (.+) debian-binary$/print $1/e'`
|
|
||||||
fi
|
|
||||||
DATE=`date -d "$DATE" +%F`
|
|
||||||
|
|
||||||
# Insert package in the database
|
|
||||||
add_pkginfo $SYSID $SECTION $NAME $VERSION $DATE
|
|
||||||
|
|
||||||
# Extract and handle the man pages
|
|
||||||
if [ "$?" -eq 1 -a -n "$PKGID" ]; then
|
|
||||||
# Old format
|
|
||||||
if [ "`head -c8 \"$FN\"`" = "0.939000" ]; then
|
|
||||||
tail -n+3 "$FN" | tail -c+"`head -n2 \"$FN\" | tail -n1`" | tail -c+2 | add_tar - $PKGID -z
|
|
||||||
|
|
||||||
# New format
|
|
||||||
else
|
|
||||||
DATAFN=`ar t $FN | grep -F data.tar`
|
|
||||||
case "$DATAFN" in
|
|
||||||
"data.tar.gz") DATAZ="-z" ;;
|
|
||||||
"data.tar.bz2") DATAZ="-j" ;;
|
|
||||||
"data.tar.lzma") DATAZ="--lzma" ;;
|
|
||||||
"data.tar.xz") DATAZ="-J" ;;
|
|
||||||
*) echo "No data.tar found, or unknown compression format."; DATAZ="ERR" ;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
[ "$DATAZ" != "ERR" ] && ar p "$FN" "$DATAFN" | add_tar - $PKGID $DATAZ
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
rm "$FN"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
syncrepo() {
|
case $1 in
|
||||||
SYSID=$1
|
warty)
|
||||||
REPO=$2
|
index_deb ubuntu-warty $AMIRROR warty "main multiverse restricted universe"
|
||||||
DISTRO=$3
|
index_deb ubuntu-warty $AMIRROR warty-updates "main multiverse restricted universe" "dists/warty/Contents-i386.gz"
|
||||||
COMPONENTS=$4
|
index_deb ubuntu-warty $AMIRROR warty-security "main multiverse restricted universe" "dists/warty/Contents-i386.gz"
|
||||||
CONTENTSURL=${5:-"dists/$DISTRO/Contents-i386.gz"}
|
;;
|
||||||
echo "============ $REPO $DISTRO ($COMPONENTS)"
|
hoary)
|
||||||
|
index_deb ubuntu-hoary $AMIRROR hoary "main multiverse restricted universe"
|
||||||
# Get Contents.gz and Packages
|
index_deb ubuntu-hoary $AMIRROR hoary-updates "main multiverse restricted universe" "dists/hoary/Contents-i386.gz"
|
||||||
CFN="$TMP/Contents"
|
index_deb ubuntu-hoary $AMIRROR hoary-security "main multiverse restricted universe" "dists/hoary/Contents-i386.gz"
|
||||||
PFN="$TMP/Packages"
|
;;
|
||||||
printf "" >"$PFN"
|
breezy)
|
||||||
if [ "$CONTENTSURL" != "-" ]; then
|
index_deb ubuntu-breezy $AMIRROR breezy "main multiverse restricted universe"
|
||||||
$CURL "$REPO$CONTENTSURL" -o "$CFN.gz" || return 1
|
index_deb ubuntu-breezy $AMIRROR breezy-updates "main multiverse restricted universe" "dists/breezy/Contents-i386.gz"
|
||||||
gunzip -f "$CFN.gz"
|
index_deb ubuntu-breezy $AMIRROR breezy-security "main multiverse restricted universe" "dists/breezy/Contents-i386.gz"
|
||||||
fi
|
;;
|
||||||
|
dapper)
|
||||||
for CMP in $COMPONENTS; do
|
# dists/dapper/ has an empty Contents-i386.gz; but that's handled properly (by downloading every package -.-).
|
||||||
echo "MANDIFF-COMPONENT: $CMP" >>"$PFN"
|
stdrepo dapper $AMIRROR
|
||||||
TFN="$TMP/Packages-$CMP.bz2"
|
;;
|
||||||
$CURL "${REPO}dists/$DISTRO/$CMP/binary-i386/Packages.bz2" -o "$TFN" 2>/dev/null
|
edgy)
|
||||||
if [ -s "$TFM" ]; then
|
index_deb ubuntu-edgy $AMIRROR edgy "main multiverse restricted universe"
|
||||||
bzcat "$TFN" >>"$PFN"
|
index_deb ubuntu-edgy $AMIRROR edgy-updates "main multiverse restricted universe" "dists/edgy/Contents-i386.gz"
|
||||||
else
|
index_deb ubuntu-edgy $AMIRROR edgy-security "main multiverse restricted universe" "dists/edgy/Contents-i386.gz"
|
||||||
$CURL "${REPO}dists/$DISTRO/$CMP/binary-i386/Packages.gz" -o "$TFN" || return 1
|
;;
|
||||||
zcat "$TFN" >>"$PFN"
|
feisty)
|
||||||
fi
|
stdrepo feisty $AMIRROR
|
||||||
rm "$TFN"
|
;;
|
||||||
done
|
gutsy)
|
||||||
|
stdrepo gutsy $AMIRROR
|
||||||
# Parse the Contents and Packages files and check with the database to figure
|
;;
|
||||||
# out which packages we need to download.
|
hardy)
|
||||||
mkfifo "$TMP/fifo"
|
stdrepo hardy $AMIRROR
|
||||||
perl -l - $CFN $PFN $SYSID <<'EOP' >"$TMP/fifo" &
|
;;
|
||||||
($cfn, $pfn, $sysid) = @ARGV;
|
intrepid)
|
||||||
|
stdrepo intrepid $AMIRROR
|
||||||
use DBI;
|
;;
|
||||||
$db = DBI->connect('dbi:Pg:dbname=manned', 'manned', '', {RaiseError => 1});
|
jaunty)
|
||||||
|
stdrepo jaunty $AMIRROR
|
||||||
open F, '<', $cfn or die $!;
|
;;
|
||||||
while(<F>) {
|
karmic)
|
||||||
chomp; @l=split/ +/;
|
stdrepo karmic $AMIRROR
|
||||||
grep{ s{^.+/([^/]+)$}{$1}; $_ ne"-" and ($pkg{$_}=1) } split/,/, $l[1] if $l[0]=~/\/man\//
|
;;
|
||||||
}
|
lucid)
|
||||||
close F;
|
stdrepo lucid $AMIRROR
|
||||||
|
;;
|
||||||
open F, '<', $pfn or die $!;
|
maverick)
|
||||||
while(<F>) {
|
stdrepo maverick $AMIRROR
|
||||||
chomp;
|
;;
|
||||||
$p = $1 if /^Package: (.+)/;
|
natty)
|
||||||
$v = $1 if /^[Vv]ersion: (.+)/;
|
stdrepo natty $AMIRROR
|
||||||
$s = $1 if /^[Ss]ection: (.+)/;
|
;;
|
||||||
$f = $1 if /^[Ff]ilename: (.+)/;
|
oneiric)
|
||||||
if(!$_) {
|
stdrepo oneiric $AMIRROR
|
||||||
if($p && $v && $s && $f) {
|
;;
|
||||||
$f =~ s{^(Debian-1.[12])/}{dists/$1/main/};
|
precise)
|
||||||
print "$p $v $s $f" if $pkg{$p} && $pkg{$p} == 1
|
stdrepo precise $CMIRROR
|
||||||
&& !$db->selectrow_arrayref(q{
|
;;
|
||||||
SELECT 1 FROM packages p JOIN package_versions pv ON pv.package = p.id
|
quantal)
|
||||||
WHERE p.system = ? AND p.category = ? AND p.name = ? AND pv.version = ?}, {}, $sysid, $s, $p, $v);
|
stdrepo quantal $AMIRROR
|
||||||
#warn "Duplicate package? $p\n" if $pkg{$p} && $pkg{$p} == 2;
|
;;
|
||||||
$pkg{$p} = 2;
|
raring)
|
||||||
}
|
stdrepo raring $AMIRROR
|
||||||
$p=$v=$f=$s=undef
|
;;
|
||||||
}
|
saucy)
|
||||||
}
|
stdrepo saucy $AMIRROR
|
||||||
close F;
|
;;
|
||||||
EOP
|
trusty)
|
||||||
|
stdrepo trusty $CMIRROR
|
||||||
while read l; do
|
;;
|
||||||
checkpkg $SYSID $REPO $l
|
utopic)
|
||||||
done <"$TMP/fifo"
|
stdrepo utopic $AMIRROR
|
||||||
|
;;
|
||||||
rm -f "$TMP/fifo" "$CFN" "$PFN"
|
vivid)
|
||||||
}
|
stdrepo vivid $CMIRROR
|
||||||
|
;;
|
||||||
|
wily)
|
||||||
|
stdrepo wily $CMIRROR
|
||||||
|
;;
|
||||||
# TODO: backports?
|
xenial)
|
||||||
# TODO: Debian testing?
|
stdrepo xenial $CMIRROR
|
||||||
|
;;
|
||||||
ubuntu_warty() {
|
yakkety)
|
||||||
syncrepo 2 "http://old-releases.ubuntu.com/ubuntu/" "warty" "main multiverse restricted universe"
|
stdrepo yakkety $CMIRROR
|
||||||
syncrepo 2 "http://old-releases.ubuntu.com/ubuntu/" "warty-updates" "main multiverse restricted universe" "dists/warty/Contents-i386.gz"
|
;;
|
||||||
syncrepo 2 "http://old-releases.ubuntu.com/ubuntu/" "warty-security" "main multiverse restricted universe" "dists/warty/Contents-i386.gz"
|
old)
|
||||||
}
|
$0 warty
|
||||||
|
$0 hoary
|
||||||
ubuntu_hoary() {
|
$0 breezy
|
||||||
syncrepo 3 "http://old-releases.ubuntu.com/ubuntu/" "hoary" "main multiverse restricted universe"
|
$0 dapper
|
||||||
syncrepo 3 "http://old-releases.ubuntu.com/ubuntu/" "hoary-updates" "main multiverse restricted universe" "dists/hoary/Contents-i386.gz"
|
$0 edgy
|
||||||
syncrepo 3 "http://old-releases.ubuntu.com/ubuntu/" "hoary-security" "main multiverse restricted universe" "dists/hoary/Contents-i386.gz"
|
$0 feisty
|
||||||
}
|
$0 gutsy
|
||||||
|
$0 intrepid
|
||||||
ubuntu_breezy() {
|
$0 jaunty
|
||||||
syncrepo 4 "http://old-releases.ubuntu.com/ubuntu/" "breezy" "main multiverse restricted universe"
|
$0 karmic
|
||||||
syncrepo 4 "http://old-releases.ubuntu.com/ubuntu/" "breezy-updates" "main multiverse restricted universe" "dists/breezy/Contents-i386.gz"
|
$0 lucid
|
||||||
syncrepo 4 "http://old-releases.ubuntu.com/ubuntu/" "breezy-security" "main multiverse restricted universe" "dists/breezy/Contents-i386.gz"
|
$0 maverick
|
||||||
}
|
$0 natty
|
||||||
|
$0 hardy
|
||||||
ubuntu_dapper() {
|
$0 oneiric
|
||||||
# Contents-i386.gz in dists/dapper/ is broken, so try to combine the files from breezy, edgy and Contents-hppa.gz.
|
$0 raring
|
||||||
$CURL "http://old-releases.ubuntu.com/ubuntu/dists/dapper/Contents-hppa.gz" -o "$TMP/Contents-TMP.gz" || return
|
$0 quantal
|
||||||
zcat "$TMP/Contents-TMP.gz" > "$TMP/Contents"
|
$0 saucy
|
||||||
rm "$TMP/Contents-TMP.gz"
|
$0 utopic
|
||||||
$CURL "http://old-releases.ubuntu.com/ubuntu/dists/breezy/Contents-i386.gz" -o "$TMP/Contents-TMP.gz" || return
|
$0 vivid
|
||||||
zcat "$TMP/Contents-TMP.gz" >> "$TMP/Contents"
|
$0 wily
|
||||||
rm "$TMP/Contents-TMP.gz"
|
;;
|
||||||
$CURL "http://old-releases.ubuntu.com/ubuntu/dists/edgy/Contents-i386.gz" -o "$TMP/Contents-TMP.gz" || return
|
current)
|
||||||
zcat "$TMP/Contents-TMP.gz" >> "$TMP/Contents"
|
$0 precise # until 2017-04
|
||||||
rm "$TMP/Contents-TMP.gz"
|
$0 trusty # until 2019-04
|
||||||
syncrepo 5 "http://old-releases.ubuntu.com/ubuntu/" "dapper" "main multiverse restricted universe" -
|
$0 xenial # until 2021-04
|
||||||
|
$0 yakkety # until 2017-07
|
||||||
# -updates and -security do have a functional Contents-i386.gz
|
;;
|
||||||
syncrepo 5 "http://old-releases.ubuntu.com/ubuntu/" "dapper-updates" "main multiverse restricted universe"
|
all)
|
||||||
syncrepo 5 "http://old-releases.ubuntu.com/ubuntu/" "dapper-security" "main multiverse restricted universe"
|
$0 old
|
||||||
}
|
$0 current
|
||||||
|
;;
|
||||||
ubuntu_edgy() {
|
esac
|
||||||
syncrepo 6 "http://old-releases.ubuntu.com/ubuntu/" "edgy" "main multiverse restricted universe"
|
|
||||||
syncrepo 6 "http://old-releases.ubuntu.com/ubuntu/" "edgy-updates" "main multiverse restricted universe" "dists/edgy/Contents-i386.gz"
|
|
||||||
syncrepo 6 "http://old-releases.ubuntu.com/ubuntu/" "edgy-security" "main multiverse restricted universe" "dists/edgy/Contents-i386.gz"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_feisty() {
|
|
||||||
syncrepo 7 "http://old-releases.ubuntu.com/ubuntu/" "feisty" "main multiverse restricted universe"
|
|
||||||
syncrepo 7 "http://old-releases.ubuntu.com/ubuntu/" "feisty-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 7 "http://old-releases.ubuntu.com/ubuntu/" "feisty-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_gutsy() {
|
|
||||||
syncrepo 8 "http://old-releases.ubuntu.com/ubuntu/" "gutsy" "main multiverse restricted universe"
|
|
||||||
syncrepo 8 "http://old-releases.ubuntu.com/ubuntu/" "gutsy-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 8 "http://old-releases.ubuntu.com/ubuntu/" "gutsy-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_hardy() {
|
|
||||||
syncrepo 9 "http://nl.archive.ubuntu.com/ubuntu/" "hardy" "main multiverse restricted universe"
|
|
||||||
syncrepo 9 "http://nl.archive.ubuntu.com/ubuntu/" "hardy-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 9 "http://nl.archive.ubuntu.com/ubuntu/" "hardy-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_intrepid() {
|
|
||||||
syncrepo 10 "http://old-releases.ubuntu.com/ubuntu/" "intrepid" "main multiverse restricted universe"
|
|
||||||
syncrepo 10 "http://old-releases.ubuntu.com/ubuntu/" "intrepid-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 10 "http://old-releases.ubuntu.com/ubuntu/" "intrepid-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_jaunty() {
|
|
||||||
syncrepo 11 "http://old-releases.ubuntu.com/ubuntu/" "jaunty" "main multiverse restricted universe"
|
|
||||||
syncrepo 11 "http://old-releases.ubuntu.com/ubuntu/" "jaunty-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 11 "http://old-releases.ubuntu.com/ubuntu/" "jaunty-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_karmic() {
|
|
||||||
syncrepo 12 "http://old-releases.ubuntu.com/ubuntu/" "karmic" "main multiverse restricted universe"
|
|
||||||
syncrepo 12 "http://old-releases.ubuntu.com/ubuntu/" "karmic-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 12 "http://old-releases.ubuntu.com/ubuntu/" "karmic-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_lucid() {
|
|
||||||
syncrepo 13 "http://nl.archive.ubuntu.com/ubuntu/" "lucid" "main multiverse restricted universe"
|
|
||||||
syncrepo 13 "http://nl.archive.ubuntu.com/ubuntu/" "lucid-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 13 "http://nl.archive.ubuntu.com/ubuntu/" "lucid-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_maverick() {
|
|
||||||
syncrepo 14 "http://nl.archive.ubuntu.com/ubuntu/" "maverick" "main multiverse restricted universe"
|
|
||||||
syncrepo 14 "http://nl.archive.ubuntu.com/ubuntu/" "maverick-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 14 "http://nl.archive.ubuntu.com/ubuntu/" "maverick-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_natty() {
|
|
||||||
syncrepo 15 "http://nl.archive.ubuntu.com/ubuntu/" "natty" "main multiverse restricted universe"
|
|
||||||
syncrepo 15 "http://nl.archive.ubuntu.com/ubuntu/" "natty-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 15 "http://nl.archive.ubuntu.com/ubuntu/" "natty-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_oneiric() {
|
|
||||||
syncrepo 16 "http://nl.archive.ubuntu.com/ubuntu/" "oneiric" "main multiverse restricted universe"
|
|
||||||
syncrepo 16 "http://nl.archive.ubuntu.com/ubuntu/" "oneiric-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 16 "http://nl.archive.ubuntu.com/ubuntu/" "oneiric-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_precise() {
|
|
||||||
syncrepo 17 "http://nl.archive.ubuntu.com/ubuntu/" "precise" "main multiverse restricted universe"
|
|
||||||
syncrepo 17 "http://nl.archive.ubuntu.com/ubuntu/" "precise-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 17 "http://nl.archive.ubuntu.com/ubuntu/" "precise-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_quantal() {
|
|
||||||
syncrepo 81 "http://nl.archive.ubuntu.com/ubuntu/" "quantal" "main multiverse restricted universe"
|
|
||||||
syncrepo 81 "http://nl.archive.ubuntu.com/ubuntu/" "quantal-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 81 "http://nl.archive.ubuntu.com/ubuntu/" "quantal-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_raring() {
|
|
||||||
syncrepo 82 "http://nl.archive.ubuntu.com/ubuntu/" "raring" "main multiverse restricted universe"
|
|
||||||
syncrepo 82 "http://nl.archive.ubuntu.com/ubuntu/" "raring-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 82 "http://nl.archive.ubuntu.com/ubuntu/" "raring-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_saucy() {
|
|
||||||
syncrepo 87 "http://nl.archive.ubuntu.com/ubuntu/" "saucy" "main multiverse restricted universe"
|
|
||||||
syncrepo 87 "http://nl.archive.ubuntu.com/ubuntu/" "saucy-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 87 "http://nl.archive.ubuntu.com/ubuntu/" "saucy-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_trusty() {
|
|
||||||
syncrepo 88 "http://nl.archive.ubuntu.com/ubuntu/" "trusty" "main multiverse restricted universe"
|
|
||||||
syncrepo 88 "http://nl.archive.ubuntu.com/ubuntu/" "trusty-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 88 "http://nl.archive.ubuntu.com/ubuntu/" "trusty-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_utopic() {
|
|
||||||
syncrepo 89 "http://nl.archive.ubuntu.com/ubuntu/" "utopic" "main multiverse restricted universe"
|
|
||||||
syncrepo 89 "http://nl.archive.ubuntu.com/ubuntu/" "utopic-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 89 "http://nl.archive.ubuntu.com/ubuntu/" "utopic-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_vivid() {
|
|
||||||
syncrepo 90 "http://nl.archive.ubuntu.com/ubuntu/" "vivid" "main multiverse restricted universe"
|
|
||||||
syncrepo 90 "http://nl.archive.ubuntu.com/ubuntu/" "vivid-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 90 "http://nl.archive.ubuntu.com/ubuntu/" "vivid-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_wily() {
|
|
||||||
syncrepo 92 "http://nl.archive.ubuntu.com/ubuntu/" "wily" "main multiverse restricted universe"
|
|
||||||
syncrepo 92 "http://nl.archive.ubuntu.com/ubuntu/" "wily-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 92 "http://nl.archive.ubuntu.com/ubuntu/" "wily-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_xenial() {
|
|
||||||
syncrepo 93 "http://nl.archive.ubuntu.com/ubuntu/" "xenial" "main multiverse restricted universe"
|
|
||||||
syncrepo 93 "http://nl.archive.ubuntu.com/ubuntu/" "xenial-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 93 "http://nl.archive.ubuntu.com/ubuntu/" "xenial-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_yakkety() {
|
|
||||||
syncrepo 100 "http://nl.archive.ubuntu.com/ubuntu/" "yakkety" "main multiverse restricted universe"
|
|
||||||
syncrepo 100 "http://nl.archive.ubuntu.com/ubuntu/" "yakkety-updates" "main multiverse restricted universe"
|
|
||||||
syncrepo 100 "http://nl.archive.ubuntu.com/ubuntu/" "yakkety-security" "main multiverse restricted universe"
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_old() {
|
|
||||||
ubuntu_warty
|
|
||||||
ubuntu_hoary
|
|
||||||
ubuntu_breezy
|
|
||||||
ubuntu_dapper
|
|
||||||
ubuntu_edgy
|
|
||||||
ubuntu_feisty
|
|
||||||
ubuntu_gutsy
|
|
||||||
ubuntu_intrepid
|
|
||||||
ubuntu_jaunty
|
|
||||||
ubuntu_karmic
|
|
||||||
ubuntu_lucid
|
|
||||||
ubuntu_maverick
|
|
||||||
ubuntu_natty
|
|
||||||
ubuntu_hardy
|
|
||||||
ubuntu_oneiric
|
|
||||||
ubuntu_raring
|
|
||||||
ubuntu_quantal
|
|
||||||
ubuntu_saucy
|
|
||||||
ubuntu_utopic
|
|
||||||
ubuntu_vivid
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu_active() {
|
|
||||||
ubuntu_precise # until 2017-04
|
|
||||||
ubuntu_trusty # until 2019-04
|
|
||||||
ubuntu_wily # until 2016-07
|
|
||||||
ubuntu_xenial # until 2021-04
|
|
||||||
ubuntu_yakkety # until 2017-07
|
|
||||||
}
|
|
||||||
|
|
||||||
ubuntu() {
|
|
||||||
ubuntu_old
|
|
||||||
ubuntu_active
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
"$@"
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue