James Carlson wrote:
> Roland Mainz writes:
> > > SVN support in tools, yes. In ON build, "huh."
> >
> > Well, the whole ksh93-integration stuff is done via Subversion since the
> > beginning. I did one attempt to do some work with Mercurial long ago,
> > lost the work of two weeks because Mercurial ate parts of the tree and
> > then we never tried it again until today...
>
> I don't think anyone is working on making ON's build system support
> Subversion. It'd have limited utility as the gate itself is
> Mercurial.
Right... but when we made the decision (AFAIK that was in April/May
2006) for Subversion Mercurial wasn't stable. And a later attempt to use
Mercurial resulted in a ultimate worse case scenerio because hg ate
parts of the tree (and destroyed two weeks of work).
> > > In the mean time, "touch usr/src/tools/findunref/exception_list.svn" (or
> > > whatever which_scm reports for Subversion) should get you by.
> >
> > It seems I am getting "unknown" in this case (somehow the use of
> > Subversion isn't detected properly... ;-( ) and I would need a file
> > called "usr/src/tools/findunref/exception_list.unknown".
>
> That's an interesting problem that needs some debugging in your
> environment. What should be happening here is that the SCM_TYPE
> variable should be set by the `nightly' script, and the findunref
> Makefile uses this to figure out the right per-SCM exception_list.*
> file.
In the meantime I found the problem is simply that "usr/" is the base of
our tree while "which_scm" expects that the root is one directory above
that directory. Attached is a prototype patch
("which_scm_usr_base_patch001.diff.txt") which solves the issue (but it
may be nice to do more cleanup, e.g. replace the "set --" usage with
normal arrays (which is less error prone in this case, too). I can make
a more complete patch for that on demand later...).
----
Bye,
Roland
--
__ . . __
(o.\ \/ /.o) roland.mainz at nrubsig.org
\__\/\/__/ MPEG specialist, C&&JAVA&&Sun&&Unix programmer
/O /==\ O\ TEL +49 641 3992797
(;O/ \/ \O;)
-------------- next part --------------
Index: src/tools/scripts/which_scm.sh
===================================================================
--- src/tools/scripts/which_scm.sh (revision 1173)
+++ src/tools/scripts/which_scm.sh (working copy)
@@ -1,4 +1,4 @@
-#!/usr/bin/ksh -p
+#!/usr/bin/ksh93
#
# CDDL HEADER START
#
@@ -53,13 +53,15 @@
# Check for well-known tree-type source code management (SCM) systems.
function primary_type
{
- typeset scmid
+ nameref scmid=$1
+
+ scmid=""
- [ -d "$1/Codemgr_wsdata" ] && scmid="$scmid teamware"
- [ -d "$1/.hg" ] && scmid="$scmid mercurial"
- [ -d "$1/CVS" ] && scmid="$scmid cvs"
- [ -d "$1/.svn" ] && scmid="$scmid subversion"
- echo $scmid
+ [[ -d "$2/Codemgr_wsdata" || -d "$2/usr/Codemgr_wsdata" ]] && scmid+="
teamware"
+ [[ -d "$2/.hg" || -d "$2/usr/.hg" ]] && scmid+=" mercurial"
+ [[ -d "$2/CVS" || -d "$2/usr/CVS" ]] && scmid+=" cvs"
+ [[ -d "$2/.svn" || -d "$2/usr/.svn" ]] && scmid+=" subversion"
+ return 0
}
if [[ -n "$CODEMGR_WS" ]]; then
@@ -67,8 +69,8 @@
print -u2 "which_scm: $CODEMGR_WS is not a directory."
exit 1
fi
- set -- $(primary_type "$CODEMGR_WS")
- if [[ $# != 1 ]]; then
+ set -- $(primary_type tmp "$CODEMGR_WS" ; print "$tmp")
+ if (( $# != 1 )) then
set -- unknown
fi
echo "$1 $CODEMGR_WS"
@@ -88,12 +90,12 @@
# Scan upwards looking for top of tree.
DIR=$ORIG_CWD
-CWD_TYPE=$(primary_type "$DIR")
+primary_type CWD_TYPE "$DIR"
SCM_TYPE=
while [[ "$DIR" != / ]]; do
- set -- $(primary_type "$DIR")
- if [[ $# > 1 ]]; then
- echo "unknown $ORIG_CWD"
+ set -- $(primary_type tmp "$DIR" ; print "$tmp")
+ if (( $# > 1 )); then
+ printf "unknown %s\n" "$ORIG_CWD"
exit 0
fi
SCM_TYPE="$1"