| 1 | #!/bin/bash |
| 2 | |
| 3 | if [ ${#@} -eq 0 ]; then |
| 4 | echo "Usage: $0 UPSTREAM_TAG" >&2 |
| 5 | exit 0 |
| 6 | fi |
| 7 | |
| 8 | upstream_tag="$1" |
| 9 | version=$(echo $upstream_tag| sed 's,^v,,') |
| 10 | archive_name="aws-crt-python-${version}.tar" |
| 11 | prefix="aws-crt-python-${version}/" |
| 12 | git checkout "${upstream_tag}" |
| 13 | git submodule update --init |
| 14 | git archive --format tar -o "$archive_name" --prefix="$prefix" "$upstream_tag" |
| 15 | # descend recursively and archive each submodule |
| 16 | PREFIX="$prefix" git submodule \ |
| 17 | --quiet foreach \ |
| 18 | --recursive 'git archive --format tar --prefix="${PREFIX}${displaypath}/" -o submodule.tar HEAD' |
| 19 | # concatenate with main archive |
| 20 | TOPDIR=$(pwd) ARCHIVE_NAME="$archive_name" git submodule \ |
| 21 | --quiet foreach \ |
| 22 | --recursive \ |
| 23 | 'cd $TOPDIR; tar --concatenate --file="$ARCHIVE_NAME" $displaypath/submodule.tar; rm -fv $displaypath/submodule.tar' |
| 24 | gzip -9 "$archive_name" |
| 25 | git submodule deinit --all |
| 26 | git checkout debian/sid |
| 27 | |
| 28 |