File: import-upstream.release.sh

package info (click to toggle)
sendmail 8.15.2-8%2Bdeb9u1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 13,108 kB
  • sloc: ansic: 95,435; sh: 9,754; perl: 7,444; makefile: 817
file content (66 lines) | stat: -rwxr-xr-x 1,270 bytes parent folder | download | duplicates (6)
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 -e

VERBOSE=1

test -n "$1"

TARBALL=$1
VERSION=$(basename "$TARBALL" .tar.gz)
VERSION=${VERSION#sendmail.}
BRANCH=sendmail
SIGBRANCH=upstream-signatures
TAG=sendmail/$VERSION

if [ "$(git tag -l $TAG)" != "$TAG" ]; then

	if [ ! -f $TARBALL ]; then
		echo "Cannot find sources for $VERSION"
		exit 1
	fi

	for SIG in $TARBALL.sig ${TARBALL%.gz}.sig
	do
		if [ -f $SIG ]; then
			break
		fi
	done

	if [ ! -f $SIG ]; then
		echo "Cannot find signature for $VERSION"
		exit 1
	fi

	STAMP=$TARBALL
	if [ -f $TARBALL.stamp ]; then
		STAMP=$TARBALL.stamp
	fi

	export GIT_COMMITTER_DATE="$(stat -c %y $STAMP)"
	export GIT_AUTHOR_DATE="$GIT_COMMITTER_DATE"
	export GIT_AUTHOR_NAME="Sendmail"
	export GIT_AUTHOR_EMAIL="sendmail@Sendmail.ORG"

	echo "Importing $VERSION"
	echo sendmail | \
	git-import-orig \
		${VERBOSE:+--verbose} \
		--upstream-version $VERSION \
		--upstream-branch="$BRANCH" \
		--upstream-tag="sendmail/%(version)s" \
		--no-merge \
		--no-pristine-tar \
		--interactive \
		$TARBALL
	pristine-tar commit $TARBALL $TAG

	# we only want a lightweight tag
	commit=$(git rev-parse $TAG^{commit})
	git tag -f $TAG $commit

	git checkout $SIGBRANCH
	cp -a $SIG .
	git add $(basename $SIG)
	git commit -m "Imported Upstream version $VERSION"

fi