diff options
author | Jani Välimaa <wally@mageia.org> | 2020-05-01 15:07:51 +0300 |
---|---|---|
committer | Jani Välimaa <wally@mageia.org> | 2020-05-01 15:07:51 +0300 |
commit | 68d80bdfa06aa4ff0764e64c3b940b705fe5b606 (patch) | |
tree | 5a6f21cea33c034a2dbdc77f85f9d39ec794ee8b | |
parent | d32a77543c21c156070e76b2af94c0676a2dbb15 (diff) | |
download | spec-helper-68d80bdfa06aa4ff0764e64c3b940b705fe5b606.tar spec-helper-68d80bdfa06aa4ff0764e64c3b940b705fe5b606.tar.gz spec-helper-68d80bdfa06aa4ff0764e64c3b940b705fe5b606.tar.bz2 spec-helper-68d80bdfa06aa4ff0764e64c3b940b705fe5b606.tar.xz spec-helper-68d80bdfa06aa4ff0764e64c3b940b705fe5b606.zip |
Drop unneeded translate_menu script (mga#26519)
Nothing uses /usr/lib/menu anymore.
-rw-r--r-- | Makefile | 3 | ||||
-rw-r--r-- | NEWS | 2 | ||||
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | spec-helper.macros.in | 1 | ||||
-rwxr-xr-x | t/run.t | 1 | ||||
-rwxr-xr-x | translate_menu | 64 |
6 files changed, 3 insertions, 72 deletions
@@ -13,8 +13,7 @@ SCRIPT_FILES = check_desktop_files \ lib_symlinks \ relink_symlinks \ remove_info_dir \ - restrict_to_cpu0 \ - translate_menu + restrict_to_cpu0 BIN_FILES = macroszification MACROS_FILES = spec-helper.macros TEST_FILES = t/*.t @@ -1,3 +1,5 @@ + * remove unneeded translate_menu script (mga#26519) + 2018-10-21 Jani Välimaa <wally@mageia.org> 0.31.22 * move binary and library stripping to __os_install_post in rpm-setup if __debug_package isn't defined @@ -41,10 +41,6 @@ fix-mo Fix bad translations. Set DONT_FIX_MO to disable. -translate_menu -Change the menu sections. -Set DONT_TRANSLATE_MENU to disable. - fixpamd Fix pam.d config files. Set DONT_FIX_PAMD_CONFIGS to disable. diff --git a/spec-helper.macros.in b/spec-helper.macros.in index db8ed2e..bc3b947 100644 --- a/spec-helper.macros.in +++ b/spec-helper.macros.in @@ -8,7 +8,6 @@ %{?!dont_symlinks_libs: [ -n "$DONT_SYMLINK_LIBS" ] || %_spec_helper_dir/lib_symlinks} \ %{?!dont_gprintify: [ -n "$DONT_GPRINTIFY" ] || %_spec_helper_dir/gprintify} \ %{?!dont_fix_mo: [ -n "$DONT_FIX_MO" ] || %_spec_helper_dir/fix_mo} \ - %{?!dont_translate_menu: [ -n "$DONT_TRANSLATE_MENU" ] || %_spec_helper_dir/translate_menu} \ %{?!dont_fix_pamd: [ -n "$DONT_FIX_PAMD_CONFIGS" ] || %_spec_helper_dir/fix_pamd} \ %{?!dont_remove_info_dir: [ -n "$DONT_REMOVE_INFO_DIR" ] || %_spec_helper_dir/remove_info_dir} \ %{?!dont_fix_eol: [ -n "$DONT_FIX_EOL" ] || %_spec_helper_dir/fix_eol} \ @@ -14,7 +14,6 @@ my @programs = qw/ compress_files relink_symlinks gprintify - translate_menu remove_info_dir fix_pamd fix_eol diff --git a/translate_menu b/translate_menu deleted file mode 100755 index 56c90e8..0000000 --- a/translate_menu +++ /dev/null @@ -1,64 +0,0 @@ -#!/usr/bin/perl -# change the menu sections - -use strict; -use warnings; - -my $buildroot = $ENV{RPM_BUILD_ROOT}; -die "No build root defined" unless $buildroot; -die "Invalid build root" unless -d $buildroot; - -my $menudir = `rpm --eval %_menudir`; -chomp($menudir); - -! -d "$buildroot/$menudir/" || exit(0); - -my @nested = ( - ["Configuration", "System/Configuration"], - ["Applications/Monitoring", "System/Monitoring"], - ["Applications/Publishing", "Office/Publishing"], - ["Applications/File tools", "System/File Tools"], - ["Applications/Text tools", "System/Text Tools"], - ["Applications/Archiving", "System/Archiving"], - ["Applications", "More Applications"], - ["Terminals", "System/Terminals"], - ["Documentation", "More Applications/Documentation"], - ["Office/PDA", "Office/Communications/PDA"], - ["Networking/IRC", "Internet/Chat"], - ["Networking/WWW", "Internet/Web Browsers"], - ["^Networking", "Internet"], - ["Amusement", "More Applications/Games"], - ["Session/Windowmanagers", "System/Session/Windowmanagers"], -); - -sub translate { - my ($str) = @_; - - foreach my $t (@nested) { - if ($str =~ /(.*)$t->[0](.*)/ && $str !~ /$t->[1]/) { - print "$str => $1$t->[1]$2\n"; - return "$1$t->[1]$2"; - } - } - return $str; -} - -# process each file passed on cli: - -foreach my $file (glob("$buildroot/$menudir/*")) { - open(my $FILE, "<$file") or die $!; - my @lines = <$FILE>; - close($FILE); - open($FILE, ">$file") or die $!; - foreach my $l (@lines) { - chomp($l); - if ($l =~ /(.*section=)"([^"]+)"(\s*.*)/ || - $l =~ /(.*section=)([^"].+?)((\s|\\)+.*)/) { - my ($beg, $section, $end) = ($1, $2, $3); - $section = translate($section); - $l = qq($beg"$section"$end); - } - print $FILE "$l\n"; - } - close($FILE); -} |