summaryrefslogtreecommitdiff
path: root/parallel/sge/patches/patch-bm
blob: a2e29466d1bc44a06626adba44a8cf7e4d933ea1 (plain)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
$NetBSD: patch-bm,v 1.2 2009/05/13 21:00:25 markd Exp $

DESTDIR support.

--- source/dist/util/setfileperm.sh.orig	2008-10-18 03:48:04.000000000 +1300
+++ source/dist/util/setfileperm.sh
@@ -81,7 +81,7 @@ SetFilePerm()
 
 instauto=false
 
-if [ -z "$SGE_ROOT" -o ! -d "$SGE_ROOT" ]; then
+if [ -z "$SGE_ROOT" -o ! -d "$DESTDIR$SGE_ROOT" ]; then
    echo 
    echo ERROR: Please set your \$SGE_ROOT environment variable
    echo and start this script again. Exit.
@@ -89,7 +89,7 @@ if [ -z "$SGE_ROOT" -o ! -d "$SGE_ROOT" 
    exit 1
 fi
 
-if [ ! -f "$SGE_ROOT/util/arch" ]; then
+if [ ! -f "$DESTDIR$SGE_ROOT/util/arch" ]; then
    echo 
    echo ERROR: The shell script \"$SGE_ROOT/util/arch\" does not exist.
    echo Please verify your distribution and restart this script. Exit.
@@ -97,7 +97,7 @@ if [ ! -f "$SGE_ROOT/util/arch" ]; then
    exit 1
 fi
 
-if [ ! -f $SGE_ROOT/util/arch_variables ]; then
+if [ ! -f "$DESTDIR$SGE_ROOT"/util/arch_variables ]; then
    echo
    echo ERROR: Missing shell script \"$SGE_ROOT/util/arch_variables\".
    echo Please verify your distribution and restart this script. Exit.
@@ -105,7 +105,7 @@ if [ ! -f $SGE_ROOT/util/arch_variables 
    exit 1
 fi
 
-. $SGE_ROOT/util/arch_variables
+. "$DESTDIR$SGE_ROOT"/util/arch_variables
 
 if [ $ARCH = "win32-x86" ]; then
    echo
@@ -183,7 +183,7 @@ else
    done
 fi
 
-cd $1
+cd $DESTDIR$1
 if [ $? != 0 ]; then
    $ECHO "ERROR: can't change to directory \"$1\". Exiting."
    exit 1
@@ -204,17 +204,17 @@ for f in $FILELIST; do
 done
 
 for f in $FILELIST $OPTFILES; do
-   if [ -d $f -o -f $f ]; then
-      SetFilePerm $f
+   if [ -d $DESTDIR$f -o -f $DESTDIR$f ]; then
+      SetFilePerm $DESTDIR$f
    fi
 done
 
 for file in $SUIDFILES; do
    # Windows NFS Server does not like suid files
    if [ "`echo $file | grep win32-x86`" != "" ]; then
-      chmod 511 $file
+      chmod 511 $DESTDIR$file
    else
-      chmod 4511 $file
+      chmod 4511 $DESTDIR$file
    fi
 done