lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20250221115601.170674-1-ojaswin@linux.ibm.com>
Date: Fri, 21 Feb 2025 17:26:01 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: linux-ext4@...r.kernel.org, "Theodore Ts'o" <tytso@....edu>
Subject: [PATCH] kvm-xfstests: fix wget progress bar support

On fedora 41, running kvm-xfstest for the first time throws the
following error:

  Unknown option 'show-progress'

This is because fedora uses wget2 where the --show-progress flag
has been replaced with --force-progress [1]. Hence modify the code
to detect the wget version and use the appropriate flag.

[1] https://gitlab.com/gnuwget/wget2/-/wikis/Home#differing-cli-options-wgetwget2

Signed-off-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
---
 run-fstests/kvm-xfstests | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/run-fstests/kvm-xfstests b/run-fstests/kvm-xfstests
index a53cc89..99e504b 100755
--- a/run-fstests/kvm-xfstests
+++ b/run-fstests/kvm-xfstests
@@ -60,7 +60,19 @@ if test -z "$EXPLICIT_ROOT_FS" ; then
 	f=root_fs.img.$ARCH
 	ROOT_FS="$(dirname $DIR)/test-appliance/$f"
 	echo "Downloading $f..."
-	wget -nv --show-progress -O "$ROOT_FS.new" "$DOWNLOAD_BASE_URL/$f"
+
+	# wget1 and 2 have different flags to show progress bar
+	WGET_VERSION=$(wget --version | head -n1 | awk '{print $3}' | cut -d. -f1)
+	if [[ "$WGET_VERSION" -eq 1 ]]; then
+			PROGRESS_FLAG="--show-progress"
+	elif [[ "$WGET_VERSION" -eq 2 ]]; then
+			PROGRESS_FLAG="--force-progress"
+	else
+			# don't show progress bar if we can't determine version
+			PROGRESS_FLAG=""
+	fi
+	wget -nv $PROGRESS_FLAG -O "$ROOT_FS.new" "$DOWNLOAD_BASE_URL/$f"
+
 	mv "$ROOT_FS.new" "$ROOT_FS"
     fi
 fi
-- 
2.48.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