mirror of
https://github.com/Ponce/slackbuilds
synced 2024-11-16 19:50:19 +01:00
multimedia/youtube-viewer: Updated for version 3.3.3.
Signed-off-by: B. Watson <yalhcru@gmail.com>
This commit is contained in:
parent
93c64336f6
commit
21a4d58b5d
3 changed files with 8 additions and 60 deletions
|
@ -1,51 +0,0 @@
|
|||
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,10 @@
|
|||
|
||||
# Licensed under the WTFPL. See http://www.wtfpl.net/txt/copying/ for details.
|
||||
|
||||
# 20180111 bkw:
|
||||
# - updated for 3.3.3.
|
||||
# - remove unneeded command history patch.
|
||||
|
||||
# 20171225 bkw:
|
||||
# - updated for 3.3.2.
|
||||
# - add upstream patch (commit d857451) to fix a long-standing bug where
|
||||
|
@ -60,7 +64,7 @@
|
|||
# - Added support for gtk-youtube-viewer
|
||||
|
||||
PRGNAM=youtube-viewer
|
||||
VERSION=${VERSION:-3.3.2}
|
||||
VERSION=${VERSION:-3.3.3}
|
||||
BUILD=${BUILD:-1}
|
||||
TAG=${TAG:-_SBo}
|
||||
ARCH=noarch
|
||||
|
@ -84,11 +88,6 @@ find -L . \
|
|||
\( -perm 666 -o -perm 664 -o -perm 600 -o -perm 444 -o -perm 440 -o -perm 400 \) \
|
||||
-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
|
||||
# installed... but don't do that by default.
|
||||
GTK="${GTK:-auto}"
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
PRGNAM="youtube-viewer"
|
||||
VERSION="3.3.2"
|
||||
VERSION="3.3.3"
|
||||
HOMEPAGE="https://github.com/trizen/youtube-viewer/"
|
||||
DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.3.2/youtube-viewer-3.3.2.tar.gz"
|
||||
MD5SUM="ad580bd9a864334c919ca33f03e7f080"
|
||||
DOWNLOAD="https://github.com/trizen/youtube-viewer/archive/3.3.3/youtube-viewer-3.3.3.tar.gz"
|
||||
MD5SUM="382a62e4fd7b02743b33a454b699a4ec"
|
||||
DOWNLOAD_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"
|
||||
|
|
Loading…
Reference in a new issue