diff options
author | Bjoern Michaelsen <b_michaelsen@openoffice.org> | 2010-11-22 16:40:54 +0100 |
---|---|---|
committer | Bjoern Michaelsen <b_michaelsen@openoffice.org> | 2010-11-22 16:40:54 +0100 |
commit | 4003e6f60207abc9009f892cfa39caacf8cb4044 (patch) | |
tree | f694192167614c28eb00c5687acfaee202680627 | |
parent | 1a9c2e9352e554872315ced1962f5fc75c227881 (diff) |
gnumake2: rename deliver.log to gb_deliver.log to save it from being killed by deliver.pl, added cleanpackmodule phony target
-rwxr-xr-x | solenv/bin/packmodule | 10 | ||||
-rw-r--r-- | solenv/gbuild/Deliver.mk | 4 | ||||
-rw-r--r-- | solenv/gbuild/extensions/PackModule.mk | 24 |
3 files changed, 22 insertions, 16 deletions
diff --git a/solenv/bin/packmodule b/solenv/bin/packmodule index 6261bd25754f..3c50bd7f8588 100755 --- a/solenv/bin/packmodule +++ b/solenv/bin/packmodule @@ -28,26 +28,26 @@ import os, os.path, sys, zipfile def paths_to_pack(loglines): - """Returns a generator iterating the outdir fields (with platform) of deliver.log lines.""" + """Returns a generator iterating the outdir fields (with platform) of gb_deliver.log lines.""" return (line.split()[2] for line in loglines) def stripped_paths_to_pack(loglines): - """returns a generator iterating the outdir fields (stripped of the platform) of deliver.log lines.""" + """returns a generator iterating the outdir fields (stripped of the platform) of gb_deliver.log lines.""" return (path.partition('/')[2] for path in paths_to_pack(loglines)) def main(args): - """creates/overwrites a file at OUTDIR/zip/MILESTONE/MODULE.zip containing the contents of the deliver.log.""" + """creates/overwrites a file at OUTDIR/zip/MILESTONE/MODULE.zip containing the contents of the gb_deliver.log.""" if len(args) != 4: print('usage: packmodule OUTDIR MODULE MILESTONE') sys.exit(2) (executable, outdir, module, milestone) = args os.chdir(outdir) - zipdir = os.path.join('zip', milestone) + zipdir = 'zip.'+milestone try: os.makedirs(zipdir) except OSError: pass - deliverlog = open(os.path.join('inc', module, 'deliver.log')) + deliverlog = open(os.path.join('inc', module, 'gb_deliver.log')) packedmodule = zipfile.ZipFile(os.path.join(zipdir,module+'.zip'), 'w') [packedmodule.write(path) for path in stripped_paths_to_pack(deliverlog)] packedmodule.close() diff --git a/solenv/gbuild/Deliver.mk b/solenv/gbuild/Deliver.mk index ebeb2b28668f..5c2ee2cd654e 100644 --- a/solenv/gbuild/Deliver.mk +++ b/solenv/gbuild/Deliver.mk @@ -46,7 +46,7 @@ endef # FIXME: this does not really work for real multi repository builds, but the # deliver.log format is broken in that case anyway define gb_Deliver_add_deliverable -gb_Deliver_DELIVERABLES += $$(patsubst $(SOURCE_ROOT_DIR)/%,%,$(2)):$$(patsubst $(SOURCE_ROOT_DIR)/%,%,$(1)) +gb_Deliver_DELIVERABLES += $$(patsubst $(REPO_DIR)/%,%,$(2)):$$(patsubst $(REPO_DIR)/%,%,$(1)) endef @@ -63,7 +63,7 @@ define gb_Deliver_setdeliverlogcommand ifeq ($$(words $(gb_Module_ALLMODULES)),1) $$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),LOG,1)) deliverlog : COMMAND := mkdir -p $$(OUTDIR)/inc/$$(strip $$(gb_Module_ALLMODULES)) && -deliverlog : COMMAND += echo "$$(sort $$(gb_Deliver_DELIVERABLES)) " | awk -f $$(GBUILDDIR)/processdelivered.awk > $$(OUTDIR)/inc/$$(strip $(gb_Module_ALLMODULES))/deliver.log +deliverlog : COMMAND += echo "$$(sort $$(gb_Deliver_DELIVERABLES)) " | awk -f $$(GBUILDDIR)/processdelivered.awk > $$(OUTDIR)/inc/$$(strip $(gb_Module_ALLMODULES))/gb_deliver.log else $$(eval $$(call gb_Output_announce,more than one module - creating no deliver.log,$$(true),LOG,1)) deliverlog : COMMAND := true diff --git a/solenv/gbuild/extensions/PackModule.mk b/solenv/gbuild/extensions/PackModule.mk index 95a557a7126b..319840324d8d 100644 --- a/solenv/gbuild/extensions/PackModule.mk +++ b/solenv/gbuild/extensions/PackModule.mk @@ -29,6 +29,8 @@ # it depends on scripts outside the gbuild directory # nothing in the gbuild core should ever depend on it +.PHONY : packmodule cleanpackmodule + define gb_PackModule_setpackmodulecommand ifeq ($$(words $(gb_Module_ALLMODULES)),1) $$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(true),ZIP,5)) @@ -39,18 +41,22 @@ packmodule : COMMAND := true endif endef -.PHONY : packmodule cleanpackmodule packmodule : all $(eval $(call gb_PackModule_setpackmodulecommand)) $(COMMAND) -# TODO: implement cleanpackmodule -# Should cleanpackmodule depend on clean and thus remove the build too? That -# would be consistent with the current behaviour of packmodule. Or should it -# only remove the packed module, but nothing else? Or should packmodule have -# an order only dependency on all? Then one could either pack whats there with -# "packmodule" (might fail on an incomplete build) or make sure everything is -# up-to-date with "packmodule all". - +define gb_PackModule_setcleanpackmodulecommand +ifeq ($$(words $(gb_Module_ALLMODULES)),1) +$$(eval $$(call gb_Output_announce,$$(strip $$(gb_Module_ALLMODULES)),$$(false),ZIP,5)) +cleanpackmodule : COMMAND := rm -f $$(OUTDIR)/zip.$$(UPDMINOR)/$$(strip $$(gb_Module_ALLMODULES)).zip +else +$$(eval $$(call gb_Output_announce,more than one module - deleting no zipped package,$$(false),ZIP,5)) +cleanpackmodule : COMMAND := true +endif +endef +cleanpackmodule : clean + $(eval $(call gb_PackModule_setcleanpackmodulecommand)) + $(COMMAND) + # vim: set noet ts=4 sw=4: |