|
2 | 2 |
|
3 | 3 | # script control variables |
4 | 4 |
|
5 | | -reponame="cap1xxx" # leave this blank for auto-detection |
6 | | -libname="cap1xxx" # leave this blank for auto-detection |
| 5 | +reponame="" # leave this blank for auto-detection |
| 6 | +libname="" # leave this blank for auto-detection |
| 7 | +packagename="" # leave this blank for auto-selection |
7 | 8 |
|
8 | 9 | debianlog="debian/changelog" |
9 | 10 | debcontrol="debian/control" |
@@ -51,15 +52,21 @@ if [ -z "$reponame" ]; then |
51 | 52 | repodir="$rootdir" |
52 | 53 | reponame="$(basename $repodir)" |
53 | 54 | fi |
| 55 | + reponame=$(echo "$reponame" | tr "[A-Z]" "[a-z]") |
54 | 56 | fi |
55 | 57 |
|
56 | 58 | if [ -z "$libname" ]; then |
57 | 59 | cd "$libdir" |
58 | 60 | libname=$(grep "name" setup.py | tr -d "[:space:]" | cut -c 7- | rev | cut -c 3- | rev) |
59 | | - cd "$debdir" |
| 61 | + libname=$(echo "$libname" | tr "[A-Z]" "[a-z]") && cd "$debdir" |
| 62 | +fi |
| 63 | + |
| 64 | +if [ -z "$packagename" ]; then |
| 65 | + packagename="$libname" |
60 | 66 | fi |
61 | 67 |
|
62 | 68 | echo "reponame is $reponame and libname is $libname" |
| 69 | +echo "output packages will be python-$packagename and python3-$packagename" |
63 | 70 |
|
64 | 71 | # checking generating changelog file |
65 | 72 |
|
|
82 | 89 |
|
83 | 90 | inform "checking debian/copyright file..." |
84 | 91 |
|
85 | | -if ! grep "^Source" $debcopyright | grep "$libname" $debcopyright &> /dev/null; then |
| 92 | +if ! grep "^Source" $debcopyright | grep "$reponame" &> /dev/null; then |
86 | 93 | warning "$(grep "^Source" $debcopyright)" && FLAG=true |
87 | 94 | fi |
88 | 95 |
|
89 | | -if ! grep "^Upstream-Name" $debcopyright | grep "$libname" $debcopyright &> /dev/null; then |
| 96 | +if ! grep "^Upstream-Name" $debcopyright | grep "$libname" &> /dev/null; then |
90 | 97 | warning "$(grep "^Upstream-Name" $debcopyright)" && FLAG=true |
91 | 98 | fi |
92 | 99 |
|
93 | 100 | # checking debian/control file |
94 | 101 |
|
95 | 102 | inform "checking debian/control file..." |
96 | 103 |
|
97 | | -if ! grep "^Source" $debcontrol | grep "$libname" $debcontrol &> /dev/null; then |
| 104 | +if ! grep "^Source" $debcontrol | grep "$libname" &> /dev/null; then |
98 | 105 | warning "$(grep "^Source" $debcontrol)" && FLAG=true |
99 | 106 | fi |
100 | 107 |
|
101 | | -if ! grep "^Homepage" $debcontrol | grep "$reponame" $debcontrol &> /dev/null; then |
| 108 | +if ! grep "^Homepage" $debcontrol | grep "$reponame" &> /dev/null; then |
102 | 109 | warning "$(grep "^Homepage" $debcontrol)" && FLAG=true |
103 | 110 | fi |
104 | 111 |
|
105 | | -if ! grep "^Package: python-$libname" $debcontrol &> /dev/null; then |
| 112 | +if ! grep "^Package: python-$packagename" $debcontrol &> /dev/null; then |
106 | 113 | warning "$(grep "^Package: python-" $debcontrol)" && FLAG=true |
107 | 114 | fi |
108 | 115 |
|
109 | | -if ! grep "^Package: python3-$libname" $debcontrol &> /dev/null; then |
| 116 | +if ! grep "^Package: python3-$packagename" $debcontrol &> /dev/null; then |
110 | 117 | warning "$(grep "^Package: python3-" $debcontrol)" && FLAG=true |
111 | 118 | fi |
112 | 119 |
|
|
119 | 126 |
|
120 | 127 | inform "checking debian/rules file..." |
121 | 128 |
|
122 | | -if ! grep "debian/python-$libname" $debrules &> /dev/null; then |
| 129 | +if ! grep "debian/python-$packagename" $debrules &> /dev/null; then |
123 | 130 | warning "$(grep "debian/python-" $debrules)" && FLAG=true |
124 | 131 | fi |
125 | 132 |
|
126 | | -if ! grep "debian/python3-$libname" $debrules &> /dev/null; then |
| 133 | +if ! grep "debian/python3-$packagename" $debrules &> /dev/null; then |
127 | 134 | warning "$(grep "debian/python3-" $debrules)" && FLAG=true |
128 | 135 | fi |
129 | 136 |
|
|
0 commit comments