equal
deleted
inserted
replaced
32 |
32 |
33 FROMDIR="$1"; shift |
33 FROMDIR="$1"; shift |
34 TODIR="$1"; shift |
34 TODIR="$1"; shift |
35 |
35 |
36 |
36 |
|
37 ## GNU cp required |
|
38 |
|
39 CP=cp |
|
40 type -path gcp >/dev/null && CP=gcp |
|
41 |
|
42 |
37 ## main |
43 ## main |
38 |
44 |
39 function copy () |
45 function copy () |
40 { |
46 { |
41 local PREFIX="$1" |
47 local PREFIX="$1" |
55 echo "X ${PREFIX}$NAME" |
61 echo "X ${PREFIX}$NAME" |
56 mkdir -p "$TODIR/${PREFIX}$NAME" || fail "Bad directory '$TODIR/${PREFIX}$NAME'" |
62 mkdir -p "$TODIR/${PREFIX}$NAME" || fail "Bad directory '$TODIR/${PREFIX}$NAME'" |
57 copy "${PREFIX}$NAME/" || return "$?" |
63 copy "${PREFIX}$NAME/" || return "$?" |
58 else |
64 else |
59 { [ ! -d "$TODIR/${PREFIX}$NAME" ] && \ |
65 { [ ! -d "$TODIR/${PREFIX}$NAME" ] && \ |
60 cp -af "$FROMDIR/${PREFIX}$NAME" "$TODIR/${PREFIX}$NAME"; } || \ |
66 $(CP) -af "$FROMDIR/${PREFIX}$NAME" "$TODIR/${PREFIX}$NAME"; } || \ |
61 fail "Cannot install '$TODIR/${PREFIX}$NAME'" |
67 fail "Cannot install '$TODIR/${PREFIX}$NAME'" |
62 fi |
68 fi |
63 fi |
69 fi |
64 done |
70 done |
65 IFS="$ORIG_IFS" |
71 IFS="$ORIG_IFS" |