File: repack.sh

package info (click to toggle)
chordii 4.3%2Brepack-1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 728 kB
  • ctags: 375
  • sloc: ansic: 4,432; sh: 1,051; makefile: 76
file content (31 lines) | stat: -rw-r--r-- 943 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
#!/bin/sh

# This script unpacks original source, removes the included debian directory
# and repacks it with an added +repack to version. The version is taken from
# the shipped NEWS file.

ACT=$(head -n 1 NEWS | cut -d ' ' -f 4)

if [ -e '../chordii_'$ACT'.orig.tar.gz' ]; then
	# Cleaning
	rm -rf ../temp
	rm -rf ../chordii_$ACT+repack.orig.tar.gz

	# Repacking
	mkdir ../temp
	tar xfz ../chordii_$ACT.orig.tar.gz -C ../temp
	rm -rf ../temp/chordii-$ACT/debian
	rm -f ../temp/chordii-$ACT/examples/everybody-hurts.cho
	rm -f ../temp/chordii-$ACT/examples/love-me-tender.cho
	mv ../temp/chordii-$ACT ../temp/chordii-$ACT+repack
	tar cfz ../temp/chordii_$ACT+repack.orig.tar.gz -C ../temp chordii-$ACT+repack
	mv ../temp/chordii_$ACT+repack.orig.tar.gz ../
	rm -rf ../temp

	# Finish
	if [ -e ../chordii_$ACT+repack.orig.tar.gz ]; then
		echo Repack successful!
	fi
else
	echo Tarball not found. Maybe you\'re not in the source directory?
fi