aboutsummaryrefslogtreecommitdiffstats
path: root/translate_menu.pl
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mandriva.org>2006-05-20 13:12:05 +0000
committerOlivier Thauvin <nanardon@mandriva.org>2006-05-20 13:12:05 +0000
commitbe6ed81942ebc1687b80f89533a321cda1823157 (patch)
tree4331a139629affd83b9a1f929eff722cc438b172 /translate_menu.pl
parentcdeb867d6ed113d1faf78a5043d7cac44de97bfc (diff)
downloadspec-helper-be6ed81942ebc1687b80f89533a321cda1823157.tar
spec-helper-be6ed81942ebc1687b80f89533a321cda1823157.tar.gz
spec-helper-be6ed81942ebc1687b80f89533a321cda1823157.tar.bz2
spec-helper-be6ed81942ebc1687b80f89533a321cda1823157.tar.xz
spec-helper-be6ed81942ebc1687b80f89533a321cda1823157.zip
- make the script working alone
Diffstat (limited to 'translate_menu.pl')
-rwxr-xr-xtranslate_menu.pl9
1 files changed, 8 insertions, 1 deletions
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);