Android manifests to compile AOSP for Anbox
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
689 B

  1. #!/bin/sh
  2. # pin every repo to the current checked out commit
  3. # this script assumes no commit is already pinned
  4. # tested with GNU and Busybox sed.
  5. if [ -n "$1" ]; then
  6. manifest="$1"
  7. else
  8. dir="$(realpath "$(dirname "$0")")"
  9. if [ -z "$dir" ]; then
  10. dir=.
  11. fi
  12. manifest="$dir"/default.xml
  13. fi
  14. if ! [ -f "$manifest" ]; then
  15. echo "could not find $manifest. make sure to cd" \
  16. "in the platform_manifest directory that contains it"
  17. exit 1
  18. fi
  19. commit="$(git rev-parse HEAD)"
  20. path="$REPO_PATH"
  21. sed "$(cat <<EOT
  22. # find the line that references this path
  23. \| path="$path"| s| />| revision="$commit" />|
  24. # … and append the desired commit
  25. EOT
  26. )" "$manifest" -i