File: get-submodules

package info (click to toggle)
scipy 1.16.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 235,016 kB
  • sloc: cpp: 503,720; python: 345,298; ansic: 195,677; javascript: 89,566; fortran: 56,210; cs: 3,081; f90: 1,150; sh: 857; makefile: 791; pascal: 284; csh: 135; lisp: 134; xml: 56; perl: 51
file content (63 lines) | stat: -rwxr-xr-x 1,713 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/sh -e
# According to https://github.com/scipy/scipy/issues/16331
# some git submodules are needed to build scipy since version 1.9.x
# This script clones the scipy repository initialises the submodules
# and creates a submodules tarball
#
# Note: uses rsync

# The scipy version is extracted from debian/changelog,
# or alternatively may be specified as a argument to this script
# (gbp import-orig, for instance, needs the submodule source
# to be already downloaded)
#
# Submodule source is generated strictly for the indicated version
# if the git tag v$VERSION is available, otherwise git HEAD is used.
#
# Usage:  get-submodules [VERSION]

COMPONENT=submodules
EXT=gz

if [ $(basename $PWD) = "debian" ] ; then
  cd ..
fi

VERSION=$1
if [ "x$VERSION" = "x" ]; then
  VERSION=$(dpkg-parsechangelog | grep '^Version' | cut -d' ' -f2 | cut -f1 -d-)
fi
echo "Preparing submodule source for VERSION=$VERSION"

TMPDIR=$(mktemp -d /tmp/scipy.XXXXXX)
cd $TMPDIR
git clone https://github.com/scipy/scipy
cd scipy
# Use submodules from the given VERSION, if it is available as a git tag v$VERSION
git checkout -q v$VERSION || /bin/true
git submodule update --init

MODULES=$(grep 'path =' .gitmodules | sed 's/^.*path = *//')
set -x
mkdir ../scipy-${VERSION}
cd ../scipy-${VERSION}
for m in $MODULES ; do
  mkdir -p $m
  rsync -a -v ../scipy/$m $(dirname $m)
done
cd ..
pwd

TARBALL=scipy_${VERSION}.orig-${COMPONENT}.tar.${EXT}

tar caf ${TARBALL} scipy-${VERSION}

cat <<EOT

You can find the submodules tarball scipy_${VERSION}.orig-${COMPONENT}.tar.${EXT}
in the temporary dir $TMPDIR at path
${TMPDIR}/${TARBALL}

Please inspect the tarball and check licenses in the following directories:
   $MODULES
EOT