File: get-orig-source

package info (click to toggle)
falcon 1.8.8-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 7,464 kB
  • sloc: python: 29,696; ansic: 26,508; sh: 1,119; makefile: 537; xml: 15
file content (66 lines) | stat: -rwxr-xr-x 1,633 bytes parent folder | download
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
64
65
66
#!/bin/sh

set -ex

# This is based on code from https://bugs.debian.org/748474

while [ "$1" ];
do
    case $1 in
	--upstream-version|-v)
	    shift
	    NEW_VERSION="$1"
	    ;;
	--force-bad-version|-b|--find|-f)
	    :
	    ;;
    esac
    shift
done

workdir=$(mktemp -d)

cleanup () {
    rm -rf ${workdir}
}

trap cleanup EXIT

# ignore <path> and rely on ../ being the path to the orig.tar.xz
# using source package name $SPKG from debian/changelog
# This makes it more robust for newer uupdate in future
SPKG=$(dpkg-parsechangelog -SSource)
DESTDIR=$(realpath $PWD/..)
cd ${workdir}
# Now ${SPKG}_${NEW_VERSION}.orig.tar.xz is upstream tarball
new_package="${SPKG}-${NEW_VERSION}"

# Remove tarball downloaded by uscan and its symlink -- it doesn't contain the
# submodules
rm -f \
   ${DESTDIR}/${SPKG}-${NEW_VERSION}.tar.* \
   ${DESTDIR}/${SPKG}_${NEW_VERSION}.orig.tar.*

echo "Cloning ${SPKG} version ${NEW_VERSION}"
git clone \
    --recursive \
    --branch ${NEW_VERSION} \
    https://github.com/PacificBiosciences/FALCON-integrate.git $new_package

export PATH="$PATH:$PWD/$new_package/git-sym"

cd $new_package
git describe --tags
make init
cd FALCON-examples && make setup-synth0 && cd ..
find FALCON-examples/run/synth0 -type l \
    | xargs -I{} sh -c 'cp -rL {} {}.actual && rm -rf {} && mv {}.actual {}'
# Get rid of absolute symlinks
find FALCON-examples -type l \
    | xargs -I{} sh -c 'perl -e "\"$(readlink {})\" =~ /^\//" && rm {}'
rm -f FALCON-examples/scripts/git-sym
find -name ".git*" -exec rm -rf {} +
rm -rf git-sym
cd ..

tar --xz -cf ${DESTDIR}/${SPKG}_${NEW_VERSION}.orig.tar.xz ${new_package}