[debian-edu-commits] debian-edu/ 01/01: Update auto-addfirmware from changes done in isenkram, fix bug #729438 also found in isenkram.

Petter Reinholdtsen pere at moszumanska.debian.org
Thu Aug 28 08:39:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

pere pushed a commit to branch master
in repository debian-edu-config.

commit e5d95a0dfd7ac25883494dc340e2b43e28d8ea05
Author: Petter Reinholdtsen <pere at hungry.com>
Date:   Thu Aug 28 10:39:19 2014 +0200

    Update auto-addfirmware from changes done in isenkram, fix bug #729438 also found in isenkram.
---
 debian/changelog                               |  2 ++
 share/debian-edu-config/tools/auto-addfirmware | 28 +++++++++++++++++---------
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 2b7ab0f..ad085c4 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,6 +1,8 @@
 debian-edu-config (1.723) UNRELEASED; urgency=low
 
   * Fix typo in shell test in sssd-generate-config.
+  * Update auto-addfirmware from changes done in isenkram, fix bug
+    #729438 also found in isenkram.
 
  -- Petter Reinholdtsen <pere at debian.org>  Wed, 27 Aug 2014 20:33:57 +0200
 
diff --git a/share/debian-edu-config/tools/auto-addfirmware b/share/debian-edu-config/tools/auto-addfirmware
index 1c6cee6..f358546 100644
--- a/share/debian-edu-config/tools/auto-addfirmware
+++ b/share/debian-edu-config/tools/auto-addfirmware
@@ -8,6 +8,10 @@ arch=$(dpkg --print-architecture)
 mirror=http://http.debian.net/debian
 aptsourcelist=/etc/apt/sources.list.d/auto-addfirmware.list
 
+loginfo() {
+    echo "info: $@" 1>&2
+}
+
 add_contrib_nonfree() {
     cat <<EOF > $aptsourcelist
 deb $mirror $dist contrib non-free
@@ -24,10 +28,10 @@ for fwfile in $(for module in $(awk '{print $1}' /proc/modules) ; do modinfo $mo
 done
 
 if [ -z "$fwfiles" ] ; then
-    echo "info: did not find any firmware files requested by loaded kernel modules.  exiting"
+    loginfo "did not find any firmware files requested by loaded kernel modules.  exiting"
     exit 1
 fi
-echo "info: kernel drivers requested extra firmware:" $fwfiles
+loginfo "some kernel driver requested extra firmware files:" $fwfiles
 
 tmpdir=$(mktemp -d)
 cd $tmpdir || exit 1
@@ -44,11 +48,11 @@ for section in "" "contrib" "non-free"; do
     else
 	url="$mirror/dists/$dist/$section/Contents-$arch.gz"
     fi
-    echo "info: fetching $url"
+    loginfo "fetching $url"
     GET $url | gunzip | grep ^lib/firmware > Fw-Contents-$arch$section
 done
 
-echo "info: locating packages with the requested firmware files"
+loginfo "locating packages with the requested firmware files"
 binpkginfos=""
 binpkgs=""
 for fwfile in $fwfiles ; do
@@ -73,7 +77,7 @@ for binpkginfo in $binpkginfos ; do
     echo $binpkginfo |  while IFS=/ read section srcpkg binpkg ; do
         echo $binpkg
 # Enable the non-free section if it is needed
-	if ! LC_ALL=C apt-cache show $binpkg 2>&1 | \
+	if LC_ALL=C apt-cache show $binpkg 2>&1 | \
                grep -q 'E: No packages found' \
            && ( [ non-free = "$section" ] \
                || [ contrib = "$section" ] ) ; then 
@@ -84,15 +88,19 @@ done)"
 
 if [ -e $aptsourcelist ] ; then
     # Fetch updated package lists
-    echo "info: Updating APT sources after adding non-free APT source"
+    loginfo "Updating APT sources after adding non-free APT source"
     apt-get -qq update
 fi
 
 if [ "$binpkgs" ] ; then
-    # Install firmware packages
-    echo "info: trying to install $binpkgs"
-    apt-get -qq install -y $binpkgs
+    if [ "-l" = "$1" ] ; then
+	echo $binpkgs | tr " " "\n"
+    else
+        # Install firmware packages
+	loginfo "trying to install $binpkgs"
+	apt-get -qq install -y $binpkgs
+    fi
 else
-    echo "info: No new firmware package with requested firmware detected."
+    loginfo "No new firmware package with requested firmware detected."
 fi
 cleanup

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-edu/debian-edu-config.git



More information about the debian-edu-commits mailing list