Hello,

/usr/sbin/update-pepperflashplugin-nonfree treats all "apt-get update"
output to stderr as an ERROR.

When "apt-get update" gives the (weak digest) Warning
update-pepperflashplugin-nonfree fails.

Here's a diff to v1.8.2. I tested it by setting stdouterr to different
values and it seems to fix the problem. It also adds checks for SHA256
hashes. Tabs got mangled in copy-paste but should be OK in the attached
file.

# diff -u update-pepperflashplugin-nonfree.1.8.2
update-pepperflashplugin-nonfree
--- update-pepperflashplugin-nonfree.1.8.2      2015-12-17
10:28:04.000000000 -0700
+++ update-pepperflashplugin-nonfree    2016-03-23 20:34:50.803926398 -0700
@@ -174,6 +174,11 @@

        [ "$verbose" != "yes" ] || echo "doing apt-get update on google
repository"
        stdouterr=`APT_CONFIG=apt.conf apt-get --quiet --quiet update 2>&1
|| true`
+       warning_ck=`echo ${stdouterr} |grep "^W\:"` || [ "$verbose" !=
"yes" ] || echo "no 'apt-get update' warning"
+       if [ "${warning_ck}" != "" ]; then
+               echo "WARNING: $stdouterr"
+               stdouterr=""
+       fi
        [ "$stdouterr" = "" ] || die_hard_with_a_cleanup "failed to
retrieve status information from google : $stdouterr"

        newchromeversion=`APT_CONFIG=apt.conf apt-cache show
google-chrome-$variant | grep "^Version: " | sed -e "s,^Version: ,,"`
@@ -181,6 +186,7 @@
        deburl="http://dl.google.com/linux/chrome/deb/$poolfile";
        debfile=`echo $poolfile|sed -e "s,.*/,,"`
        debsize=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant
| grep "^Size: " | sed -e "s,^Size: ,,"`
+       debsha256=`APT_CONFIG=apt.conf apt-cache show
google-chrome-$variant | grep "^SHA256: " | sed -e "s,^SHA256: ,,"`
        debsha1=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant
| grep "^SHA1: " | sed -e "s,^SHA1: ,,"`
        debmd5=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant |
grep "^MD5sum: " | sed -e "s,^MD5sum: ,,"`

@@ -235,6 +241,7 @@
                                HOME=/root wget $wgetoptions $deburl ||
die_hard_with_a_cleanup "wget failed to download $deburl"

                                [ `stat --format=%s $debfile` = "$debsize"
] || die_hard_with_a_cleanup "rejecting $debfile : wrong size"
+                               [ `sha256sum $debfile|sed -e "s, .*,,"` =
"$debsha256" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong
sha256sum"
                                [ `sha1sum $debfile|sed -e "s, .*,,"` =
"$debsha1" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong sha1sum"
                                [ `md5sum $debfile|sed -e "s, .*,,"` =
"$debmd5" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong md5sum"
                        fi


Hope this helps someone...

-Barry
--- update-pepperflashplugin-nonfree.1.8.2	2015-12-17 10:28:04.000000000 -0700
+++ update-pepperflashplugin-nonfree	2016-03-23 20:34:50.803926398 -0700
@@ -174,6 +174,11 @@
 
 	[ "$verbose" != "yes" ] || echo "doing apt-get update on google repository"
 	stdouterr=`APT_CONFIG=apt.conf apt-get --quiet --quiet update 2>&1 || true`
+	warning_ck=`echo ${stdouterr} |grep "^W\:"` || [ "$verbose" != "yes" ] || echo "no 'apt-get update' warning"
+	if [ "${warning_ck}" != "" ]; then
+		echo "WARNING: $stdouterr"
+		stdouterr=""
+	fi
 	[ "$stdouterr" = "" ] || die_hard_with_a_cleanup "failed to retrieve status information from google : $stdouterr"
 
 	newchromeversion=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^Version: " | sed -e "s,^Version: ,,"`
@@ -181,6 +186,7 @@
 	deburl="http://dl.google.com/linux/chrome/deb/$poolfile";
 	debfile=`echo $poolfile|sed -e "s,.*/,,"`
 	debsize=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^Size: " | sed -e "s,^Size: ,,"`
+	debsha256=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^SHA256: " | sed -e "s,^SHA256: ,,"`
 	debsha1=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^SHA1: " | sed -e "s,^SHA1: ,,"`
 	debmd5=`APT_CONFIG=apt.conf apt-cache show google-chrome-$variant | grep "^MD5sum: " | sed -e "s,^MD5sum: ,,"`
 
@@ -235,6 +241,7 @@
 				HOME=/root wget $wgetoptions $deburl || die_hard_with_a_cleanup "wget failed to download $deburl"
 	
 				[ `stat --format=%s $debfile` = "$debsize" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong size"
+				[ `sha256sum $debfile|sed -e "s, .*,,"` = "$debsha256" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong sha256sum"
 				[ `sha1sum $debfile|sed -e "s, .*,,"` = "$debsha1" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong sha1sum"
 				[ `md5sum $debfile|sed -e "s, .*,,"` = "$debmd5" ] || die_hard_with_a_cleanup "rejecting $debfile : wrong md5sum"
 			fi

Reply via email to