File: get_package_name.sh

package info (click to toggle)
python-adb-shell 0.4.4-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 760 kB
  • sloc: python: 3,860; makefile: 191; sh: 124
file content (22 lines) | stat: -rwxr-xr-x 450 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

set -e

# get the directory of this script
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"

RSTRIP='"*'
LSTRIP='*"'

# get the package name
PACKAGE_LINE=$(grep "name=" $DIR/../setup.py || echo '')
PACKAGE_TEMP=${PACKAGE_LINE%$RSTRIP}
PACKAGE=${PACKAGE_TEMP##$LSTRIP}

# Make sure `PACKAGE` is not empty
if [ -z "$PACKAGE" ]; then
    echo "Package name could not be determined" >&2
    exit 1
fi

echo "$PACKAGE"