File: get-orig-source.sh

package info (click to toggle)
python-reconfigure 0.1.74%2Bgit49a20890-3
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 724 kB
  • ctags: 701
  • sloc: python: 4,201; makefile: 186; sh: 7
file content (15 lines) | stat: -rwxr-xr-x 788 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh -e

GH_PROJECT=Eugeny/reconfigure
PY_NAME=reconfigure

# receive the list of changesets where the version changed, take only the first one
GIT_REV=$(GET -o links https://github.com/${GH_PROJECT}/commits/master/${PY_NAME}/__init__.py 2>/dev/null 2>/dev/null | grep -o "https://github.com/${GH_PROJECT}/tree/.*/${PY_NAME}/__init__.py" -m 1 | sed -e 's=^.*tree/\([0-9a-f]*\)/.*=\1=g')

GIT_REV_SHORT=$(echo ${GIT_REV} | grep -E -o '.{8}' | head -n1)

VERSION=$(GET https://raw.githubusercontent.com/${GH_PROJECT}/${GIT_REV}/${PY_NAME}/__init__.py 2>/dev/null | grep -E -o '[[:digit:]]+\.[[:digit:]]+(\.[[:digit:]]+)?')

PACKAGE=$(dpkg-parsechangelog -S Source)

GET https://github.com/${GH_PROJECT}/archive/${GIT_REV}.tar.gz > ${PACKAGE}_${VERSION}+git${GIT_REV_SHORT}.orig.tar.gz