forked from endlessm/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update-version-dkms
executable file
·56 lines (51 loc) · 1.49 KB
/
update-version-dkms
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
#!/bin/bash
if [ "$#" -ne 1 ]; then
echo "Usage: $0 <pocket>" 1>&2
exit 1
fi
pocket="$1"
case "$pocket" in
proposed) pocket_list="-$pocket -updates -release" ;;
updates|security) pocket_list="-$pocket -release" ;;
release) pocket_list="-release" ;;
*)
echo "$0: $pocket: unknown archive pocket" 1>&2
exit 1
;;
esac
# find our changelog.
debian=$(awk -F= '($1 == "DEBIAN") { print $2 }' <debian/debian.env)
# identify the current series
series=$(dpkg-parsechangelog -l"$debian/changelog" -SDistribution)
if [ "$series" = "UNRELEASED" ]; then
series=$(dpkg-parsechangelog -l"$debian/changelog" -c1 -o1 -SDistribution)
fi
# Determine if we have any updates.
: >"debian/dkms-versions.new"
while read package version
do
for pocket_raw in $pocket_list
do
pocket="${pocket_raw#-release}"
read x x pocket_version x <<EOL
$(rmadison -a source -s "$series$pocket" $package)
EOL
[ "$pocket_version" != '' ] && break
done
if [ "$pocket_version" = '' ]; then
echo "$0: $package: no version found in $pocket_list" 1>&2
exit 1
else
echo "$package: $pocket_version found in $pocket_raw"
fi
if [ "$version" != "$pocket_version" ]; then
echo "$package: updated to $pocket_version"
fi
echo "$package $pocket_version" >>"debian/dkms-versions.new"
done <"debian/dkms-versions"
if ! cmp -s "debian/dkms-versions.new" "debian/dkms-versions"; then
mv -f "debian/dkms-versions.new" "debian/dkms-versions"
git commit -a -s -m "UBUNTU: update dkms package versions"
else
rm -f "debian/dkms-versions.new"
fi