File: what-to-upload

package info (click to toggle)
pkg-haskell-tools 0.12.5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 160 kB
  • sloc: haskell: 691; sh: 591; perl: 308; makefile: 10
file content (52 lines) | stat: -rwxr-xr-x 1,174 bytes parent folder | download | duplicates (5)
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
#!/bin/bash

set -e

if [ -z "$1" -o "$1" = "--help" ]
then
  cat <<'__END__'
what-to-upload - Lists .changes files that should be uploaded

Usage: dht what-to-upload foo.changes ..

Given a number of changes files, reports hose that should be uploaded, i.e.
the distribution is not UNRELEASED and that the tag does not exist already.
__END__

  exit 0
fi


if [ "$1" = "--manpage" ]
then
cat <<'__END__'
Usage: dht what-to-upload foo.changes ..

Given a number of changes files, reports hose that should be uploaded, i.e.
the distribution is not UNRELEASED and that the tag does not exist already.
__END__
	exit 0;
fi

changes="$@"

root="$(realpath --relative-to=$PWD "$(git rev-parse --show-toplevel)")"

for c in $changes
do
	src="$(grep ^Source "$c"|grep-dctrl -s Source -n '' )"
	ver="$(grep ^Version "$c"|grep-dctrl -s Version -n '' )"
	dist="$(grep ^Distribution "$c"|grep-dctrl -s Distribution -n '' )"
	tag="${src}_v$(echo $ver| tr ':~' _)"
	if [ "$dist" == "UNRELEASED" ]
	then
		#echo "Skipping $c, not ready for upload"
		continue
	fi
	if git show-ref --quiet --verify "refs/tags/$tag"
	then
		#echo "Skipping $c, already released"
		continue
	fi
	echo $c
done