URL
https://opencores.org/ocsvn/hf-risc/hf-risc/trunk
Subversion Repositories hf-risc
[/] [hf-risc/] [trunk/] [tools/] [riscv-gnu-toolchain-master/] [scripts/] [cp_s] - Rev 13
Compare with Previous | Blame | View Log
#!/bin/sh# Emulate cp -s for systems without coreutilsif test -z "$1" || test -z "$2" ; thenecho "usage: ${0} srcdir destdir" >&2exit 1fi# Portability notes:# - Avoid set -e given its ambiguous interaction with subshells.# - Not all shells update $PWD as required by POSIX.# Use the pwd builtin instead.# - Command substitution strips all trailing newlines.# Preserve trailing newlines by appending a safety character and then# removing it with parameter substitution, along with the newline# appended by pwd itself.mkdir -p "$2" &&destdir=`cd "$2" && pwd && echo x` &&destdir=${destdir%??} &&cd "$1" &&srcdir=`pwd && echo x` &&srcdir=${srcdir%??} &&find . -type d -exec mkdir -p "${destdir}/{}" \; &&find . -type f -exec ln -sf "${srcdir}/{}" "${destdir}/{}" \;
