~ubuntu-branches/ubuntu/edgy/libxfce4util/edgy

« back to all changes in this revision

Viewing changes to install-sh

  • Committer: Bazaar Package Importer
  • Author(s): Yves-Alexis Perez
  • Date: 2005-11-27 12:08:34 UTC
  • mfrom: (1.2.2 upstream)
  • Revision ID: james.westby@ubuntu.com-20051127120834-uq5ptp5p6fyipwkt
Tags: 4.2.3.2-1
* Yves-Alexis Perez
 * New Upstream Release
* Simon Huggins
 * Configure sysconfdir correctly                             closes: #329139
 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/bin/sh
2
2
# install - install a program, script, or datafile
3
3
 
4
 
scriptversion=2004-09-10.20
 
4
scriptversion=2005-05-14.22
5
5
 
6
6
# This originates from X11R5 (mit/util/scripts/install.sh), which was
7
7
# later released in X11R6 (xc/config/util/install.sh) with the
109
109
        shift
110
110
        continue;;
111
111
 
112
 
    --help) echo "$usage"; exit 0;;
 
112
    --help) echo "$usage"; exit $?;;
113
113
 
114
114
    -m) chmodcmd="$chmodprog $2"
115
115
        shift
134
134
        shift
135
135
        continue;;
136
136
 
137
 
    --version) echo "$0 $scriptversion"; exit 0;;
 
137
    --version) echo "$0 $scriptversion"; exit $?;;
138
138
 
139
139
    *)  # When -d is used, all remaining arguments are directories to create.
140
140
        # When -t is used, the destination is already specified.
213
213
  fi
214
214
 
215
215
  # This sed command emulates the dirname command.
216
 
  dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
 
216
  dstdir=`echo "$dst" | sed -e 's,/*$,,;s,[^/]*$,,;s,/*$,,;s,^$,.,'`
217
217
 
218
218
  # Make sure that the destination directory exists.
219
219
 
226
226
    oIFS=$IFS
227
227
    # Some sh's can't handle IFS=/ for some reason.
228
228
    IFS='%'
229
 
    set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
 
229
    set x `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
 
230
    shift
230
231
    IFS=$oIFS
231
232
 
232
233
    pathcomp=
295
296
               || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null \
296
297
               || {
297
298
                 echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
298
 
                 (exit 1); exit
 
299
                 (exit 1); exit 1
299
300
               }
300
301
             else
301
302
               :
306
307
           $doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
307
308
         }
308
309
    }
309
 
  fi || { (exit 1); exit; }
 
310
  fi || { (exit 1); exit 1; }
310
311
done
311
312
 
312
313
# The final little trick to "correctly" pass the exit status to the exit trap.
313
314
{
314
 
  (exit 0); exit
 
315
  (exit 0); exit 0
315
316
}
316
317
 
317
318
# Local variables: