Fixup fromcvs/togit conversion
[pkgsrcv2.git] / parallel / sge / patches / patch-bm
1 $NetBSD: patch-bm,v 1.1 2008/09/15 16:30:57 ahoka Exp $
2
3 DESTDIR support.
4
5 --- source/dist/util/setfileperm.sh.orig        2008-10-18 03:48:04.000000000 +1300
6 +++ source/dist/util/setfileperm.sh
7 @@ -81,7 +81,7 @@ SetFilePerm()
8  
9  instauto=false
10  
11 -if [ -z "$SGE_ROOT" -o ! -d "$SGE_ROOT" ]; then
12 +if [ -z "$SGE_ROOT" -o ! -d "$DESTDIR$SGE_ROOT" ]; then
13     echo 
14     echo ERROR: Please set your \$SGE_ROOT environment variable
15     echo and start this script again. Exit.
16 @@ -89,7 +89,7 @@ if [ -z "$SGE_ROOT" -o ! -d "$SGE_ROOT" 
17     exit 1
18  fi
19  
20 -if [ ! -f "$SGE_ROOT/util/arch" ]; then
21 +if [ ! -f "$DESTDIR$SGE_ROOT/util/arch" ]; then
22     echo 
23     echo ERROR: The shell script \"$SGE_ROOT/util/arch\" does not exist.
24     echo Please verify your distribution and restart this script. Exit.
25 @@ -97,7 +97,7 @@ if [ ! -f "$SGE_ROOT/util/arch" ]; then
26     exit 1
27  fi
28  
29 -if [ ! -f $SGE_ROOT/util/arch_variables ]; then
30 +if [ ! -f "$DESTDIR$SGE_ROOT"/util/arch_variables ]; then
31     echo
32     echo ERROR: Missing shell script \"$SGE_ROOT/util/arch_variables\".
33     echo Please verify your distribution and restart this script. Exit.
34 @@ -105,7 +105,7 @@ if [ ! -f $SGE_ROOT/util/arch_variables 
35     exit 1
36  fi
37  
38 -. $SGE_ROOT/util/arch_variables
39 +. "$DESTDIR$SGE_ROOT"/util/arch_variables
40  
41  if [ $ARCH = "win32-x86" ]; then
42     echo
43 @@ -183,7 +183,7 @@ else
44     done
45  fi
46  
47 -cd $1
48 +cd $DESTDIR$1
49  if [ $? != 0 ]; then
50     $ECHO "ERROR: can't change to directory \"$1\". Exiting."
51     exit 1
52 @@ -204,17 +204,17 @@ for f in $FILELIST; do
53  done
54  
55  for f in $FILELIST $OPTFILES; do
56 -   if [ -d $f -o -f $f ]; then
57 -      SetFilePerm $f
58 +   if [ -d $DESTDIR$f -o -f $DESTDIR$f ]; then
59 +      SetFilePerm $DESTDIR$f
60     fi
61  done
62  
63  for file in $SUIDFILES; do
64     # Windows NFS Server does not like suid files
65     if [ "`echo $file | grep win32-x86`" != "" ]; then
66 -      chmod 511 $file
67 +      chmod 511 $DESTDIR$file
68     else
69 -      chmod 4511 $file
70 +      chmod 4511 $DESTDIR$file
71     fi
72  done
73