aboutsummaryrefslogtreecommitdiffstats
path: root/translate_menu
diff options
context:
space:
mode:
authorJani Välimaa <wally@mageia.org>2020-05-01 15:07:51 +0300
committerJani Välimaa <wally@mageia.org>2020-05-01 15:07:51 +0300
commit68d80bdfa06aa4ff0764e64c3b940b705fe5b606 (patch)
tree5a6f21cea33c034a2dbdc77f85f9d39ec794ee8b /translate_menu
parentd32a77543c21c156070e76b2af94c0676a2dbb15 (diff)
downloadspec-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.
Diffstat (limited to 'translate_menu')
-rwxr-xr-xtranslate_menu64
1 files changed, 0 insertions, 64 deletions
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);
-}