File: update-source.sh

package info (click to toggle)
aws-crt-python 0.20.4%2Bdfsg-1~bpo12%2B1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm-backports
  • size: 72,656 kB
  • sloc: ansic: 381,805; python: 23,008; makefile: 6,251; sh: 4,536; cpp: 699; ruby: 208; java: 77; perl: 73; javascript: 46; xml: 11
file content (28 lines) | stat: -rwxr-xr-x 916 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash

if [ ${#@} -eq 0 ]; then
    echo "Usage: $0 UPSTREAM_TAG" >&2
    exit 0
fi

upstream_tag="$1"
version=$(echo $upstream_tag| sed 's,^v,,')
archive_name="aws-crt-python-${version}.tar"
prefix="aws-crt-python-${version}/"
git checkout "${upstream_tag}"
git submodule update --init
git archive --format tar -o "$archive_name" --prefix="$prefix" "$upstream_tag"
# descend recursively and archive each submodule
PREFIX="$prefix" git submodule \
      --quiet foreach \
      --recursive 'git archive --format tar --prefix="${PREFIX}${displaypath}/" -o submodule.tar HEAD'
# concatenate with main archive
TOPDIR=$(pwd) ARCHIVE_NAME="$archive_name" git submodule \
      --quiet foreach \
      --recursive \
      'cd $TOPDIR; tar --concatenate --file="$ARCHIVE_NAME" $displaypath/submodule.tar; rm -fv $displaypath/submodule.tar'
gzip -9 "$archive_name"
git submodule deinit --all
git checkout debian/sid