Package: lintian-brush
Severity: wishlist
Tags: patch

From 2789fed85a6088c85f8f37ba96984eb7f3d8e8ef Mon Sep 17 00:00:00 2001
From: Dmitry Bogatov <kact...@debian.org>
Date: Fri, 10 May 2019 23:32:01 +0000
Subject: [PATCH] Make debian-watch-uses-insecure-uri more generic

Instead of using hard-coded list of hosts, that are known to support
https new implementation just replace "http://"; with "https://"; and
makes sure, that uscan report is same.
---
 fixers/debian-watch-uses-insecure-uri.sh | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/fixers/debian-watch-uses-insecure-uri.sh 
b/fixers/debian-watch-uses-insecure-uri.sh
index 85136b8..59c1e4f 100755
--- a/fixers/debian-watch-uses-insecure-uri.sh
+++ b/fixers/debian-watch-uses-insecure-uri.sh
@@ -1,6 +1,17 @@
 #!/bin/sh
-perl -p -i -e 
's/http:\/\/code.launchpad.net\//https:\/\/code.launchpad.net\//' debian/watch
-perl -p -i -e 's/http:\/\/launchpad.net\//https:\/\/launchpad.net\//' 
debian/watch
-perl -p -i -e 's/http:\/\/ftp.gnu.org\//https:\/\/ftp.gnu.org\//' debian/watch
+before=$(mktemp)
+after=$(mktemp)
+uscan --dehs > "${before}" 2>&1
+sed -i.bak s,http://,https://,g debian/watch
+uscan --dehs > "${after}" 2>&1
+
+# Make sure that reports are same up to http/https substitution in URL.
+sed -i s,http://,https://,g "${before}" "${after}"
+if cmp -s "${before}" "${after}" ; then
+       rm -f debian/watch.bak
+else
+       mv debian/watch.bak debian/watch
+fi
+rm -f "${before}" "${after}"
 echo "Use secure URI in debian/watch."
 echo "Fixed-Lintian-Tags: debian-watch-uses-insecure-uri"

Attachment: pgpahziaUrAG9.pgp
Description: PGP signature

Reply via email to