Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/21828 )
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
Note the non-strict POSIX compatibility in getrevision.sh and a add missing full stop*.* ;)
Change-Id: Ia60186f783067ba084439a8ef701dc8f4c0072f0
Signed-off-by: Stefan Tauner <stefan.tauner(a)gmx.at>
Reviewed-on: https://review.coreboot.org/21828
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M util/getrevision.sh
1 file changed, 2 insertions(+), 1 deletion(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
diff --git a/util/getrevision.sh b/util/getrevision.sh
index 0f97546..9dd4dbe 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -1,4 +1,5 @@
#!/bin/sh
+# NB: Supposed to be POSIX compatible but at least the usage of 'local' is not.
#
# This file is part of the flashrom project.
#
@@ -78,7 +79,7 @@
echo "$(git ls-remote --exit-code --get-url ${target%/*}) ${target#*/}"
}
-# Returns a string indicating where others can get the current source code (excluding uncommitted changes)
+# Returns a string indicating where others can get the current source code (excluding uncommitted changes).
# Takes one optional argument: the path to inspect
scm_url() {
local url=
--
To view, visit https://review.coreboot.org/21828
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia60186f783067ba084439a8ef701dc8f4c0072f0
Gerrit-Change-Number: 21828
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/21827 )
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
- make version string generation independent of the actual VCS
used by not generating "unknown" in the makefile but letting
getrevision do that
- make hook installation independent of version string generation
since they have nothing to do with each other and there are no
synergies anymore
Change-Id: Iedc9df4c033a70447b8b1b65c83764c769b02c3f
Signed-off-by: Stefan Tauner <stefan.tauner(a)gmx.at>
Reviewed-on: https://review.coreboot.org/21827
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M Makefile
M util/getrevision.sh
2 files changed, 8 insertions(+), 11 deletions(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
diff --git a/Makefile b/Makefile
index 980f2f6..3349f03 100644
--- a/Makefile
+++ b/Makefile
@@ -528,17 +528,10 @@
# versioninfo.inc is used when packaging flashrom and is generated by the
# export rule. If versioninfo.inc is not found, version info will be obtained
-# using util/getrevision.sh or "unknown" if SCM metadata directory isn't found.
+# using util/getrevision.sh.
ifeq ($(wildcard versioninfo.inc),)
-ifeq ($(wildcard .git),)
-VERSION ?= unknown
-MAN_DATE ?= unknown
-else
VERSION ?= $(shell ./util/getrevision.sh --local)
-MAN_DATE ?= $(shell ./util/getrevision.sh -d $(PROGRAM).8.tmpl 2>/dev/null)
-# This is also a convenient time to install hooks.
-$(shell ./util/git-hooks/install.sh)
-endif
+MAN_DATE ?= $(shell ./util/getrevision.sh --date $(PROGRAM).8.tmpl 2>/dev/null)
else
include versioninfo.inc
endif
@@ -557,6 +550,9 @@
# Inform user of the version string
$(info Replacing all version templates with $(VERSION).)
+# If a VCS is found then try to install hooks.
+$(shell ./util/getrevision.sh -c 2>/dev/null && ./util/git-hooks/install.sh)
+
###############################################################################
# Default settings of CONFIG_* variables.
diff --git a/util/getrevision.sh b/util/getrevision.sh
index e1580e5..0f97546 100755
--- a/util/getrevision.sh
+++ b/util/getrevision.sh
@@ -131,13 +131,14 @@
# Retrieve local revision info.
local_revision() {
+ local r
if git_is_file_tracked "$1" ; then
- local r=$(git describe $(git_last_commit "$1"))
+ r=$(git describe $(git_last_commit "$1"))
if git_has_local_changes "$1" ; then
r="$r-dirty"
fi
else
- return ${EXIT_FAILURE}
+ r="unknown"
fi
echo "${r}"
--
To view, visit https://review.coreboot.org/21827
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: merged
Gerrit-Change-Id: Iedc9df4c033a70447b8b1b65c83764c769b02c3f
Gerrit-Change-Number: 21827
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/21826 )
Change subject: fixup! Convert flashrom to git
......................................................................
fixup! Convert flashrom to git
Use a more generic file name for the exported VCS data.
Change-Id: Ie57b20dc014ba44ded5783bdb432eb7d0e0e28ad
Signed-off-by: Stefan Tauner <stefan.tauner(a)gmx.at>
Reviewed-on: https://review.coreboot.org/21826
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M Makefile
1 file changed, 7 insertions(+), 8 deletions(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
diff --git a/Makefile b/Makefile
index f586b71..980f2f6 100644
--- a/Makefile
+++ b/Makefile
@@ -526,10 +526,10 @@
CLI_OBJS = cli_classic.o cli_output.o cli_common.o print.o
-# Makefile.version is used when packaging flashrom and is generated by the
-# export rule. If Makefile.version is not found, version info will be obtained
+# versioninfo.inc is used when packaging flashrom and is generated by the
+# export rule. If versioninfo.inc is not found, version info will be obtained
# using util/getrevision.sh or "unknown" if SCM metadata directory isn't found.
-ifeq ($(wildcard Makefile.version),)
+ifeq ($(wildcard versioninfo.inc),)
ifeq ($(wildcard .git),)
VERSION ?= unknown
MAN_DATE ?= unknown
@@ -540,7 +540,7 @@
$(shell ./util/git-hooks/install.sh)
endif
else
-include Makefile.version
+include versioninfo.inc
endif
# VERSION equals "offline" if online access is required but the respective git
@@ -1402,10 +1402,9 @@
@rm -rf "$(EXPORTDIR)/flashrom-$(RELEASENAME)"
@mkdir -p "$(EXPORTDIR)/flashrom-$(RELEASENAME)"
@git archive HEAD | tar -x -C "$(EXPORTDIR)/flashrom-$(RELEASENAME)"
-# Generate Makefile.version since SCM metadata won't be available in
-# exported sources.
- @echo "VERSION = $(VERSION)" > "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
- @echo "MAN_DATE = $(MAN_DATE)" >> "$(EXPORTDIR)/flashrom-$(RELEASENAME)/Makefile.version"
+# Generate versioninfo.inc containing metadata that would not be available in exported sources otherwise.
+ @echo "VERSION = $(VERSION)" > "$(EXPORTDIR)/flashrom-$(RELEASENAME)/versioninfo.inc"
+ @echo "MAN_DATE = $(MAN_DATE)" >> "$(EXPORTDIR)/flashrom-$(RELEASENAME)/versioninfo.inc"
# 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'.
--
To view, visit https://review.coreboot.org/21826
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie57b20dc014ba44ded5783bdb432eb7d0e0e28ad
Gerrit-Change-Number: 21826
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>
Nico Huber has submitted this change and it was merged. ( https://review.coreboot.org/21825 )
Change subject: fixup! Convert flashrom to git
......................................................................
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(a)gmx.at>
Reviewed-on: https://review.coreboot.org/21825
Tested-by: build bot (Jenkins) <no-reply(a)coreboot.org>
Reviewed-by: Nico Huber <nico.h(a)gmx.de>
---
M Makefile
1 file changed, 6 insertions(+), 5 deletions(-)
Approvals:
build bot (Jenkins): Verified
Nico Huber: Looks good to me, approved
diff --git a/Makefile b/Makefile
index ba67069..f586b71 100644
--- a/Makefile
+++ b/Makefile
@@ -1406,16 +1406,17 @@
# 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)/"
--
To view, visit https://review.coreboot.org/21825
To unsubscribe, visit https://review.coreboot.org/settings
Gerrit-Project: flashrom
Gerrit-Branch: staging
Gerrit-MessageType: merged
Gerrit-Change-Id: Iff4021be49a9fab208b619c555b9f9e81f671ab8
Gerrit-Change-Number: 21825
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: David Hendricks <david.hendricks(a)gmail.com>
Gerrit-Reviewer: Nico Huber <nico.h(a)gmx.de>
Gerrit-Reviewer: Paul Menzel <paulepanter(a)users.sourceforge.net>
Gerrit-Reviewer: Stefan Tauner <stefan.tauner(a)gmx.at>
Gerrit-Reviewer: build bot (Jenkins) <no-reply(a)coreboot.org>