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

#!/bin/sh
# pin every repo to the current checked out commit
# this script assumes no commit is already pinned
# tested with GNU and Busybox sed.
if [ -n "$1" ]; then
manifest="$1"
else
dir="$(realpath "$(dirname "$0")")"
if [ -z "$dir" ]; then
dir=.
fi
manifest="$dir"/default.xml
fi
if ! [ -f "$manifest" ]; then
echo "could not find $manifest. make sure to cd" \
"in the platform_manifest directory that contains it"
exit 1
fi
commit="$(git rev-parse HEAD)"
path="$REPO_PATH"
sed "$(cat <<EOT
# find the line that references this path
\| path="$path"| s| />| revision="$commit" />|
# … and append the desired commit
EOT
)" "$manifest" -i