[23371] in Source-Commits
/svn/athena r23025 - trunk/debathena/third/openafs/meta
daemon@ATHENA.MIT.EDU (ghudson@MIT.EDU)
Fri Jun 13 15:53:04 2008
Date: Fri, 13 Jun 2008 15:52:31 -0400 (EDT)
From: ghudson@MIT.EDU
Message-Id: <200806131952.PAA25739@drugstore.mit.edu>
To: source-commits@MIT.EDU
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Author: ghudson
Date: 2008-06-13 15:52:30 -0400 (Fri, 13 Jun 2008)
New Revision: 23025
Modified:
trunk/debathena/third/openafs/meta/update-metapackage
Log:
In the OpenAFS update-metapackage script, simplify looking up the
current kernel image version by looking at the dependencies of the
current linux-image-generic metapackage.
Modified: trunk/debathena/third/openafs/meta/update-metapackage
===================================================================
--- trunk/debathena/third/openafs/meta/update-metapackage 2008-06-13 19:21:40 UTC (rev 23024)
+++ trunk/debathena/third/openafs/meta/update-metapackage 2008-06-13 19:52:30 UTC (rev 23025)
@@ -23,22 +23,16 @@
trap 'schroot -e -c "$sid"' EXIT
schroot -r -c "$sid" -u root -- apt-get -qq update
for ktype in generic; do
- # Get a list of packages named linux-image-<version>-<ktype>.
- pkgs=$(schroot -r -c "$sid" -- \
- apt-cache search --names-only "^linux-image-[0-9].*-$ktype"\$ | \
- awk '{print $1}')
-
- # Find the one with the highest version.
- kver=~~~
- for pkg in $pkgs; do
- pkgver=$(echo "$pkg" | sed -e "s/^linux-image-\(.*\)-$ktype/\1/")
- if dpkg --compare-versions "$pkgver" '>' "$kver"; then
- kver=$pkgver
- kpkg=$pkg
- fi
- done
- if [ ~~~ = "$kver" ]; then
- echo "No $ktype kernels found for $dist_arch"
+ # Get info on the current linux-image-<ktype> package. Set mver to
+ # the version of the metapackage and kver to the version of the
+ # image it depends on.
+ info=$(schroot -r -c "$sid" -- \
+ apt-cache show --no-all-versions "linux-image-$ktype")
+ mver=$(echo "$info" | sed -n 's/^Version: //p')
+ kver=$(echo "$info" | \
+ sed -n 's/^Depends: linux-image-\([0-9.-]*\)-generic.*$/\1/p')
+ if [ -z "$mver" -o -z "$kver" ]; then
+ echo "*** Failed to get current version info for $dist_arch $ktype ***"
break
fi
@@ -50,11 +44,6 @@
break
fi
- # Look up the current kernel metapackage version.
- mver=$(schroot -r -c "$sid" -- \
- apt-cache show --no-all-versions "linux-image-$ktype" | \
- sed -n 's/^Version: //p')
-
# Check if we are already up to date.
mpkg=openafs-modules-$ktype
eqname=$dist/$mpkg.equivs