Просмотр исходного кода

stop building l10n if strings are unchanged

The buildsystem tried to build l10n for test applications which never
produced the output it expected causing it to try building it all the
time.
David Kalnischkies лет назад: 13
Родитель
Сommit
57da1b4bd2
6 измененных файлов с 21 добавлено и 7 удалено
  1. 1 1
      buildlib/copy.mak
  2. 6 1
      buildlib/podomain.mak
  3. 1 1
      doc/makefile
  4. 11 4
      po/makefile
  5. 1 0
      test/interactive-helper/makefile
  6. 1 0
      test/libapt/makefile

+ 1 - 1
buildlib/copy.mak

@@ -21,7 +21,7 @@ veryclean: veryclean/$(LOCAL)
 
 
 MKDIRS += $(dir $($(LOCAL)-LIST))
 MKDIRS += $(dir $($(LOCAL)-LIST))
 
 
-$($(LOCAL)-LIST) : $(TO)/% : % dirs
+$($(LOCAL)-LIST) : $(TO)/% : %
 	echo Installing $< to $(@D)
 	echo Installing $< to $(@D)
 	cp $< $(@D)
 	cp $< $(@D)
 
 

+ 6 - 1
buildlib/podomain.mak

@@ -4,6 +4,8 @@
 # declared domain of the make file. It also arranges to set the DOMAIN 
 # declared domain of the make file. It also arranges to set the DOMAIN 
 # CPPFLAG for the compilation.
 # CPPFLAG for the compilation.
 
 
+ifneq ($(APT_DOMAIN),none)
+
 MY_DOMAIN := $(PACKAGE)
 MY_DOMAIN := $(PACKAGE)
 ifdef APT_DOMAIN
 ifdef APT_DOMAIN
 $($(LOCAL)-OBJS): CPPFLAGS := $(CPPFLAGS) -DAPT_DOMAIN='"$(APT_DOMAIN)"'
 $($(LOCAL)-OBJS): CPPFLAGS := $(CPPFLAGS) -DAPT_DOMAIN='"$(APT_DOMAIN)"'
@@ -13,10 +15,13 @@ endif
 MKDIRS += $(PO_DOMAINS)/$(MY_DOMAIN)
 MKDIRS += $(PO_DOMAINS)/$(MY_DOMAIN)
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: SRC := $(addprefix $(SUBDIR)/,$(SOURCE))
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: SRC := $(addprefix $(SUBDIR)/,$(SOURCE))
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: makefile dirs
 $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list: makefile dirs
-	(echo $(SRC) | xargs -n1 echo) > $@
+	(echo $(SRC) | xargs -n1 echo) > $@.tmp
+	cmp --silent $@.tmp $@ || mv $@.tmp $@
 startup binary program clean update-po: $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
 startup binary program clean update-po: $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
 
 
 veryclean: veryclean/$(LOCAL)
 veryclean: veryclean/$(LOCAL)
 veryclean/po/$(LOCAL): LIST := $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
 veryclean/po/$(LOCAL): LIST := $(PO_DOMAINS)/$(MY_DOMAIN)/$(LOCAL).$(TYPE)list
 veryclean/po/$(LOCAL):
 veryclean/po/$(LOCAL):
 	rm -f $(LIST)
 	rm -f $(LIST)
+
+endif

+ 1 - 1
doc/makefile

@@ -36,7 +36,7 @@ $(DOCDIRLIST) :: %/makefile : lang.makefile
 	test -d $(dir $@) || mkdir $(dir $@)
 	test -d $(dir $@) || mkdir $(dir $@)
 	sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@
 	sed "s#@@LANG@@#$(subst /,,$(dir $@))#" $< > $@
 
 
-debiandoc/subdirs manpages/subdirs clean/subdirs veryclean/subdirs: dirs
+debiandoc/subdirs manpages/subdirs clean/subdirs veryclean/subdirs:
 	for dir in en $(dir $(DOCDIRLIST)); do \
 	for dir in en $(dir $(DOCDIRLIST)); do \
 		$(MAKE) -C $$dir $(patsubst %/subdirs,%,$@); \
 		$(MAKE) -C $$dir $(patsubst %/subdirs,%,$@); \
 	done
 	done

+ 11 - 4
po/makefile

@@ -30,17 +30,23 @@ GETDOMAIN = $(word 1,$(subst /, ,$(1)))
 # and produce the .pot file.
 # and produce the .pot file.
 $(POTFILES) : $(PO)/%.pot :
 $(POTFILES) : $(PO)/%.pot :
 	echo "Generating POT file $@"
 	echo "Generating POT file $@"
