File: git-snapshot

package info (click to toggle)
opensbi 0.9-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 1,504 kB
  • sloc: ansic: 13,868; asm: 1,042; makefile: 413; sh: 217
file content (18 lines) | stat: -rwxr-xr-x 459 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -e

commit="$1"
test -z "$commit" && echo "invalid commit" && exit 1
package=opensbi
archive=tar.xz
version=$(git describe "$commit" | sed -e 's,-,+,' -e 's,-g,.,' -e 's,^v,,g')
output=../${package}_${version}.orig.${archive}
test -f "${output}" && echo "already present: ${output}" && exit 1

git archive \
	--format=${archive} \
	--prefix=${package}-${version}/ \
	--output=${output} \
	${commit} && \
	echo "successfully created: ${output}"