From f446ceb0e9a4eae92cfc892746f3c0d1fc931833 Mon Sep 17 00:00:00 2001 From: Andrew Gaffney Date: Fri, 6 Mar 2009 07:32:32 -0600 Subject: [PATCH] Modify append_data to die on 0 arguments and check arg 2 with isTrue(). Based on a patch from robbat2 --- ChangeLog | 4 ++++ gen_initramfs.sh | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7dfc4f4..b0c11f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ # Copyright 1999-2009 Gentoo Foundation; 2008-2009 Various authors (see AUTHORS) # Distributed under the GPL v2 + 06 Mar 2009; Andrew Gaffney gen_initramfs.sh: + Modify append_data to die on 0 arguments and check arg 2 with isTrue(). + Based on a patch from robbat2 + 20 Feb 2009; Andrew Gaffney arch/sparc64/config.sh, gen_compile.sh, gen_funcs.sh, gen_package.sh: Add support for multiple possible kernel binary paths for gentoo bug diff --git a/gen_initramfs.sh b/gen_initramfs.sh index 40c6641..95fa971 100755 --- a/gen_initramfs.sh +++ b/gen_initramfs.sh @@ -561,7 +561,8 @@ append_data() { local name=$1 var=$2 local func="append_${name}" - if [ $# -eq 1 ] || [ ${var} -eq 1 ] + [ $# -eq 0 ] && gen_die "append_data() called with zero arguments" + if [ $# -eq 1 ] || isTrue ${var} then print_info 1 " >> Appending ${name} cpio data..." ${func} -- 2.26.2