summaryrefslogtreecommitdiff
blob: 28aaa3d9166a3996a5295bb2ecb41474cef71d6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash

PM_CMD="emerge"
EXTRA_ARGS="-1"

while (( $# != 0 )); do
	case $1 in
	--help)
		echo -e "usage: gir-rebuilder [-P PM] [-- PM_ARGS]\nPM in \"portage paludis\"\nPM_ARGS in your PM supported args..."
		exit 0
		;;
	-P)
		shift
		case $1 in
		portage)
			PM_CMD="emerge"
			;;
		paludis)
			which cave &>/dev/null && PM_CMD="cave resolve -xz" || PM_CMD="paludis -i"
			;;
		*)
			echo "Did not understand package manager: $1"
			exit -1
			;;
		esac
		;;
	--)
		shift
		while (( $# != 0 )); do
			EXTRA_ARGS+=" $1"
			shift
		done
		;;
	*)
		echo "Did not understand: $1"
		exit -2
		;;
	esac
	shift
done

exec ${PM_CMD} ${EXTRA_ARGS} $(grep -r gobject-introspection /var/db/pkg | cut -d ':' -f1 | cut -d '/' -f 5-6 | sed 's/^/=/' | sort -u | grep -Ev '(gobject-introspection|glib)')