File: update-source.sh

package info (click to toggle)
aws-crt-python 0.24.0%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 75,932 kB
  • sloc: ansic: 418,984; python: 23,626; makefile: 6,035; sh: 4,075; ruby: 208; java: 82; perl: 73; cpp: 25; 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