]> sbz's 6dev Repos - freebsd-maintainer-scripts/.git/commitdiff
check-distfile: fetch index if not present on disk
authorSofian Brabez <sbz@6dev.net>
Mon, 7 Feb 2022 14:51:47 +0000 (14:51 +0000)
committerSofian Brabez <sbz@6dev.net>
Mon, 7 Feb 2022 14:51:47 +0000 (14:51 +0000)
If the INDEX-X.Y file in not present on disk, make search will not work
as expected and search results will be wrong. Ensure the INDEX file is
present and if not fetch it using fetchindex target

check-distfile.sh

index b3ebe54a5bb34d32e50160a92e0048b51d63c93a..2cfbb43725c362712d7a530d2dcd064367e3e25c 100755 (executable)
@@ -1,10 +1,12 @@
 #!/bin/sh
 
-svnbase="${HOME}/svn/ports"
+repopath="${HOME}/git/ports"
+
+[ ! -f "${repopath}/INDEX*" ] && make -C "${repopath}" fetchindex
 
 [ ! -f /usr/local/bin/distilator ] && pkg install -y distilator
 
-ports=$(make -C "${svnbase}" search key="sbz@FreeBSD.org" \
+ports=$(make -C "${repopath}" search key="sbz@FreeBSD.org" \
     display=path|grep -v ^$|awk '{print $2}')
 
 for origin in ${ports};