cpio 460 B

12345678910111213141516171819202122232425262728
  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. set -x
  5. opt=
  6. user="-R 0:0"
  7. os=$(uname)
  8. case $os in
  9. NetBSD|MirBSD|OpenBSD)
  10. quiet=""
  11. ;;
  12. Darwin)
  13. user="-R root:wheel"
  14. quiet=""
  15. ;;
  16. *)
  17. quiet="--quiet"
  18. ;;
  19. esac
  20. if [ "$2" = "r" ];then
  21. opt=$user
  22. fi
  23. if [ -x /usr/bin/cpio ];then
  24. /usr/bin/cpio $quiet $opt "$@"
  25. else
  26. /bin/cpio $quiet $opt "$@"
  27. fi