1
0

cpio 544 B

1234567891011121314151617181920212223242526272829
  1. #!/usr/bin/env bash
  2. # This file is part of the OpenADK project. OpenADK is copyrighted
  3. # material, please see the LICENCE file in the top-level directory.
  4. opt=
  5. user="-R 0:0"
  6. os=$(uname)
  7. case $os in
  8. NetBSD|MirBSD|OpenBSD)
  9. cmd="$@"
  10. ;;
  11. FreeBSD|Darwin)
  12. user="-R root:"
  13. cmd=$(echo "$@"|sed -e "s#-Hnewc#--format newc#")
  14. cmd="--quiet $cmd"
  15. ;;
  16. *)
  17. cmd="--quiet $@"
  18. ;;
  19. esac
  20. if [ "$2" = "r" ];then
  21. opt="$user"
  22. fi
  23. cmd=$(echo "$cmd"|sed -e "s# r # #")
  24. if [ -x /usr/bin/cpio ];then
  25. /usr/bin/cpio $opt $cmd
  26. else
  27. /bin/cpio $opt $cmd
  28. fi