aboutsummaryrefslogtreecommitdiffstats
path: root/Tools/scripts/git-diff-ports.sh
blob: f13ed077906421fbd29f0cdbfaeb3e1dce309c5c (plain) (blame)
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
#!/bin/sh
#
# MAINTAINER: yuri@FreeBSD.org

set -e
set -o pipefail

export LC_ALL=C

##
## git-diff-ports.sh: returns the list of ports with uncommitted changes in the repository
##

# check that packaged dependencies are installed

for dep in git; do
	if ! which -s $dep; then
		echo "error: the '$dep' dependency is missing"
		if [ $dep = "git" ]; then
			echo "... please install the 'git' package"
		fi
		exit 1
	fi
done


# MAIN

git diff HEAD "$@" |
	awk -F / '/^diff/ && $2 !~ /[[:upper:]]/ && $3 !~ /^Makefile/ { print $2 "/" $3 }' |
	sort -u