FreeBSD Bugzilla – Attachment 108639 Details for
Bug 149510
[build] CFT: sys/conf/newvers.sh: Cleanup and additions.
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
newvers.sh.txt
newvers.sh.txt (text/plain), 3.28 KB, created by
jhell
on 2010-08-11 02:42:17 UTC
(
hide
)
Description:
newvers.sh.txt
Filename:
MIME Type:
Creator:
jhell
Created:
2010-08-11 02:42:17 UTC
Size:
3.28 KB
patch
obsolete
>Index: newvers.sh >=================================================================== >--- newvers.sh (revision 211154) >+++ newvers.sh (working copy) >@@ -78,12 +78,8 @@ > " > > LC_ALL=C; export LC_ALL >-if [ ! -r version ] >-then >- echo 0 > version >-fi >+[ ! -r version ] && echo 0 >version > >-touch version > v=`cat version` u=${USER:-root} d=`pwd` h=${HOSTNAME:-`hostname`} t=`date` > i=`${MAKE:-make} -V KERN_IDENT` > >@@ -95,39 +91,63 @@ > fi > SRCDIR=${SRCDIR%%/sys/*} > >- for dir in /bin /usr/bin /usr/local/bin; do >- if [ -d "${SRCDIR}/sys/.svn" -a -x "${dir}/svnversion" ] ; then >- svnversion=${dir}/svnversion >- break >- fi >- if [ -d "${SRCDIR}/.git" -a -x "${dir}/git" ] ; then >- git_cmd="${dir}/git --git-dir=${SRCDIR}/.git" >- break >+ if [ -d "${SRCDIR}/.svn" -o -d "${SRCDIR}/sys/.svn" ]; then >+ for dir in /usr/local/bin; do >+ if [ -x "${dir}/svn" ]; then >+ svnversion=${dir}/svnversion >+ break >+ fi >+ done >+ if [ -n "$svnversion" ] ; then >+ svnrev=" r`cd ${SRCDIR}/sys && $svnversion`" > fi >- done >+ fi > >- if [ -n "$svnversion" ] ; then >- svn=" r`cd ${SRCDIR}/sys && $svnversion`" >+ if [ -d "${SRCDIR}/.hg" -o -d "${SRCDIR}/sys/.hg" ]; then >+ for dir in /usr/local/bin; do >+ if [ -x "${dir}/hg" ]; then >+ hg=${dir}/hg >+ break >+ fi >+ done >+ if [ -n "$hg" ]; then >+ hgrev=" `cd ${SRCDIR}/sys && $hg tip --template '{rev}:{node|short}'`" >+ fi > fi >- if [ -n "$git_cmd" ] ; then >- git=`$git_cmd rev-parse --verify --short HEAD 2>/dev/null` >- svn=`$git_cmd svn find-rev $git 2>/dev/null` >- if [ -n "$svn" ] ; then >- svn=" r${svn}" >- git="=${git}" >- else >- svn=`$git_cmd log | fgrep 'git-svn-id:' | head -1 | \ >- sed -n 's/^.*@\([0-9][0-9]*\).*$/\1/p'` >- if [ -n $svn ] ; then >- svn=" r${svn}" >- git="+${git}" >+ >+ if [ -d "${SRCDIR}/.git" -o -d "${SRCDIR}/sys/.git" ]; then >+ for dir in /usr/local/bin; do >+ if [ -x "${dir}/git" ]; then >+ if [ -d "${SRCDIR}/.git" ]; then >+ git="${dir}/git --git-dir=${SRCDIR}/.git" >+ git="${git} --work-tree=${SRCDIR}" >+ else >+ git="${dir}/git --git-dir=${SRCDIR}/sys/.git" >+ git="${git} --work-tree=${SRCDIR}/sys" >+ fi >+ break >+ fi >+ done >+ >+ if [ -n "$git" ] ; then >+ gitrev="`$git rev-parse --verify --short HEAD 2>/dev/null`" >+ gitsvnrev="`$git svn find-rev $gitrev 2>/dev/null`" >+ if [ -n "${gitsvnrev}" ] ; then >+ svnrev=" r${gitsvnrev}" >+ gitrev="=${gitrev}" > else >- git=" ${git}" >+ gitsvnid="`$git log | sed -n '/git-svn-id:/ { >+ s/.*@\([[:digit:]]\{1,\}\).*/\1/p; q; }'`" >+ if [ -n "${gitsvnid}" ]; then >+ svnrev=" r${gitsvnid}" >+ gitrev="+${gitrev}" >+ else >+ gitrev=" ${gitrev}" >+ fi >+ fi >+ if [ -n "`$git diff-index --name-only HEAD`" ]; then >+ gitrev="${gitrev}-dirty" > fi >- fi >- if $git_cmd --work-tree=${SRCDIR} diff-index \ >- --name-only HEAD | read dummy; then >- git="${git}-dirty" > fi > fi > ;; >@@ -135,8 +155,8 @@ > > cat << EOF > vers.c > $COPYRIGHT >-#define SCCSSTR "@(#)${VERSION} #${v}${svn}${git}: ${t}" >-#define VERSTR "${VERSION} #${v}${svn}${git}: ${t}\\n ${u}@${h}:${d}\\n" >+#define SCCSSTR "@(#)${VERSION} #${v}${svnrev}${gitrev}${hgrev} ${t}" >+#define VERSTR "${VERSION} #${v}${svnrev}${gitrev}${hgrev} ${t}\\n ${u}@${h}:${d}\\n" > #define RELSTR "${RELEASE}" > > char sccs[sizeof(SCCSSTR) > 128 ? sizeof(SCCSSTR) : 128] = SCCSSTR;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 149510
:
108638
| 108639 |
108640
|
108641