Skip to contentSkip to conversation

kbuild: deb-pkg: Fix build error caused by lack of positionnal argument

PATCH In review Marc Zyngier 2 participants 3 messages Jul 10, 2024 – Jul 16, 2024 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: deb-pkg: Fix build error caused by lack of positionnal argument

Since 8ef052389f7f ("kbuild: package: add -e and -u options to some shell scripts"), building a debian package on my arm64 box fails:

$ make -j20 bindeb-pkg
  UPD     include/config/kernel.release
  GEN     debian
./scripts/package/mkdebian: 138: 1: parameter not set
make[2]: *** [scripts/Makefile.package:98: debian] Error 2
make[1]: *** [/home/maz/hot-poop/arm-platforms/Makefile:1538: bindeb-pkg] Error 2
make: *** [Makefile:224: __sub-make] Error 2

Applying the same pattern for substitution of undefined variables seems to paper over the issue and brings the script back to life.

Fixes 8ef052389f7f ("kbuild: package: add -e and -u options to some shell scripts")
Cc Masahiro Yamada <[email protected]>
Cc Nicolas Schier <[email protected]>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/package/mkdebian +1 -1
index 196b14e8ad47..de8b460a46b4 100755
@@ -135,7 +135,7 @@ else
 fi
 maintainer="${name} <${email}>"
 
-if [ "$1" = --need-source ]; then
+if [ "${1:+set}" = --need-source ]; then
 	gen_source
 fi
 
Signature · 1 line
2.39.2
#1 lore raw
Quoted 28 lines · Marc Zyngier

Since 8ef052389f7f ("kbuild: package: add -e and -u options to some shell scripts"), building a debian package on my arm64 box fails:

$ make -j20 bindeb-pkg
  UPD     include/config/kernel.release
  GEN     debian
./scripts/package/mkdebian: 138: 1: parameter not set
make[2]: *** [scripts/Makefile.package:98: debian] Error 2
make[1]: *** [/home/maz/hot-poop/arm-platforms/Makefile:1538: bindeb-pkg] Error 2
make: *** [Makefile:224: __sub-make] Error 2

Applying the same pattern for substitution of undefined variables seems to paper over the issue and brings the script back to life.

Fixes 8ef052389f7f ("kbuild: package: add -e and -u options to some shell scripts")
Cc Masahiro Yamada <[email protected]>
Cc Nicolas Schier <[email protected]>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/package/mkdebian +0 -0
index 196b14e8ad47..de8b460a46b4 100755

scripts/package/mkdebian else · line 141

Quoted 8 lines
scripts/package/mkdebian +1 -1
@@ -135,7 +135,7 @@ else
 fi
 maintainer="${name} <${email}>"
 
-if [ "$1" = --need-source ]; then
+if [ "${1:+set}" = --need-source ]; then
        gen_source
 fi
 

This is wrong.

It will break 'make srcdeb-pkg' because
"set" = "--need-source" is always false.

I will squash the following.

while [ $# -gt 0 ]; do

    case "$1" in
    --need-source)
        gen_source
        shift
        ;;
    *)
        break
        ;;
    esac

done

Thanks for the report.

Signature · 2 lines
Best Regards
Masahiro Yamada
#2 lore raw
Quoted 60 lines · Masahiro Yamada
Quoted 28 lines · Marc Zyngier

Since 8ef052389f7f ("kbuild: package: add -e and -u options to some shell scripts"), building a debian package on my arm64 box fails:

$ make -j20 bindeb-pkg
  UPD     include/config/kernel.release
  GEN     debian
./scripts/package/mkdebian: 138: 1: parameter not set
make[2]: *** [scripts/Makefile.package:98: debian] Error 2
make[1]: *** [/home/maz/hot-poop/arm-platforms/Makefile:1538: bindeb-pkg] Error 2
make: *** [Makefile:224: __sub-make] Error 2

Applying the same pattern for substitution of undefined variables seems to paper over the issue and brings the script back to life.

Fixes 8ef052389f7f ("kbuild: package: add -e and -u options to some shell scripts")
Cc Masahiro Yamada <[email protected]>
Cc Nicolas Schier <[email protected]>
---
 scripts/package/mkdebian | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/package/mkdebian +0 -0
index 196b14e8ad47..de8b460a46b4 100755

scripts/package/mkdebian else · line 141

Quoted 8 lines
scripts/package/mkdebian +1 -1
@@ -135,7 +135,7 @@ else
 fi
 maintainer="${name} <${email}>"
 
-if [ "$1" = --need-source ]; then
+if [ "${1:+set}" = --need-source ]; then
        gen_source
 fi
 

This is wrong.

It will break 'make srcdeb-pkg' because
"set" = "--need-source" is always false.

I will squash the following.

while [ $# -gt 0 ]; do

    case "$1" in
    --need-source)
        gen_source
        shift
        ;;
    *)
        break
        ;;
    esac
Quoted 4 lines

done

Thanks for the report.

This seems to work for me.

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.