mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-24 10:02:29 +01:00
multimedia/youtube-viewer: Updated for version 3.3.2.
Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
parent
ed1cbff78c
commit
033e1e3b33
3 changed files with 66 additions and 4 deletions
51
multimedia/youtube-viewer/fix_history.diff
Normal file
51
multimedia/youtube-viewer/fix_history.diff
Normal file
|
@ -0,0 +1,51 @@
|
||||||
|
diff --git a/bin/youtube-viewer b/bin/youtube-viewer
|
||||||
|
index 7aff691..28b4ed5 100755
|
||||||
|
--- a/bin/youtube-viewer
|
||||||
|
+++ b/bin/youtube-viewer
|
||||||
|
@@ -538,25 +538,22 @@ if ($opt{history}) {
|
||||||
|
or warn "[!] Can't create the history file `$opt{history_file}': $!";
|
||||||
|
}
|
||||||
|
|
||||||
|
- if ($term->can('ReadHistory')) {
|
||||||
|
+ # Add history to Term::ReadLine
|
||||||
|
+ $term->ReadHistory($opt{history_file});
|
||||||
|
|
||||||
|
- # Add history to Term::ReadLine
|
||||||
|
- $term->ReadHistory($opt{history_file});
|
||||||
|
+ # All history entries
|
||||||
|
+ my @entries = $term->history_list;
|
||||||
|
|
||||||
|
- # All history entries
|
||||||
|
- my @entries = $term->history_list;
|
||||||
|
+ # Rewrite the history file, when the history_limit has been reached.
|
||||||
|
+ if ($opt{history_limit} > 0 and @entries > $opt{history_limit}) {
|
||||||
|
|
||||||
|
- # Rewrite the history file, when the history_limit has been reached.
|
||||||
|
- if ($opt{history_limit} > 0 and @entries > $opt{history_limit}) {
|
||||||
|
-
|
||||||
|
- # Try to create a backup, first
|
||||||
|
- require File::Copy;
|
||||||
|
- File::Copy::cp($opt{history_file}, "$opt{history_file}.bak");
|
||||||
|
+ # Try to create a backup, first
|
||||||
|
+ require File::Copy;
|
||||||
|
+ File::Copy::cp($opt{history_file}, "$opt{history_file}.bak");
|
||||||
|
|
||||||
|
- if (open my $fh, '>', $opt{history_file}) {
|
||||||
|
- say {$fh} join("\n", @entries[(@entries - $opt{history_limit} + rand($opt{history_limit} >> 1)) .. $#entries]);
|
||||||
|
- close $fh;
|
||||||
|
- }
|
||||||
|
+ if (open my $fh, '>', $opt{history_file}) {
|
||||||
|
+ say {$fh} join("\n", @entries[(@entries - $opt{history_limit} + rand($opt{history_limit} >> 1)) .. $#entries]);
|
||||||
|
+ close $fh;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -1670,7 +1667,7 @@ sub get_user_input {
|
||||||
|
|
||||||
|
my ($args, $keywords) = parse_options($input);
|
||||||
|
|
||||||
|
- if ($opt{history} and $term->can('append_history') and @{$keywords}) {
|
||||||
|
+ if ($opt{history} and @{$keywords}) {
|
||||||
|
my $str = join(' ', grep { /\w/ and not /^[:;=]/ } @{$keywords});
|
||||||
|
if ($str ne '' and $str !~ /^[0-9]{1,2}\z/) {
|
||||||
|
$term->append_history(1, $opt{history_file});
|
|
@ -6,6 +6,12 @@
|
||||||
|
|
||||||
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
||||||
|
|
||||||
|
# 20171225 bkw:
|
||||||
|
# - updated for 3.3.2.
|
||||||
|
# - add upstream patch (commit d857451) to fix a long-standing bug where
|
||||||
|
# youtube-viewer's command history wasn't being saved across sessions.
|
||||||
|
# NOTE TO SELF: remove this patch once 3.3.3 is released.
|
||||||
|
|
||||||
# 20171219 bkw:
|
# 20171219 bkw:
|
||||||
# - updated for 3.3.1.
|
# - updated for 3.3.1.
|
||||||
|
|
||||||
|
@ -54,7 +60,7 @@
|
||||||
# - Added support for gtk-youtube-viewer
|
# - Added support for gtk-youtube-viewer
|
||||||
|
|
||||||
PRGNAM=youtube-viewer
|
PRGNAM=youtube-viewer
|
||||||
VERSION=${VERSION:-3.3.1}
|
VERSION=${VERSION:-3.3.2}
|
||||||
BUILD=${BUILD:-1}
|
BUILD=${BUILD:-1}
|
||||||
TAG=${TAG:-_SBo}
|
TAG=${TAG:-_SBo}
|
||||||
ARCH=noarch
|
ARCH=noarch
|
||||||
|
@ -78,6 +84,11 @@ find -L . \
|
||||||
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
||||||
-exec chmod 644 {} \;
|
-exec chmod 644 {} \;
|
||||||
|
|
||||||
|
# This is upstream's first commit after the 3.3.2 release. It fixes a
|
||||||
|
# pretty major bug that's been annoying me for a couple of years, so
|
||||||
|
# I'm not going to patiently wait for a 3.3.3 release.
|
||||||
|
patch -p1 < $CWD/fix_history.diff
|
||||||
|
|
||||||
# perl-gtk2 is a runtime dep, we can build with GTK=yes even if it's not
|
# perl-gtk2 is a runtime dep, we can build with GTK=yes even if it's not
|
||||||
# installed... but don't do that by default.
|
# installed... but don't do that by default.
|
||||||
GTK="${GTK:-auto}"
|
GTK="${GTK:-auto}"
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
PRGNAM="youtube-viewer"
|
PRGNAM="youtube-viewer"
|
||||||
VERSION="3.3.1"
|
VERSION="3.3.2"
|
||||||
HOMEPAGE="https://github.com/trizen/youtube-viewer/"
|
HOMEPAGE="https://github.com/trizen/youtube-viewer/"
|
||||||
DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.3.1/youtube-viewer-3.3.1.tar.gz"
|
DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.3.2/youtube-viewer-3.3.2.tar.gz"
|
||||||
MD5SUM="413713c886091f16fb065a36db74b958"
|
MD5SUM="ad580bd9a864334c919ca33f03e7f080"
|
||||||
DOWNLOAD_x86_64=""
|
DOWNLOAD_x86_64=""
|
||||||
MD5SUM_x86_64=""
|
MD5SUM_x86_64=""
|
||||||
REQUIRES="perl-data-dump perl-LWP-Protocol-https perl-lwp-useragent-cached perl-JSON perl-JSON-XS perl-Module-Build"
|
REQUIRES="perl-data-dump perl-LWP-Protocol-https perl-lwp-useragent-cached perl-JSON perl-JSON-XS perl-Module-Build"
|
||||||
|
|
Loading…
Reference in a new issue