File: protector.dpatch

package info (click to toggle)
gcc-3.3 1%3A3.3.6ds1-28
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 25,812 kB
  • ctags: 262
  • sloc: sh: 10,321; makefile: 1,050; perl: 155; awk: 23; cpp: 14
file content (45 lines) | stat: -rw-r--r-- 1,111 bytes parent folder | download | duplicates (10)
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
44
45
#! /bin/sh -e

# DP: gcc prototector patch: http://www.trl.ibm.com/projects/security/ssp/

# the basename of the protector tarball. the tarball is searched in the
# top level package directory. If it's not found, a uuencoded tarball
# is searched in debian/patches.

pbase=protector-3.3.2-2

dir=
if [ $# -eq 3 -a "$2" = '-d' ]; then
    pdir="-d $3"
    dir="$3/"
elif [ $# -ne 1 ]; then
    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
    exit 1
fi

case "$1" in
    -patch)
	rm -rf protector
	mkdir protector
	(
	    cd protector;
	    if [ -f ../$pbase.tar.gz ]; then
		tar xfz ../$pbase.tar.gz
	    else
		uudecode ../debian/patches/protector.uue;
		tar xfz $pbase.tar.gz
	    fi
	)
	cp -p protector/protector.[ch] ${dir}gcc/.
        patch $pdir -f --no-backup-if-mismatch -p0 < protector/protector.dif
        ;;
    -unpatch)
        patch $pdir -f --no-backup-if-mismatch -R -p0 < protector/protector.dif
	rm -f ${dir}gcc/protector.[ch]
	rm -rf protector
        ;;
    *)
        echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
        exit 1
esac
exit 0