#!/bin/csh
#
# Queries the current working directory name for version and
# revision information, assuming that the directory goes by
# the name "magic-x.y.z".  This script determines the number
# z and returns it.
#
set pkgname=`pwd`
set pkgname=${pkgname:t}
set version=${pkgname:s/magic-//}
if ( ${version} == ${pkgname} ) then
   set pkgname=`(cd ..; pwd)`
   set pkgname=${pkgname:t}
   set version=${pkgname:s/magic-//}
endif
set revision=`echo $version | cut -d. -f3`
echo $revision
