Package: flashplugin-nonfree
Version: 1:3.7
Followup-For: Bug #851066

        Okay, attached is that patch I mentioned in my previous message.
This patch adds a new option to update-flashplugin-nonfree:

----
        --using <tarfile>
        Specifies the name of a local tar file instead of attempting to
discover and download the latest version.  This file is presumed to be a tar
file downloaded by hand from Adobe.com, containing the flash plugin
appropriate for your machine arch.  No checks are performed to ensure the
tar file is authentic; you should download such plugins *only* from
Adobe.com.
----

        Hmm.  Now that I think about it, I should update the docs, too.

        Seems to work well for me.  Feedback welcome.

                                        Schwab


-- Package-specific info:
Debian version: 9.0
Architecture: amd64
Package version: 1:3.7
Adobe Flash Player version: [@LNX 25,0,0,148
MD5 checksums:
        d03f607cf2814884d0db497dff934b34  
/var/cache/flashplugin-nonfree/flash_player_npapi_linux.x86_64.tar.gz
        29c85bc8504422120cf89702986ff8e1  
/var/cache/flashplugin-nonfree/get-upstream-version.pl
        82cd4f82b2023fad1d43092de8e002a7  
/var/cache/flashplugin-nonfree/install_flash_player_11_linux.x86_64.tar.gz
        f9210feb0ef3aa6c65fad905eb2e1aa2  
/usr/lib/flashplugin-nonfree/libflashplayer.so
Alternatives:
        flash-mozilla.so - auto mode
          link best version is /usr/lib/flashplugin-nonfree/libflashplayer.so
          link currently points to 
/usr/lib/flashplugin-nonfree/libflashplayer.so
          link flash-mozilla.so is /usr/lib/mozilla/plugins/flash-mozilla.so
        /usr/lib/flashplugin-nonfree/libflashplayer.so - priority 50
        lrwxrwxrwx 1 root root 34 Aug  4  2016 
/usr/lib/mozilla/plugins/flash-mozilla.so -> /etc/alternatives/flash-mozilla.so
        /usr/lib/mozilla/plugins/flash-mozilla.so: symbolic link to 
/etc/alternatives/flash-mozilla.so

-- System Information:
Debian Release: 9.0
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64
 (x86_64)

Kernel: Linux 4.9.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages flashplugin-nonfree depends on:
ii  binutils               2.28-4
ii  ca-certificates        20161130
ii  debconf [debconf-2.0]  1.5.60
ii  gnupg                  2.1.18-6
ii  gnupg2                 2.1.18-6
ii  libatk1.0-0            2.22.0-1
ii  libcairo2              1.14.8-1
ii  libcurl3-gnutls        7.52.1-5
ii  libfontconfig1         2.11.0-6.7+b1
ii  libfreetype6           2.6.3-3.1
ii  libgcc1                1:6.3.0-14
ii  libglib2.0-0           2.50.3-2
ii  libgtk2.0-0            2.24.31-2
ii  libnspr4               2:4.12-6
ii  libnss3                2:3.26.2-1
ii  libpango1.0-0          1.40.5-1
ii  libstdc++6             6.3.0-14
ii  libx11-6               2:1.6.4-3
ii  libxext6               2:1.3.3-1+b2
ii  libxt6                 1:1.1.5-1
ii  wget                   1.19.1-3

flashplugin-nonfree recommends no packages.

Versions of packages flashplugin-nonfree suggests:
pn  firefox-esr                <none>
ii  fonts-dejavu               2.37-1
pn  hal-flash                  <none>
pn  iceweasel                  <none>
pn  konqueror-nsplugins        <none>
ii  ttf-mscorefonts-installer  3.6
pn  ttf-xfree86-nonfree        <none>

-- no debconf information
diff --git a/update-flashplugin-nonfree b/update-flashplugin-nonfree
index dac8e8f..d63fa36 100755
--- a/update-flashplugin-nonfree
+++ b/update-flashplugin-nonfree
@@ -39,16 +39,19 @@ show_usage() {
        echo "Additional options:"
        echo "  --verbose"
        echo "  --quiet"
+       echo "  --using <tarfile>"
        exit 1
 }
 
-getopt_temp=`getopt -o iusfvqn --long 
install,uninstall,status,fast,verbose,quiet -n 'update-flashplugin-nonfree' -- 
"$@"` || show_usage
+getopt_temp=`getopt -o iusfvqn --long 
install,uninstall,status,fast,verbose,quiet,using: -n 
'update-flashplugin-nonfree' -- "$@"` || show_usage
 eval set -- "$getopt_temp" || show_usage
 
 ACTION=none
 fast=no
 verbose=no
 quiet=no
+localtarfile=""
+localtarfile_fp=""
 
 GREP_OPTIONS=
 
@@ -87,6 +90,11 @@ do
                        quiet=yes
                        shift
                        ;;
+               --using)
+                       localtarfile="$2"
+                       shift
+                       shift
+                       ;;
                --)
                        shift
                        break
