#!/bin/bash


if [[ $1 ]]; then
   pkgpath=$(garfind -p $1)
else
   if grep -q GARNAME Makefile 2>/dev/null; then
      pkgpath=$(pwd)
   else
      echo "You did not specify a package name and the current directory"
      echo "does not seem to be a GAR package directory."
      exit 1
   fi
fi

if [[ -z $pkgpath ]]; then
   echo package "'$1'" not found
   exit 1
fi

make -sC "$pkgpath" pkginfo

