On Wed, 2009-02-18 at 09:02 -0500, Paul Mossman wrote:
> Hi all,
>
> It was reported that svn-version fails in the Express Development
> Environment. This results in RPM filenames and sipXconfig showing
> "unknown" for the version number.
>
> This is actually due to a limitation in the svn-version script when
> run on git repositories. The script uses the return value of "git
> branch" to decide if you're using git. But this only succeeds when
> the command is actually run from within a git repository.
>
> The EDE happens to put it's BUILD directory outside the source code
> directory structure. Since make is run from BUILD, the svn-version
> command fails.
>
> In order to fix the problem I'm proposing to pushd into $topdir
> (e.g. /home/sipx/WORKING/main/sipXconfig) near the top of the script,
> and popd at the end. This seems to work well for both git and svn.
>
> Any objections to this change? (Patch attached.)
> <<0001-Changed-the-svn-version-script-to-work-for-git-even.patch>>
It works for me in my build structure (which makes the build directory a
subdirectory of the top level source directory).
I've attached a modified version of the patch with a couple of
robustness and style improvements (you didn't stick to the style already
in use in the file).
diff --git a/config/svn-version b/config/svn-version
index ea294c0..da9d868 100755
--- a/config/svn-version
+++ b/config/svn-version
@@ -7,6 +7,11 @@ then
SIPX_BUILD_LABEL=${USER}
fi
+if [ -n "$topdir" -a -d "$topdir" ]
+then
+ pushd $topdir > /dev/null 2>&1
+fi
+
if test -d ${topdir}/.svn
then
svnversion ${topdir} \
@@ -39,3 +44,9 @@ else
echo 0.unknown
fi
fi
+
+if [ -n "$topdir" -a -d "$topdir" ]
+then
+ popd > /dev/null 2>&1
+fi
+
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev