customize_common 721 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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/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."
}

function install_debs()
{
        DEB_DIR="$1"

        if [ ! -d "$DEB_DIR" ]; then
                echo "Nothing to install here!"
                return 0
        fi

        for p in "$DEB_DIR/"*
        do
		echo "installing $p..."
                dpkg -i "$p"
		echo "done."
        done
}