customize_common 424 Bytes
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/bash

function patch_all()
{
	PATCH_DIR="$1"
	TARGET_DIR="$2"

	if [ ! -d "$PATCH_DIR" ]; then
		echo "Nothing to patch here!"
		return 0
	fi
	
	if [ -z "$TARGET_DIR" ]; then
		echo "No target directory given, assuming /"
		TARGET_DIR="/"
	fi

        echo "Patching $TARGET_DIR ..."
        for p in "$PATCH_DIR/"*
        do
                cat "$p" | patch -d "$TARGET_DIR" -p1
        done
        echo "done."
}