File: rename_package.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 (45 lines) | stat: -rwxr-xr-x 950 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

set -e

# Make sure there is only 1 argument passed
if [ "$#" -ne 1 ]; then
    echo "You must provide a new package name"
    exit 1
fi

# Make sure the new package name is not empty
if [ -z "$1" ]; then
    echo "You must provide a non-empty package name"
    exit 1
fi

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

# get the current package name
PACKAGE=$($DIR/get_package_name.sh)

# Announce the renaming
echo "Renaming from '$PACKAGE' to '$1'"

# .gitignore
sed -i "s|$PACKAGE|$1|g" $DIR/../.gitignore

# Doxyfile
sed -i "s|$PACKAGE|$1|g" $DIR/../Doxyfile

# Makefile
sed -i "s|$PACKAGE|$1|g" $DIR/../Makefile

# setup.py
sed -i "s|$PACKAGE|$1|g" $DIR/../setup.py

# docs/Makefile
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/Makefile

# docs/make.bat
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/make.bat

# docs/source/conf.py
sed -i "s|$PACKAGE|$1|g" $DIR/../docs/source/conf.py