Browse Source

add pin script and documentation

pull/4/head
Antoine Fontaine 4 years ago
parent
commit
d7851a8deb
2 changed files with 71 additions and 0 deletions
  1. +40
    -0
      README.md
  2. +31
    -0
      pin-this-tree.sh

+ 40
- 0
README.md View File

@ -0,0 +1,40 @@
# platform manifest for postmarketOS's anbox image
have a look at https://gitlab.com/postmarketOS/anbox-image-make/
for the build instructions.
please don't rely on the commit hash in this repo, as they will be
rebased.
## `pin-this-tree.sh`
this tool is used to maintain this repository: it pins every git tree
to its currently checked out commit.
How to pin the commits:
1. in this repo, get back to the original, non-pinned,
version of the manifest
```sh
git checkout unpinned default.xml
```
2. get the android source
```sh
cd anbox-image-make # (that's the git repo above)
make fetch && date=$(date -u +%s) # get the latest version of the source
```
3. pin the versions and create the tarball
```sh
cd source # anbox-image-make/source, or wherever you did put it
repo forall -c '~/platform_manifests/pin-this-tree.sh'
tar -czf anbox-image-$date.tar.gz *
```
then go back to this repository, `git commit default.xml -m "pin to $date"`, `git push` and upload the tarball.
## Note for maintainers
When not pushing a change that pin commits, remember to update the unpinned tag: `git tag -f unpinned`

+ 31
- 0
pin-this-tree.sh View File

@ -0,0 +1,31 @@
#!/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

Loading…
Cancel
Save