-	echo $@ : $(wildcard $(PO)/domains/$*/*.*list) $(addprefix $(BASE)/,$(shell cat $(wildcard $(PO)/domains/$*/*.srclist))) > $@.d
+	echo $@ : $(wildcard $(PO)/domains/$*/*.*list) $(addprefix $(BASE)/,$(shell cat $(wildcard $(PO)/domains/$*/*.srclist))) > $@.d.tmp
+	cmp --silent $@.d.tmp $@.d || mv $@.d.tmp $@.d
 # From sh source
 # From sh source
-	cat $(PO)/domains/$*/*.shlist 2> /dev/null | (cd $(BASE) && xargs -n1 bash --dump-po-strings) > $(PO)/domains/$*/sh.pot
+	cat $(PO)/domains/$*/*.shlist 2> /dev/null | (cd $(BASE) && xargs -n1 bash --dump-po-strings) > $(PO)/domains/$*/sh.pot.tmp
+	cmp --silent $(PO)/domains/$*/sh.pot.tmp $(PO)/domains/$*/sh.pot || \
+		mv $(PO)/domains/$*/sh.pot.tmp $(PO)/domains/$*/sh.pot
 # From C/C++ source
 # From C/C++ source
 	cat $(PO)/domains/$*/*.srclist > $(PO)/POTFILES_$*.in
 	cat $(PO)/domains/$*/*.srclist > $(PO)/POTFILES_$*.in
 	$(XGETTEXT) --default-domain=$* --directory=$(BASE) \
 	$(XGETTEXT) --default-domain=$* --directory=$(BASE) \
 	  --add-comments --foreign --keyword=_ --keyword=N_ \
 	  --add-comments --foreign --keyword=_ --keyword=N_ \
 	  --keyword=P_:1,2 \
 	  --keyword=P_:1,2 \
-	  --files-from=$(PO)/POTFILES_$*.in -o $(PO)/domains/$*/c.pot
+	  --files-from=$(PO)/POTFILES_$*.in -o $(PO)/domains/$*/c.pot.tmp
+	cmp --silent $(PO)/domains/$*/c.pot.tmp $(PO)/domains/$*/c.pot || \
+		mv $(PO)/domains/$*/c.pot.tmp $(PO)/domains/$*/c.pot
 	rm -f $(PO)/POTFILES_$*.in
 	rm -f $(PO)/POTFILES_$*.in
-	$(MSGCOMM) --omit-header --more-than=0 $(PO)/domains/$*/c.pot $(PO)/domains/$*/sh.pot --output=$@
+	$(MSGCOMM) --omit-header --more-than=0 $(PO)/domains/$*/c.pot $(PO)/domains/$*/sh.pot --output=$@.tmp
+	cmp --silent $@ $@.tmp || mv $@.tmp $@
 	# copy into the domain dirs to make rosetta happy
 	# copy into the domain dirs to make rosetta happy
 	rm -f $(PO)/domains/$*/*.pot
 	rm -f $(PO)/domains/$*/*.pot
 	cp $@ $(PO)/domains/$*
 	cp $@ $(PO)/domains/$*
@@ -93,4 +99,5 @@ ifneq ($(words $(The_DFiles)),0)
 include $(The_DFiles)
 include $(The_DFiles)
 endif
 endif
 
 
+# otherwise the output is completely screwed
 .NOTPARALLEL:
 .NOTPARALLEL:

+ 1 - 0
test/interactive-helper/makefile

@@ -1,6 +1,7 @@
 # -*- make -*-
 # -*- make -*-
 BASE=../..
 BASE=../..
 SUBDIR=test/interactive-helper
 SUBDIR=test/interactive-helper
+APT_DOMAIN=none
 
 
 # Bring in the default rules
 # Bring in the default rules
 include ../../buildlib/defaults.mak
 include ../../buildlib/defaults.mak

+ 1 - 0
test/libapt/makefile

@@ -2,6 +2,7 @@
 BASE=../..
 BASE=../..
 SUBDIR=test/libapt
 SUBDIR=test/libapt
 BASENAME=_libapt_test
 BASENAME=_libapt_test
+APT_DOMAIN=none
 
 
 # Bring in the default rules
 # Bring in the default rules
 include ../../buildlib/defaults.mak
 include ../../buildlib/defaults.mak