@@ -103,6 +111,11 @@ done
 
 [ "$verbose" != "yes" ] || echo "options : $getopt_temp"
 
+if [ "$localtarfile" != "" ]; then
+       [ -f "$localtarfile" ] || die_hard "$localtarfile: file not found"
+       localtarfile_fp=`realpath "$localtarfile"`
+fi
+
 UNPACKDIR=`mktemp -d /tmp/flashplugin-nonfree.XXXXXXXXXX` || die_hard "mktemp 
failed"
 echo "$UNPACKDIR" | grep -q "^/tmp/flashplugin-nonfree\." || die_hard 
"paranoia"
 cd "$UNPACKDIR" || die_hard "cd failed"
@@ -260,13 +273,15 @@ remove_extrafiles() {
        rm -f /var/lib/flashplugin-nonfree/extrafiles.md5sums
 }
 
-case "$ACTION" in
+do_install() {
+       [ "$verbose" != "yes" ] || echo "selected action = $ACTION"
 
-       --install)
-               [ "$verbose" != "yes" ] || echo "selected action = $ACTION"
+       get_installed_version
+       [ "$verbose" != "yes" ] || echo "installed version = $installed"
 
-               get_installed_version
-               [ "$verbose" != "yes" ] || echo "installed version = $installed"
+       if [ "$localtarfile" = "" ]
+       then
+               # Attempt to download tar file from Adobe using metadata from 
debian.org.
 
                get_upstream_version
                [ "$verbose" != "yes" ] || echo "upstream version = $upstream"
@@ -275,132 +290,151 @@ case "$ACTION" in
                then
 
                        [ "$verbose" != "yes" ] || echo "upstream version 
$upstream is already installed"
+                       return
 
                elif [ "$hassse2" = "no" ]
                then
 
                        echo "Version $upstream needs sse2 and this system 
