Commit 047c9df2 authored by Frank Lichtenheld's avatar Frank Lichtenheld

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
parent b918d730
......@@ -152,23 +152,16 @@ else
fi
endif
# FIXME, it should see bind-gettext-domain domain="sth" for $(call locale,sth)
gendep:
@for f in $(TEMPLDIR)/*.wml \
$(TEMPLDIR)/weeklynews/*.wml \
$(TEMPLDIR)/projectnews/*.wml; \
do \
grep -q '^#use wml::debian' $$f || continue; \
g=`echo "$$f" | sed -e 's,$(TEMPLDIR),\$$(TEMPLDIR),'`; \
grep '^#use wml::debian' $$f |\
grep -v openrecode |\
sed -e 's,.*::,\$$(TEMPLDIR)/,' \
-e 's/ .*$$//' \
-e 's/$$/.wml/' |\
awk "BEGIN {printf \"X$$g:\"}"'{printf " %s", $$1}' |\
../gendep.pl "$$f" |\
sed -e 's,X$(TEMPLDIR),X\$$(TEMPLDIR),' |\
fold -b -s -w 70 |\
sed -e 's/^\$$/ \$$/' -e 's/^X//' -e '/:$$/d' -e '$$!s/$$/\\/'; \
echo; \
sed -e 's/^\$$/ \$$/' -e 's/^X//' -e 's/callX/call /g' -e '$$!s/$$/\\/'; \
done
# this dependency cannot be automatically computed
......@@ -176,8 +169,9 @@ $(TEMPLDIR)/basic.wml: $(TEMPLDIR)/navbar.wml
# dependencies below are generated by gendep and manually checked
$(TEMPLDIR)/basic.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/footer.wml \
$(TEMPLDIR)/navbar.wml
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/language_names.wml \
$(TEMPLDIR)/footer.wml
$(TEMPLDIR)/blend.wml: $(TEMPLDIR)/template.wml
$(TEMPLDIR)/cdimage.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/basic.wml \
......@@ -186,57 +180,55 @@ $(TEMPLDIR)/common_translation.wml: $(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/consultant.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \
$(call locale,consultants)
$(TEMPLDIR)/countries.wml: $(TEMPLDIR)/common_tags.wml\
$(TEMPLDIR)/countries.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,countries)
$(TEMPLDIR)/ctime.wml: $(TEMPLDIR)/common_tags.wml\
$(TEMPLDIR)/ctime.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,date)
$(TEMPLDIR)/ddp.wml: $(TEMPLDIR)/basic.wml \
$(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/languages.wml
$(TEMPLDIR)/debian-cdd.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/template.wml\
$(call locale,debian-cdd)
$(TEMPLDIR)/event.wml: $(TEMPLDIR)/events_common.wml \
$(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml
$(TEMPLDIR)/events_common.wml: $(TEMPLDIR)/common_translation.wml \
$(call locale,legal)
$(call locale,newsevents)
$(TEMPLDIR)/fixes_link.wml: $(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/footer.wml: $(TEMPLDIR)/ctime.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml
$(TEMPLDIR)/installer.wml: $(TEMPLDIR)/release_data.wml
$(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/release_info.wml
$(TEMPLDIR)/installer.wml: $(TEMPLDIR)/release_info.wml
$(TEMPLDIR)/language_names.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,langs)
$(TEMPLDIR)/languages.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/language_names.wml
$(TEMPLDIR)/language_names.wml $(TEMPLDIR)/countries.wml
$(TEMPLDIR)/legal.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/ctime.wml $(TEMPLDIR)/submenu.wml \
$(TEMPLDIR)/legal_tags.wml $(TEMPLDIR)/basic.wml \
$(call locale,legal)
$(TEMPLDIR)/legal_tags.wml $(TEMPLDIR)/basic.wml $(call locale,legal)
$(TEMPLDIR)/legal_lists.wml: $(TEMPLDIR)/ctime.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/legal_tags.wml
$(TEMPLDIR)/legal_tags.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/common_translation.wml \
$(call locale,legal)
$(TEMPLDIR)/common_translation.wml $(call locale,legal)
$(TEMPLDIR)/links.tags.wml: $(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/mainpage.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/basic.wml $(TEMPLDIR)/links.tags.wml \
$(TEMPLDIR)/languages.wml
$(TEMPLDIR)/languages.wml $(TEMPLDIR)/release_info.wml
$(TEMPLDIR)/navbar.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/events_common.wml \
$(TEMPLDIR)/links.tags.wml
$(TEMPLDIR)/events_common.wml $(TEMPLDIR)/links.tags.wml \
$(TEMPLDIR)/stats_tags.wml $(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/news.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/ctime.wml $(TEMPLDIR)/basic.wml \
$(call locale,legal)
$(TEMPLDIR)/ctime.wml $(TEMPLDIR)/basic.wml $(call locale,newsevents)
$(TEMPLDIR)/past_event.wml: $(TEMPLDIR)/events_common.wml \
$(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml
$(TEMPLDIR)/profiles.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/faqs.wml $(TEMPLDIR)/basic.wml
$(TEMPLDIR)/recent_list.wml: $(TEMPLDIR)/ctime.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/legal_tags.wml
$(TEMPLDIR)/release.wml: $(TEMPLDIR)/languages.wml
$(TEMPLDIR)/release_data.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/ctime.wml
$(TEMPLDIR)/release_images.wml: $(TEMPLDIR)/installer.wml \
$(TEMPLDIR)/release_data.wml
$(TEMPLDIR)/release_info.wml
$(TEMPLDIR)/release_info.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/ctime.wml
$(TEMPLDIR)/release.wml: $(TEMPLDIR)/languages.wml
$(TEMPLDIR)/security.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/common_translation.wml $(TEMPLDIR)/fixes_link.wml \
$(TEMPLDIR)/languages.wml $(TEMPLDIR)/ctime.wml \
......@@ -244,22 +236,33 @@ $(TEMPLDIR)/security.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,security)
$(TEMPLDIR)/speakers.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/basic.wml $(TEMPLDIR)/languages.wml \
$(call locale,legal)
$(call locale,newsevents)
$(TEMPLDIR)/stats_tags.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,stats)
$(TEMPLDIR)/template.wml: $(TEMPLDIR)/basic.wml \
$(TEMPLDIR)/languages.wml
$(TEMPLDIR)/translation-check.wml: $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/url.wml: $(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/users.wml: $(TEMPLDIR)/common_translation.wml \
$(TEMPLDIR)/common_tags.wml $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/basic.wml
$(TEMPLDIR)/users_list.wml: $(TEMPLDIR)/common_tags.wml
$(TEMPLDIR)/votebar.wml: $(TEMPLDIR)/languages.wml \
$(TEMPLDIR)/common_tags.wml \
$(call locale,vote)
$(TEMPLDIR)/wnpp.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,wnpp)
$(TEMPLDIR)/common_tags.wml $(call locale,vote)
$(TEMPLDIR)/wnpp.wml: $(TEMPLDIR)/common_tags.wml $(call locale,wnpp)
$(TEMPLDIR)/weeklynews/footer.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,newsevents)
$(TEMPLDIR)/weeklynews/header.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/ctime.wml $(TEMPLDIR)/links.tags.wml \
$(TEMPLDIR)/template.wml
$(TEMPLDIR)/projectnews/boilerplates.wml: \
$(TEMPLDIR)/common_tags.wml $(call locale,newsevents)
$(TEMPLDIR)/projectnews/footer.wml: $(TEMPLDIR)/common_tags.wml \
$(call locale,newsevents)
$(TEMPLDIR)/projectnews/header.wml: $(TEMPLDIR)/common_tags.wml \
$(TEMPLDIR)/ctime.wml $(TEMPLDIR)/links.tags.wml $(TEMPLDIR)/toc.wml \
$(TEMPLDIR)/projectnews/boilerplates.wml $(TEMPLDIR)/template.wml
$(TEMPLDIR)/navbar.wml: $(ENGLISHSRCDIR)/logos/openlogo-nd-50.png
......
#!/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";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment