xref: /haiku/3rdparty/mmu_man/scripts/identify_repo.sh (revision 0754c319592cd8a523959d85fb06ab23c64a98a6)
1#!/bin/bash
2
3# for each package in /system/packages/ check which repository it comes from
4
5# actually reverse video
6#bold=`tput smso`
7#offbold=`tput rmso`
8
9# show only not found
10onf=0
11if [ "x$1" == "x-n" ]; then
12onf=1
13fi
14
15cd /system/packages/
16
17repos=""
18for r in /system/settings/package-repositories/*; do
19	repos="$repos ${r##*/}"
20	u=`sed '/^url=/s/url=//g;q' "$r"`
21	urls="$urls $u"
22done
23reponames=($repos)
24repourls=($urls)
25
26for p in *.hpkg; do
27	#echo "$p"
28	i=0
29	found=0
30	while [ $i -lt ${#reponames[@]} ]; do
31		#echo "Checking repo ${reponames[$i]}..."
32		#echo "${repourls[$i]}"
33		if wget -q --spider "${repourls[$i]}/packages/$p" ; then
34			[ "$onf" == 1 ] || echo "$p in ${reponames[$i]}";
35			found=1
36			break
37		fi
38		let i=i+1
39	done
40	if [ $found != 1 ]; then
41		echo "${bold}$p NOT FOUND${offbold}"
42	fi
43done
44