From be6ed81942ebc1687b80f89533a321cda1823157 Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Sat, 20 May 2006 13:12:05 +0000 Subject: - make the script working alone --- translate_menu.pl | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'translate_menu.pl') diff --git a/translate_menu.pl b/translate_menu.pl index 24e48eb..2d661c6 100755 --- a/translate_menu.pl +++ b/translate_menu.pl @@ -9,6 +9,12 @@ # Purpose : change the menu sections #--------------------------------------------------------------- +my $menudir = `rpm --eval %_menudir`; +chomp($menudir); + +$ENV{RPM_BUILD_ROOT} or exit(0); +! -d "$ENV{RPM_BUILD_ROOT}/$menudir/" || exit(0); + my @nested = (["Configuration", "System/Configuration"], ["Applications/Monitoring", "System/Monitoring"], @@ -45,7 +51,8 @@ sub translate { } # process each file passed on cli: -foreach my $file (@ARGV) { + +foreach my $file (glob("$ENV{RPM_BUILD_ROOT}/$menudir/*")) { open(my $FILE, "<$file") or die $!; my @lines = <$FILE>; close($FILE); -- cgit v1.2.1