summaryrefslogtreecommitdiffstats
path: root/contrib/dtc/scripts
diff options
context:
space:
mode:
authorraj <raj@FreeBSD.org>2010-02-28 21:57:35 +0000
committerraj <raj@FreeBSD.org>2010-02-28 21:57:35 +0000
commit661abc4ccde64bfa5be654487f1e456221d0e3ec (patch)
treee053cde8c27573ffd8d63c81d9534afa521db747 /contrib/dtc/scripts
parentabfd52212402df81f78a0d24823e9d45b2aaab3f (diff)
parent0ced8a1da7135fbd44290fe606d83149a0e9450f (diff)
downloadFreeBSD-src-661abc4ccde64bfa5be654487f1e456221d0e3ec.zip
FreeBSD-src-661abc4ccde64bfa5be654487f1e456221d0e3ec.tar.gz
Merge DTC-d75b33af.
This is a split merge because of non-uniform licensing of the DTC package contents and the way these components will be used in the FreeBSD environment. The original DTC package is composed of the following two major pieces: 1. sys/contrib/libfdt (BSD [dual] license) 2. contrib/dtc (GPLv2) The libfdt component is going to be shared in all aspects of the environment: - /boot/loader - kernel - dtc (the device tree compiler proper, userspace tool)
Diffstat (limited to 'contrib/dtc/scripts')
-rwxr-xr-xcontrib/dtc/scripts/setlocalversion22
1 files changed, 22 insertions, 0 deletions
diff --git a/contrib/dtc/scripts/setlocalversion b/contrib/dtc/scripts/setlocalversion
new file mode 100755
index 0000000..82e4993
--- /dev/null
+++ b/contrib/dtc/scripts/setlocalversion
@@ -0,0 +1,22 @@
+#!/bin/sh
+# Print additional version information for non-release trees.
+
+usage() {
+ echo "Usage: $0 [srctree]" >&2
+ exit 1
+}
+
+cd "${1:-.}" || usage
+
+# Check for git and a git repo.
+if head=`git rev-parse --verify HEAD 2>/dev/null`; then
+ # Do we have an untagged version?
+ if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then
+ printf '%s%s' -g `echo "$head" | cut -c1-8`
+ fi
+
+ # Are there uncommitted changes?
+ if git diff-index HEAD | read dummy; then
+ printf '%s' -dirty
+ fi
+fi
OpenPOWER on IntegriCloud