Skip to content

Commit 8ad05b3

Browse files
committed
scripts: fix hop count detection for DEB822 sources with ports
The get-distro-has-hop-count-sources.sh script was failing when DEB822 format sources contained URLs with port numbers (e.g., eqpv-artifact.dtc.local:8081). The traceroute command requires just the hostname without the port. Fix by stripping the port number from the hostname using cut -d':' -f1 after extracting the domain from the URL. This ensures traceroute receives a valid hostname regardless of whether the sources URL includes a port specification. Generated-by: Claude AI Signed-off-by: Luis Chamberlain <[email protected]>
1 parent 6adeca5 commit 8ad05b3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

scripts/get-distro-has-hop-count-sources.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ fi
3838
if [[ "$IS_DEB822" == "true" ]]; then
3939
# DEB822 format: URIs: https://deb.debian.org/debian
4040
HOST_URL_LINE=$(grep -E "^URIs:" $SOURCES_FILE | head -1 | awk '{print $2}')
41-
HOST=$(echo $HOST_URL_LINE | sed -E 's|https?://||' | cut -d'/' -f1)
41+
# Strip protocol and port, extract just hostname
42+
HOST=$(echo $HOST_URL_LINE | sed -E 's|https?://||' | cut -d'/' -f1 | cut -d':' -f1)
4243
else
4344
# Legacy format: deb http://deb.debian.org/debian ...
4445
LINE=$(grep -v "^#" $SOURCES_FILE | head -1)

0 commit comments

Comments
 (0)