doesn't have that." >&2
+                       return
+
+               fi
+
+               wgetoptions="$wgetquiet $wgetalways"
+               [ "$verbose" != "yes" ] || wgetoptions="$wgetalways 
$wgetprogress"
+               [ "$fast" != "yes" ] || wgetoptions="$wgetoptions $wgetfast"
+               [ "$verbose" != "yes" ] || echo "wgetoptions=$wgetoptions"
+
+               downloadfile=fp.$upstream.sha512.i386.pgp.asc
+               [ `dpkg --print-architecture` != "amd64" ] || 
downloadfile=fp.$upstream.sha512.amd64.pgp.asc
+               
downloadurl=http://people.debian.org/~bartm/flashplugin-nonfree/D5C0FC14/$downloadfile
+
+               [ "$verbose" != "yes" ] || echo "downloading $downloadurl ..."
+               HOME=/root \
+               wget $wgetoptions $downloadurl \
+                       || die_hard_with_a_cleanup "wget failed to download 
$downloadurl"
+
+               [ "$verbose" != "yes" ] || echo "verifying PGP $downloadfile 
..."
+               gpg -q --homedir "." --verify $downloadfile 2> /dev/null \
+                       || die_hard_with_a_cleanup "gpg rejected signature of 
$downloadurl"
+               gpg -q --homedir "." < $downloadfile > checksums.txt 2> 
/dev/null \
+                       || die_hard_with_a_cleanup "gpg rejected signature of 
$downloadurl"
+
+               downloadfile=`head -n 1 < checksums.txt | cut -c 131-`
+
+               [ "$verbose" != "yes" ] || [ ! -f $cachedir/$downloadfile ] || 
echo "copying $cachedir/$downloadfile ..."
+               [ ! -f $cachedir/$downloadfile ] || cp -p 
$cachedir/$downloadfile .
+               [ "$verbose" != "yes" ] || [ ! -f $downloadfile ] || echo 
"verifying checksum $downloadfile ..."
+               [ ! -f $downloadfile ] || grep $downloadfile checksums.txt | 
sha512sum -c - > /dev/null 2>&1 || rm -f $downloadfile
+
+               downloaddir=`tail -n 1 < checksums.txt`
+               downloadurl=$downloaddir/$downloadfile
+
+               wgetoptions="$wgetalways $wgetprogress"
+               [ "$quiet" != "yes" ] || wgetoptions="$wgetquiet $wgetalways"
+               [ "$fast" != "yes" ] || wgetoptions="$wgetoptions $wgetfast"
+               wgetoptions="$wgetoptions -O $UNPACKDIR/$downloadfile" # to 
change wget's message "Saving to: ..."
+               [ "$verbose" != "yes" ] || echo "wgetoptions=$wgetoptions"
+
+               [ "$verbose" != "yes" ] || [ ! -f $downloadfile ] || echo 
"downloading $downloadurl ..."
+               [ -f $downloadfile ] || \
+               HOME=/root \
+               wget $wgetoptions $downloadurl \
+                       || die_hard_with_a_cleanup "wget failed to download 
$downloadurl"
+               [ "$verbose" != "yes" ] || echo "verifying checksum 
$downloadfile ..."
+               grep tar.gz checksums.txt | sha512sum -c - > /dev/null 2>&1 \
+                       || die_hard_with_a_cleanup "sha512sum rejected 
$downloadfile"
+               [ "$verbose" != "yes" ] || echo "unpacking $downloadfile ..."
+               tar xozf $downloadfile
+               [ "$verbose" != "yes" ] || echo "verifying checksum contents of 
$downloadfile ..."
+               head -n 2 < checksums.txt | sha512sum -c - > /dev/null 2>&1 \
+                       || die_hard_with_a_cleanup "sha512sum rejected a part 
of $downloadfile"
+
+               libflashplayerdotso=`grep "  .*libflashplayer\.so$" 
checksums.txt | cut -c 131-`
+
+       else
+               # Unpack already-downloaded local tar file.
+               downloadfile=`basename "$localtarfile"`
+               [ "$verbose" != "yes" ] || echo "copying $localtarfile ..."
+               cp -a "$localtarfile_fp" "$UNPACKDIR"
+               [ "$verbose" != "yes" ] || echo "unpacking $downloadfile ..."
+               tar xozf $downloadfile
+
+               libflashplayerdotso=`find . -name '*libflashplayer.so' -print | 
head -n 1`
+       fi
+
+       targetdir=/usr/lib/flashplugin-nonfree
+
+       [ "$verbose" != "yes" ] || echo "moving $libflashplayerdotso to 
$targetdir ..."
+       rm -f $targetdir/flashplayer.xpt
+       mv -f $libflashplayerdotso $targetdir
+
+       [ "$verbose" != "yes" ] || echo "setting permissions and ownership of 
$targetdir/libflashplayer.so ..."
+       chown root:root $targetdir/libflashplayer.so
+       chmod 644 $targetdir/libflashplayer.so
+
+       [ "$verbose" != "yes" ] || ( get_installed_version && echo "Flash 
Player version: $installed" )
+
+       [ "$verbose" != "yes" ] || echo "moving $downloadfile to $cachedir ..."
+       mv -f $downloadfile $cachedir
 
+       fix_missing_symlink || true
+
+       [ "$verbose" != "yes" ] || \
+       update-alternatives --display flash-mozilla.so || true
+
+       [ "$verbose" != "yes" ] || echo "calling update-alternatives ..."
+       update-alternatives --quiet --install \
+               /usr/lib/mozilla/plugins/flash-mozilla.so flash-mozilla.so \
+               /usr/lib/flashplugin-nonfree/libflashplayer.so 50 \
+               || die_hard_with_a_cleanup "update-alternatives failed to 
install flash-mozilla.so"
+
+       [ "$verbose" != "yes" ] || \
+       update-alternatives --display flash-mozilla.so || true
+
+       [ "$quiet" != "no" ] || \
+       warning_about_alternatives
+
+       remove_extrafiles
+
+       for sourcefile in \
+               usr/bin/flash-player-properties \
+               usr/share/applications/flash-player-properties.desktop \
+               usr/share/icons/hicolor/16x16/apps/flash-player-properties.png \
+               usr/share/icons/hicolor/22x22/apps/flash-player-properties.png \
+               usr/share/icons/hicolor/24x24/apps/flash-player-properties.png \
+               usr/share/icons/hicolor/32x32/apps/flash-player-properties.png \
+               usr/share/icons/hicolor/48x48/apps/flash-player-properties.png \
+               usr/share/pixmaps/flash-player-properties.png \
+               ;
+       do
+               if [ ! -e $sourcefile ]
+               then
+                       echo "not found in tarball: $sourcefile" >&2
                else
-                       wgetoptions="$wgetquiet $wgetalways"
-                       [ "$verbose" != "yes" ] || wgetoptions="$wgetalways 
$wgetprogress"
-                       [ "$fast" != "yes" ] || wgetoptions="$wgetoptions 
$wgetfast"
-                       [ "$verbose" != "yes" ] || echo 
"wgetoptions=$wgetoptions"
-
-                       downloadfile=fp.$upstream.sha512.i386.pgp.asc
-                       [ `dpkg --print-architecture` != "amd64" ] || 
downloadfile=fp.$upstream.sha512.amd64.pgp.asc
-                       
downloadurl=http://people.debian.org/~bartm/flashplugin-nonfree/D5C0FC14/$downloadfile
-
-                       [ "$verbose" != "yes" ] || echo "downloading 
$downloadurl ..."
-                       HOME=/root \
-                       wget $wgetoptions $downloadurl \
-                               || die_hard_with_a_cleanup "wget failed to 
download $downloadurl"
-
-                       [ "$verbose" != "yes" ] || echo "verifying PGP 
$downloadfile ..."
-                       gpg -q --homedir "." --verify $downloadfile 2> 
/dev/null \
-                               || die_hard_with_a_cleanup "gpg rejected 
signature of $downloadurl"
-                       gpg -q --homedir "." < $downloadfile > checksums.txt 2> 
/dev/null \
-                               || die_hard_with_a_cleanup "gpg rejected 
signature of $downloadurl"
-
-                       downloadfile=`head -n 1 < checksums.txt | cut -c 131-`
-
-                       [ "$verbose" != "yes" ] || [ ! -f 
$cachedir/$downloadfile ] || echo "copying $cachedir/$downloadfile ..."
-                       [ ! -f $cachedir/$downloadfile ] || cp -p 
$cachedir/$downloadfile .
-                       [ "$verbose" != "yes" ] || [ ! -f $downloadfile ] || 
echo "verifying checksum $downloadfile ..."
-                       [ ! -f $downloadfile ] || grep $downloadfile 
checksums.txt | sha512sum -c - > /dev/null 2>&1 || rm -f $downloadfile
-
-                       downloaddir=`tail -n 1 < checksums.txt`
-                       downloadurl=$downloaddir/$downloadfile
-
-                       wgetoptions="$wgetalways $wgetprogress"
-                       [ "$quiet" != "yes" ] || wgetoptions="$wgetquiet 
$wgetalways"
-                       [ "$fast" != "yes" ] || wgetoptions="$wgetoptions 
$wgetfast"
-                       wgetoptions="$wgetoptions -O $UNPACKDIR/$downloadfile" 
# to change wget's message "Saving to: ..."
-                       [ "$verbose" != "yes" ] || echo 
"wgetoptions=$wgetoptions"
-
-                       [ "$verbose" != "yes" ] || [ ! -f $downloadfile ] || 
echo "downloading $downloadurl ..."
-                       [ -f $downloadfile ] || \
-                       HOME=/root \
-                       wget $wgetoptions $downloadurl \
-                               || die_hard_with_a_cleanup "wget failed to 
download $downloadurl"
-                       [ "$verbose" != "yes" ] || echo "verifying checksum 
$downloadfile ..."
-                       grep tar.gz checksums.txt | sha512sum -c - > /dev/null 
2>&1 \
-                               || die_hard_with_a_cleanup "sha512sum rejected 
$downloadfile"
-                       [ "$verbose" != "yes" ] || echo "unpacking 
$downloadfile ..."
-                       tar xozf $downloadfile
-                       [ "$verbose" != "yes" ] || echo "verifying checksum 
contents of $downloadfile ..."
-                       head -n 2 < checksums.txt | sha512sum -c - > /dev/null 
2>&1 \
-                               || die_hard_with_a_cleanup "sha512sum rejected 
a part of $downloadfile"
-
-                       targetdir=/usr/lib/flashplugin-nonfree
-                       libflashplayerdotso=`grep "  .*libflashplayer\.so$" 
checksums.txt | cut -c 131-`
-
-                       [ "$verbose" != "yes" ] || echo "moving 
$libflashplayerdotso to $targetdir ..."
-                       rm -f $targetdir/flashplayer.xpt
-                       mv -f $libflashplayerdotso $targetdir
-
-                       [ "$verbose" != "yes" ] || echo "setting permissions 
and ownership of $targetdir/libflashplayer.so ..."
-                       chown root:root $targetdir/libflashplayer.so
-                       chmod 644 $targetdir/libflashplayer.so
-
-                       [ "$verbose" != "yes" ] || ( get_installed_version && 
echo "Flash Player version: $installed" )
-
-                       [ "$verbose" != "yes" ] || echo "moving $downloadfile 
to $cachedir ..."
-                       mv -f $downloadfile $cachedir
-
-                       fix_missing_symlink || true
-
-                       [ "$verbose" != "yes" ] || \
-                       update-alternatives --display flash-mozilla.so || true
-
-                       [ "$verbose" != "yes" ] || echo "calling 
update-alternatives ..."
-                       update-alternatives --quiet --install \
-                               /usr/lib/mozilla/plugins/flash-mozilla.so 
flash-mozilla.so \
-                               /usr/lib/flashplugin-nonfree/libflashplayer.so 
50 \
-                               || die_hard_with_a_cleanup "update-alternatives 
failed to install flash-mozilla.so"
-
-                       [ "$verbose" != "yes" ] || \
-                       update-alternatives --display flash-mozilla.so || true
-
-                       [ "$quiet" != "no" ] || \
-                       warning_about_alternatives
-
-                       remove_extrafiles
-
-                       for sourcefile in \
-                               usr/bin/flash-player-properties \
-                               
usr/share/applications/flash-player-properties.desktop \
-                               
usr/share/icons/hicolor/16x16/apps/flash-player-properties.png \
-                               
usr/share/icons/hicolor/22x22/apps/flash-player-properties.png \
-                               
usr/share/icons/hicolor/24x24/apps/flash-player-properties.png \
-                               
usr/share/icons/hicolor/32x32/apps/flash-player-properties.png \
-                               
usr/share/icons/hicolor/48x48/apps/flash-player-properties.png \
-                               usr/share/pixmaps/flash-player-properties.png \
-                               ;
-                       do
-                               if [ ! -e $sourcefile ]
-                               then
-                                       echo "not found in tarball: 
$sourcefile" >&2
-                               else
-                                       targetfile="/$sourcefile"
-
-                                       if [ -e $targetfile ]
-                                       then
-                                               echo "already exists: 
$targetfile" >&2
-                                       else
-                                               [ "$verbose" != "yes" ] || echo 
"installing $targetfile"
-
-                                               md5sum $sourcefile >> 
/var/lib/flashplugin-nonfree/extrafiles.md5sums
-                                               cp $sourcefile $targetfile
-                                               chown root:root $targetfile
-                                               chmod g-w $targetfile
-                                       fi
-                               fi
-                       done
-
-               fi # end if installed != upstream
+                       targetfile="/$sourcefile"
 
-               [ "$verbose" != "yes" ] || echo "end of action $ACTION"
+                       if [ -e $targetfile ]
+                       then
+                               echo "already exists: $targetfile" >&2
+                       else
+                               [ "$verbose" != "yes" ] || echo "installing 
$targetfile"
+
+                               md5sum $sourcefile >> 
/var/lib/flashplugin-nonfree/extrafiles.md5sums
+                               cp $sourcefile $targetfile
+                               chown root:root $targetfile
+                               chmod g-w $targetfile
+                       fi
+               fi
+       done
+
+       [ "$verbose" != "yes" ] || echo "end of action $ACTION"
+}
+
+case "$ACTION" in
+
+       --install)
+               do_install
 
                ;;
 

Reply via email to