From 755951f059cd6b199fe18a68a74af7d4193e3ecd Mon Sep 17 00:00:00 2001 From: Francesc Guasch Date: Thu, 22 Apr 2021 13:36:12 +0200 Subject: [PATCH] install: add favicon and remove old badges --- deb/debianize.pl | 2 +- etc/get_fallback.pl | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/deb/debianize.pl b/deb/debianize.pl index dec342554..919e67aaf 100755 --- a/deb/debianize.pl +++ b/deb/debianize.pl @@ -30,7 +30,7 @@ ,'etc/systemd/' => 'lib/systemd/system/' ); -for ( qw(css fallback fonts img js )) { +for ( qw(css fallback fonts img js favicon.ico )) { $DIR{"public/$_"} = "usr/share/ravada/public"; } diff --git a/etc/get_fallback.pl b/etc/get_fallback.pl index 4e278bafc..46cb38efb 100755 --- a/etc/get_fallback.pl +++ b/etc/get_fallback.pl @@ -63,8 +63,23 @@ sub get_version_badge { ,"../img/version-$VERSION-brightgreen.svg"); } +sub remove_old_version_badge { + $VERSION =~ s/-/--/; + my $current = "version-$VERSION-brightgreen.svg"; + opendir my $dir,"public/img" or die "$! public/img"; + while (my $file = readdir $dir) { + next if $file !~ /^version-.*\.svg/; + next if $file eq $current; + $file = "public/img/$file"; + unlink $file or die "$! $file"; + } + closedir $dir; + +} + ############################################################################# +remove_old_version_badge(); get_version_badge(); open my $in,'<',$FILE_CONFIG or die "$! $FILE_CONFIG";