~brian-murray/ubuntu-archive-scripts/remove-vintage-packages

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#! /bin/bash
set -e

cd ~/public_html/seeds
if ! lockfile -r2 .update.lock; then
	exit 1
fi
trap 'rm -f .update.lock' EXIT HUP INT QUIT TERM

ONLY_SERIES="$1"

for dist in platform.{precise,trusty,xenial,bionic,focal,groovy,hirsute} \
            ubuntu.{precise,trusty,xenial,bionic,focal,groovy,hirsute} \
            kubuntu.{precise,trusty,xenial,bionic,focal,groovy,hirsute} \
            kubuntu-active.{precise,trusty} \
            edubuntu.{precise,trusty,xenial} \
            xubuntu.{precise,trusty,xenial,bionic,focal,groovy,hirsute} \
            i386.{focal,groovy,hirsute} \
            netbook.precise \
            mythbuntu.{precise,trusty,xenial} \
            ubuntustudio.{precise,trusty,xenial,bionic,focal,groovy,hirsute} \
            lubuntu.{precise,trusty,xenial,bionic,focal,groovy,hirsute} \
            ubuntu-gnome.xenial \
            ubuntu-touch.{trusty,xenial} \
            ubuntukylin.{trusty,xenial,bionic,focal,groovy,hirsute} \
            ubuntu-core.{xenial,bionic,focal,groovy,hirsute} \
            ubuntu-mate.{xenial,bionic,focal,groovy,hirsute} \
            ubuntu-budgie.{bionic,focal,groovy,hirsute}; do
	if [ "$ONLY_SERIES" ]; then
		case $dist in
			*.$ONLY_SERIES)
				;;
			*)
				continue
				;;
		esac
	fi

	case $dist in
		kubuntu.*|kubuntu-active.*|kubuntu-plasma5.*)
			branch="http://bazaar.launchpad.net/~kubuntu-dev/ubuntu-seeds/$dist"
			;;
		xubuntu.*)
			branch="https://git.launchpad.net/~xubuntu-dev/ubuntu-seeds/+git/xubuntu"
			;;
		mythbuntu.*)
			branch="http://bazaar.launchpad.net/~mythbuntu-dev/ubuntu-seeds/$dist"
			;;
		ubuntustudio.*)
			branch="https://git.launchpad.net/~ubuntustudio-dev/ubuntu-seeds/+git/ubuntustudio"
			;;
		lubuntu.*)
			branch="https://git.launchpad.net/~lubuntu-dev/ubuntu-seeds/+git/lubuntu"
			;;
		ubuntu-gnome.*)
			branch="https://git.launchpad.net/~ubuntu-gnome-dev/ubuntu-seeds/+git/ubuntu-gnome"
			;;
		ubuntukylin.*)
			branch="https://git.launchpad.net/~ubuntukylin-members/ubuntu-seeds/+git/ubuntukylin"
			;;
		ubuntu-mate.*)
			branch="http://bazaar.launchpad.net/~ubuntu-mate-dev/ubuntu-seeds/$dist"
			;;
		ubuntu-budgie.*)
			branch="http://bazaar.launchpad.net/~ubuntubudgie-dev/ubuntu-seeds/$dist"
			;;
		*)
			branch="https://git.launchpad.net/~ubuntu-core-dev/ubuntu-seeds/+git/${dist%.*}"
			;;
	esac
	case $branch in
		*bazaar*)
			git=
			;;
		*)
			git=yes
			;;
	esac
	if [ -d "$dist" ]; then
		if [ -n "$git" ]; then
			git -C "$dist" pull -f >/dev/null 2>&1
		else
			bzr pull -d "$dist" --overwrite --remember "$branch" >/dev/null 2>&1
		fi
	else
		if [ -n "$git" ]; then
			git clone -b "$(echo $dist | sed 's/.*\.//')" "$branch" "$dist" >/dev/null 2>&1
		else
			bzr branch "$branch" >/dev/null 2>&1
		fi
	fi
done