~ubuntu-branches/ubuntu/edgy/libcdio/edgy-updates

« back to all changes in this revision

Viewing changes to install-sh

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2005-11-15 16:53:23 UTC
  • mfrom: (3.1.1 etch)
  • Revision ID: james.westby@ubuntu.com-20051115165323-peroku75syl2j36u
Tags: 0.76-1ubuntu1
* Sync to new Debian version, manually apply Ubuntu patches:
  - debian/control: Remove dpkg-awk build dependency.
  - debian/rules: hardcode $LIBCDEV. This keeps the diff small (compared to
    the original patch of changing every ${libcdev} occurence).

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-07-05.00
 
4
scriptversion=2005-02-02.21
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=
260
261
    rmtmp=$dstdir/_rm.$$_
261
262
 
262
263
    # Trap to clean up those temp files at exit.
263
 
    trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
 
264
    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
264
265
    trap '(exit $?); exit' 1 2 13 15
265
266
 
266
267
    # Copy the file name to the temp name.
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: