summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Tauner <stefan.tauner@gmx.at>2017-10-01 15:57:25 +0200
committerNico Huber <nico.h@gmx.de>2017-10-05 10:37:15 +0000
commite4136854f18adcf3e753ebe6a2cc2cc9b9e43201 (patch)
tree6c7f39e023d2c4b636f5a4e906a2f3cbb7a4beac
parent60f7a221e080e1847b56bd8aa03451c2459efc1c (diff)
downloadflashrom-e4136854f18adcf3e753ebe6a2cc2cc9b9e43201.tar.gz
flashrom-e4136854f18adcf3e753ebe6a2cc2cc9b9e43201.tar.bz2
flashrom-e4136854f18adcf3e753ebe6a2cc2cc9b9e43201.zip
fixup! Convert flashrom to git
Fix broken/one-off loop to restore file dates. Explain what the sed program actually does because it is non-trivial. Change-Id: Iff4021be49a9fab208b619c555b9f9e81f671ab8 Signed-off-by: Stefan Tauner <stefan.tauner@gmx.at> Reviewed-on: https://review.coreboot.org/21825 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de>
-rw-r--r--Makefile11
1 files changed, 6 insertions, 5 deletions
diff --git a/Makefile b/Makefile
index ba67069d0..f586b717a 100644
--- a/Makefile
+++ b/Makefile
@@ -1406,16 +1406,17 @@ _export: $(PROGRAM).8
# exported sources.
@echo "VERSION = $(VERSION)" > "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
@echo "MAN_DATE = $(MAN_DATE)" >> "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
-# Restore modification date of all tracked files not marked
-# 'export-ignore' in .gitattributes. sed is required to filter out file
-# names having the attribute set.
+# Restore modification date of all tracked files not marked 'export-ignore' in .gitattributes.
+# sed is required to filter out file names having the attribute set.
+# The sed program saves the file name in the hold buffer and then checks if the respective value is 'set'.
+# If so it ignores the rest of the program, which otherwise restores the file name and prints it.
@git ls-tree -r -z -t --full-name --name-only HEAD | \
git check-attr -z --stdin export-ignore | \
- sed -zne 'x;n;n;/^set$$/{b};x;p' | \
+ sed -zne 'x;n;n;{/^set$$/b;};x;p;' | \
xargs -0 sh -c 'for f; do \
touch -d $$(git log --pretty=format:%cI -1 HEAD -- "$$f") \
"$(EXPORTDIR)/flashrom-$(RELEASENAME)/$$f"; \
- done'
+ done' dummy_arg0
export: _export
@echo "Exported $(EXPORTDIR)/flashrom-$(RELEASENAME)/"