+function figure_last_import () {
+ module=$1; shift
+ last_import=$(svn list $svn/$module/imports | grep '^import-' | sort | tail -1 | sed -e s,import-,, -e s,/,,g )
+ echo $last_import
+}
+
+function figure_next_import () {
+ last_import=$1; shift
+ current_index=$(echo $last_import | sed -e 's,-.*,,')
+ # remove leading 0 that confuse printf (takes it as octal)
+ decimal_index=$(echo $current_index | sed 's,^0*,,' )
+ next_index=$(printf "%03d" $(($decimal_index+1)))
+ echo ${next_index}-${cvstag}-${date}
+}
+