Skip to content

Commit 8b071e6

Browse files
committed
fix source package name determination
1 parent 18547a6 commit 8b071e6

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

lib/common.sh

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1087,9 +1087,24 @@ function push_to_remote() {
10871087
#
10881088
function set_changelog() {
10891089
check_env PACKAGE_REVISION
1090-
local src_package="${1:-$PACKAGE}"
10911090
local final_version
10921091

1092+
#
1093+
# If the name of the source package isn't passed in as a parameter,
1094+
# then deduce it. If there's a debian/control file that specifies that
1095+
# package name, then use it. Otherwise, default to the name of the
1096+
# linux-pkg directory name. This can't always be the default because
1097+
# for some packages (for some reasons lost to the sands of time), those
1098+
# are different. For example, the challenge-response linux-pkg
1099+
# directory generates the pam-challenge-response debian package.
1100+
#
1101+
if [[ -n $1 ]]; then
1102+
src_package=$1
1103+
elif [[ -f debian/control ]]; then
1104+
src_package=$(awk '/^Source:/ { print $2 }' debian/control)
1105+
fi
1106+
src_package=${src_package:-$PACKAGE}
1107+
10931108
#
10941109
# If PACKAGE_VERSION hasn't been set already, then retrieve it from
10951110
# The changelog file. If the changelog file doesn't exist, which

0 commit comments

Comments
 (0)