File kernel-build-tools-0.103.1-fix-bashisms.patch of Package kernel-build-tools

diff -Ndurp kernel-build-tools-0.103.1/buildmodules kernel-build-tools-0.103.1-fix-bashisms/buildmodules
--- kernel-build-tools-0.103.1/buildmodules	2013-07-16 16:15:16.000000000 +0300
+++ kernel-build-tools-0.103.1-fix-bashisms/buildmodules	2014-10-19 01:21:04.885222293 +0300
@@ -187,7 +187,7 @@ build_module()
 		local pkg_name pkg_version pkg_release package real
 		local need_update=
 		get_package_info "$template"
-		pkg_name="${pkg_name/@kflavour@/$KERNEL_FLAVOUR}"
+		pkg_name="$(echo "$pkg_name" | sed "s|@kflavour@|$KERNEL_FLAVOUR|")"
 		pkg_release="$pkg_release.$KERNEL_CODE.$KERNEL_BUILDRELEASE"
 		package="$pkg_name-$pkg_version-$pkg_release.$rpm_target.rpm"
 		local rpmdir
@@ -376,10 +376,8 @@ for kernel in $kernels; do
 	echo "* Kernel: $KERNEL_VERSION-$KERNEL_FLAVOUR-$KERNEL_RELEASE"
 	if [ $# -eq 0 ]; then
 		branch_spec=
-		if [ "${opt_distribution}" != "${opt_distribution##alt-linux-}" ]; then
-			branch_spec=".M${opt_distribution##alt-linux-}"
-			branch_spec=".${branch_spec//./}"
-		fi
+		[ "${opt_distribution}" = "${opt_distribution##alt-linux-}" ] ||
+			branch_spec=".$(echo "M${opt_distribution##alt-linux-}" | tr -d.)"
 		modules="$(get_modules_to_build "kernel-image-$KERNEL_FLAVOUR${branch_spec}")"
 	else
 		modules="$*"
diff -Ndurp kernel-build-tools-0.103.1/updatemodules kernel-build-tools-0.103.1-fix-bashisms/updatemodules
--- kernel-build-tools-0.103.1/updatemodules	2013-07-16 16:15:16.000000000 +0300
+++ kernel-build-tools-0.103.1-fix-bashisms/updatemodules	2014-10-19 01:20:45.638223595 +0300
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/bin/sh
 
 TOP="$(readlink -ev .)"
 
@@ -88,10 +88,8 @@ for flavour in $opt_kernels; do
 
 	if [ -z "$opt_old_version" ]; then
 		branch_spec=
-		if [ "${opt_distribution}" != "${opt_distribution##alt-linux-}" ]; then
-			branch_spec=".M${opt_distribution##alt-linux-}"
-			branch_spec=".${branch_spec//./}"
-		fi
+		[ "${opt_distribution}" = "${opt_distribution##alt-linux-}" ] ||
+			branch_spec=".$(echo "M${opt_distribution##alt-linux-}" | tr -d.)"
 		specfile="$(GIT_DIR=kernel/.git git ls-tree "kernel-image-$flavour$branch_spec" |
 			sed -ne 's/^[^[:space:]]\+[[:space:]]\+blob[[:space:]]\+[^[:space:]]\+[[:space:]]\+\([^/[:space:]]\+\.spec\)$/\1/p')"
 		[ `printf %s "$specfile" | wc -l` -le 0 ] ||
openSUSE Build Service is sponsored by