On 02/16/2011 02:34 AM, Roger Oberholtzer wrote:
On Tue, 2011-02-15 at 17:28 -0600, David C. Rankin wrote:
Guys,
I want a quick and dirty want to get the svn revision of a local svn module. What I'm currently doing is:
#!/bin/bash getsvnrev() { msg "Determining SVN revision for $pkgname..." [[ -d .svn ]] && echo $(sed -n '4p' .svn/entries) || echo 9999 }
pkgver=$(getsvnrev)
It works fine, but is there a standard way (no not svnversion) to read the local version other than the backwards way I'm doing it?
-- David C. Rankin, J.D.,P.E.
I have been using this:
svn info | grep "Last Changed Rev:" | cut -d' ' -f 4
Works for me. But I never have liked the grep of a string as I guess it could change based on a locale setting. Nonetheless, it works for me.
Yours sincerely,
Roger Oberholtzer
Thanks Roger, It looks like sed -n '4p' .svn/entries -> gives Revision: sed -n '11p' .svn/entries -> gives Last Changed Rev: Only problem is I don't know how consistent the 4/11 line numbers are. or using svn info (without pipes) Revision: cut -d' ' -f 2 < <(grep "Revision:" < <(svn info)) Last Changed Rev: cut -d' ' -f 4 < <(grep "Last Changed Rev:" < <(svn info)) I like svn info! Thanks -- David C. Rankin, J.D.,P.E. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org