update Sun Jan 31 18:37:00 PST 2010
[pkgsrc.git] / audio / cddbd / patches / patch-aa
1 $NetBSD: patch-aa,v 1.4 2010/02/01 01:38:42 joerg Exp $
2
3 --- install.sh.orig     1996-12-22 03:49:54.000000000 +0000
4 +++ install.sh
5 @@ -37,11 +37,25 @@ id=`id`
6  # Set up access defaults.
7  DIRPERM=755
8  FILEPERM=644
9 -BINPERM=6711
10 +if [ -z "$BINPERM" ]
11 +then
12 +       BINPERM=6711
13 +fi
14  UMASK=022
15  OWNER=`expr "$id" : '.*uid=.*(\(.*\)).*gid'`
16  GROUP=`expr "$id" : '.*gid=[0-9]*(\([a-zA-Z0-9_]*\))'`
17 -BINOWNER=$OWNER
18 +if [ -z "$BINOWNER" ]
19 +then
20 +       BINOWNER=$OWNER
21 +fi
22 +if [ -z "$BINGROUP" ]
23 +then
24 +       BINGROUP=$GROUP
25 +fi
26 +if [ -z "$INSTALL" ]
27 +then
28 +       INSTALL=/usr/bin/install
29 +fi
30  
31  USERS=100
32  LINES=1024
33 @@ -94,7 +108,7 @@ logerr()
34  getstr()
35  {
36         $ECHO "$* \c"
37 -       read ANS
38 +       ANS=
39         if [ -n "$ANS" ]
40         then
41                 return 0
42 @@ -113,7 +127,7 @@ getyn()
43         while :
44         do
45                 $ECHO "$*? [${YNDEF}] \c"
46 -               read ANS
47 +               ANS=
48                 if [ -n "$ANS" ]
49                 then
50                         case $ANS in
51 @@ -202,28 +216,12 @@ instfile()
52                         rm -f $2
53                 fi
54  
55 -               cp $1 $2
56 +               $INSTALL -c -m $3 -o $4 -g $5 $1 $2
57                 if [ $? != 0 ]
58                 then
59                         logerr -n "Cannot install $2: file copy error."
60                         return 1
61                 fi
62 -
63 -               if [ -f $2 ]
64 -               then
65 -                       if [ $3 != default ]
66 -                       then
67 -                               chmod $3 $2 2>/dev/null
68 -                       fi
69 -                       if [ $4 != default ]
70 -                       then
71 -                               chown $4 $2 2>/dev/null
72 -                       fi
73 -                       if [ $5 != default ]
74 -                       then
75 -                               chgrp $5 $2 2>/dev/null
76 -                       fi
77 -               fi
78                 return 0
79         else
80                 $ECHO "\t$2 NOT installed"
81 @@ -330,7 +328,7 @@ done
82  
83  # Find other directories
84  
85 -BASEDIR=`cat .accessfile`
86 +BASEDIR=${DESTDIR}`cat .accessfile`
87  WORKDIR=${BASEDIR}
88  CDDBDIR=`dirname ${BASEDIR}`
89  
90 @@ -588,7 +586,7 @@ fi
91  
92  $ECHO "permissions:  default connect nopost noupdate noget" >> access
93  
94 -YNDEF=y
95 +YNDEF=n
96  if getyn "Do you want to create the motd file now"
97  then
98         if [ "$EDITOR" = "" ]
99 @@ -624,10 +622,10 @@ makedir $WORKDIR $DPERM $OWNID $GRPID
100  $ECHO "\nInstalling cddbd files..."
101  
102  # Binaries
103 -instfile cddbd ${BINDIR}/cddbd $BINPERM $BINOWNER $GROUP
104 +instfile cddbd ${BINDIR}/cddbd $BINPERM $BINOWNER $BINGROUP
105  
106  # Configuration files
107 -instfile access `cat .accessfile`/access $FPERM $OWNID $GRPID
108 +instfile access ${BASEDIR}/access $FPERM $OWNID $GRPID
109  instfile sites $SITE $FPERM $OWNID $GRPID
110  
111  if [ -f motd ]
112 @@ -635,7 +633,7 @@ then
113         instfile motd $MOTD $FPERM $OWNID $GRPID
114  fi
115  
116 -YNDEF=y
117 +YNDEF=n
118  if getyn "\nDo you want to create the fuzzy matching hash file now"
119  then
120         $ECHO "\nPlease wait while the hash file is created."