From 02bb6967048cb1051c481e3354bc769d19482da9 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Mon, 4 Oct 2010 00:28:28 -0300 Subject: [PATCH] Make schhist more forgiving if profile or top-level sheet is missing. - schhist/gitsch2ps: issue a (fatal) error only if .pro and .sch are missing - schhist/gitsch2ps: exit with success if only one of .pro and .sch is missing - schhist/schhist2web: skip commits for which no Postscript was generated --- schhist/gitsch2ps | 18 +++++++++++++++--- schhist/schhist2web | 1 + 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/schhist/gitsch2ps b/schhist/gitsch2ps index 5da6ac6..9a40660 100755 --- a/schhist/gitsch2ps +++ b/schhist/gitsch2ps @@ -71,15 +71,27 @@ rm -rf "$outdir" git clone -q -s -n "$dir/.git" "$tmp" || exit ( cd "$tmp" && git checkout -q "$commit"; ) || exit -if [ ! -f "$tmp/$schem" ]; then - echo "$schem not found (checked out into $tmp)" 1>&2 +pro=${schem%.sch}.pro + +if [ ! -f "$tmp/$pro" -a ! -f "$tmp/$schem" ]; then + echo "neither $pro nor $schem found (checked out into $tmp)" 1>&2 exit 1 fi +if [ ! -f "$tmp/$schem" ]; then + echo "$schem not found (checked out into $tmp), skipping commit" 1>&2 + exit 0 +fi + +if [ ! -f "$tmp/$pro" ]; then + echo "$pronot found (checked out into $tmp), skipping commit" 1>&2 + exit 0 +fi + ( cd "$sch" || exit rm -f *.ps - $sanitize_profile "$tmp/${schem%.sch}.pro" || exit + $sanitize_profile "$tmp/$pro" || exit $sanitize_schem "$tmp/$schem" || exit eeschema --plot "$tmp/$schem" ) || exit diff --git a/schhist/schhist2web b/schhist/schhist2web index 18aa576..cc0f1cc 100755 --- a/schhist/schhist2web +++ b/schhist/schhist2web @@ -239,6 +239,7 @@ for n in $first `cd "$dir" && git rev-list --reverse $first..HEAD`; do # tmp2=`gitsch2ps -k $sanitize "$dir" "$schname" $n "$tmp"` || exit for m in "$tmp"/*.ps; do + [ "$m" = "$tmp/*.ps" ] && break # call sub-sheets by their own name, without prepending the # top-level sheet's name name=`basename "$m" .ps`