aboutsummaryrefslogtreecommitdiffstats
path: root/gendep.pl
diff options
context:
space:
mode:
authorFrank Lichtenheld <djpig>2016-04-04 01:33:26 +0000
committerFrank Lichtenheld <djpig>2016-04-04 01:33:26 +0000
commit047c9df21da7a3992e0350c67437188046a93956 (patch)
tree2ee3c889ff42c0ee57086225915f231a03538667 /gendep.pl
parentb918d7301efaec098125b48ff80a06ade066695c (diff)
Makefile.common: Rework gendep mechanism
Fix the FIXME to also automatically print gettext dependencies. Do this by moving the detection code from inline shell to a separate gendep.pl perl script which allows for easier pattern matching. Also update the output of gendep in Makefile.common. Apparently it was quite old. CVS version numbers Makefile.common: 1.109 -> 1.110 gendep.pl: INITIAL -> 1.1
Diffstat (limited to 'gendep.pl')
-rwxr-xr-xgendep.pl26
1 files changed, 26 insertions, 0 deletions
diff --git a/gendep.pl b/gendep.pl
new file mode 100755
index 00000000000..83c4f695208
--- /dev/null
+++ b/gendep.pl
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+use strict;
+use warnings;
+
+my $file = $ARGV[0];
+
+open my $fh, '<', $file or die "couldn't open file $file: $!\n";
+my @templates;
+my @locales;
+while( my $line = <$fh> ){
+ if( $line =~ /^#use wml::debian::(\S+)/ ){
+ next if $1 eq 'openrecode';
+ push @templates, $1;
+ }elsif( $line =~ /bind-gettext-domain\s+domain="(\S+)"/ ){
+ push @locales, $1;
+ }
+}
+close $fh or warn "couldn't close file $file: $!\n";
+
+if( @templates || @locales ){
+ print "X$file: ";
+ print join(' ', map{ s|::|/|g; '$(TEMPLDIR)/'.$_.'.wml' } @templates) if @templates;
+ print ' ' if @templates && @locales;
+ print join(' ', map{ '$(callXlocale,'.$_.')' } @locales) if @locales;
+ print "\n";
+}

© 2014-2024 Faster IT GmbH | imprint | privacy policy