Commit b26611e3 authored by Steffen Möller's avatar Steffen Möller
Browse files

Fool-proofing

parent 8a4b2a23
Loading
Loading
Loading
Loading
+17 −0
Original line number Diff line number Diff line
@@ -11,6 +11,8 @@ if [ ! -f $SALSARC ] ; then
  echo "Just create one containing"
  echo 'SALSA_URL="https://salsa.debian.org/api/v4"'
  echo 'SALSA_TOKEN="YOUR_SALSA_TOKEN"'
  echo
  echo 'See https://salsa.debian.org/profile/personal_access_tokens to learn more.'
  exit 1
fi

@@ -22,6 +24,21 @@ check_return_code() {
    fi
}

if [ ! -d debian ]; then
  echo "E: Missing 'debian' folder. Please execute this script from the root of a nascent Debian package."
  exit 1
fi

if [ ! -d .git ]; then
  echo "E: This Debian package is meant to be imported into git already. But there is no .git directory."
  exit 1
fi

if [ ! -x /usr/bin/jq ]; then
  echo "E: You need the 'jq' JSON command line processor from the cognate package."
  exit 1
fi

. ${SALSARC}

DEBPKGNAME=`dpkg-parsechangelog | awk '/^Source:/ {print $2}'`