mailing list of musl libc
 help / color / mirror / code / Atom feed
62ca4011c50969b1546f59188b2ad8dd6775c147 blob 914 bytes (raw)

 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
 
#!/bin/sh
#
# This is an actually-safe install command which installs the new
# file atomically in the new location, rather than overwriting
# existing files.
#

usage() {
printf "usage: %s [-D] [-l] [-m mode] src dest\n" "$0" 1>&2
exit 1
}

mkdirp=
symlink=
mode=755

while getopts Dlm: name ; do
case "$name" in
D) mkdirp=yes ;;
l) symlink=yes ;;
m) mode=$OPTARG ;;
?) usage ;;
esac
done
shift $(($OPTIND - 1))

test "$#" -eq 2 || usage
src=$1
dst=$2
tmp="$dst.tmp.$$"

case "$dst" in
*/) printf "%s: %s ends in /\n", "$0" "$dst" 1>&2 ; exit 1 ;;
esac

set -C
set -e

umask 022

if test "$mkdirp" ; then
case "$2" in
*/*) mkdir -p "${dst%/*}" ;;
esac
fi

trap 'rm -f "$tmp"' EXIT INT QUIT TERM HUP

if test "$symlink" ; then
ln -s "$1" "$tmp"
else
cat < "$1" > "$tmp"
chmod "$mode" "$tmp"
fi

mv -f "$tmp" "$2"
test -d "$2" && {
rm -f "$2/$tmp"
printf "%s: %s is a directory\n" "$0" "$dst" 1>&2
exit 1
}

exit 0
debug log:

solving 62ca4011c ...
found 62ca4011c in https://inbox.vuxu.org/musl/CAC-LLDh0ApeJEX54EgPNrySh71YHPzoPB5wMNu3Y5msk7jqCtw@mail.gmail.com/
found d913b60bf in https://git.vuxu.org/mirror/musl/
preparing index
index prepared:
100755 d913b60bf24fc0589a211bc4f83dd0ce9d3c983a	tools/install.sh

applying [1/1] https://inbox.vuxu.org/musl/CAC-LLDh0ApeJEX54EgPNrySh71YHPzoPB5wMNu3Y5msk7jqCtw@mail.gmail.com/
diff --git a/tools/install.sh b/tools/install.sh
index d913b60bf..62ca4011c 100755

Checking patch tools/install.sh...
Applied patch tools/install.sh cleanly.

index at:
100755 62ca4011c50969b1546f59188b2ad8dd6775c147	tools/install.sh

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).