[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#951367: [PATCH] don't pass an empty arg to wget when --verbose is applied (Closes: #951367)



On 2020-02-18 20:47, Daniel Kahn Gillmor wrote:
If NVSWITCH is empty, the old code was running wget '' …

But this causes wget to fail to fetch the empty URL, which means the
return code ends up being non-zero.  This breaks sbuild-createchroot,
which apparently always passes --verbose to debootstrap.

This error was introduced in 14f0b7aafb4d568b027baeecee08cfac6c4f874d,
so is relatively recent.
---
  functions | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/functions b/functions
index a3c93e9..d6725f7 100644
--- a/functions
+++ b/functions
@@ -93,7 +93,7 @@ wgetprogress () {
  		ret=$({ { wget $@ 2>&1 >/dev/null || echo $? >&2; } | "$PKGDETAILS" "WGET%" "$PROGRESS_NOW" "$PROGRESS_NEXT" "$PROGRESS_END" >&3; } 2>&1)
  		: ${ret:=0}
  	else
-		wget "$NVSWITCH" "$@"
+		wget $NVSWITCH "$@"
  		ret=$?
  	fi
  	return $ret


I can confirm the bug and the solutions. Either omitting "--verbose" or patching /usr/share/debootstrap/functions helps.


Regards,
Stefan


Reply to: