[svk-devel] Non-interactive use of "svk info"

David Kaufman david at gigawatt.com
Wed Jun 6 17:43:10 EDT 2007


Adam D. Barratt <lists+svk-devel at adam-barratt.org.uk> wrote:
>
> David Kaufman lied:
>> Either the *presence* of the SVKROOT environment variable (even set
>> to an empty string), or the existence of ~/.svk/ is enough to make
>> the "svk info" command run non-interactively.
>
> Has that changed recently? I still get prompted :-(
>
> adam:~$ ls -ltrd /home/adam/.svk/
> drwxr-xr-x 3 adam adam 4096 2007-06-06 21:59 /home/adam/.svk/

ah, my bad.  You are right.  My test assumes that ~/.svk was created by 
someone *using* svk and therfore initializing the repository...

So yes, I guess the only way to suppress the prompt is to avoid running 
svk info unless the directory (not file) ~/svk/local exists, as your 
pseudocode does.


My version (just FTA) of a non-hanging non-interactive svk-co test would 
then become:

  # if ($SVKROOT is set and points to an existing directory
  # containing a "local" subdirectory - or - the user's home
  # directory conatins a .svk/local subdirectory)
  # AND if svk info succeeds, print Yup
  # else print Nope
  if [ -d ${SVKROOT-~/.svk}/local ] && svk info >& /dev/null; then
    echo Yup
  else
    echo Nope
  fi

-dave 



More information about the svk-devel mailing list