summaryrefslogtreecommitdiff
path: root/includes/patch-includes.sh
blob: c09cb8186f0f8b4ec7ad360d79d4a1e6f904e65e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
### default variables ###

[ -z "$PATCHDIR" ] && export PATCHDIR="$PWD"

### functions ###

function getpatch
{
	url=$1
	if [ $# -gt 1 ]; then
		filename="$2"
	else
		filename=$(basename $url)
	fi

	if [ -f "$PATCHDIR/$filename" ]; then
		cp "$PATCHDIR/$filename" $TMPDIR || die
	else
		wget $url -O $TMPDIR/$filename || die
	fi
}