aboutsummaryrefslogtreecommitdiff
blob: 28e30333cf54fb2f3474c3637cea01f0f07a2c1f (plain)
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
#!/bin/bash

DATE=$(date "+%y%m%d")
CHANGE_ENTRY="automatic bump"
MIRROR=
TMPDIR="/tmp/${USER}/"

# Find the Documentation dir from sci overlay

if [[ -f $(basename $0) ]]; then
	REPO_DOC=$(pwd)
else
	REPO_DOC=$(dirname $0)
fi



bump_package() {
	mv refmac_dictionary.tar.gz monomer-db-0.${DATE}.tar.gz
	cp -f monomer-db-0.${DATE}.tar.gz /home/${USER}/science-dist/
#	scp monomer-db-${DATE}.tar.gz ${MIRROR}

	cd ${REPO_DOC}/../sci-libs/monomer-db/
	[[ -f monomer-db-0.${DATE}.ebuild ]] || \
		git mv monomer-db-0.*ebuild monomer-db-0.${DATE}.ebuild
	echangelog ${CHANGE_ENTRY}
	DISTDIR="${TMPDIR}" repoman -d -v fix
	git add .
	git ci -m "${CHANGE_ENTRY}"
}

mkdir ${TMPDIR}
cd ${TMPDIR};

wget http://www.ysbl.york.ac.uk/~garib/refmac/data/refmac_dictionary.tar.gz

SHA_NEW=$(sha256sum refmac_dictionary.tar.gz|awk '{print $1}')
SHA_OLD=$(sed -n -e '/^DIST monomer/p' ${REPO_DOC}/../sci-libs/monomer-db/Manifest | \
	tail -n 1 | awk '{print $9}')

if [[ ${SHA_OLD} == ${SHA_NEW} ]]; then
	echo "Nothing to update"
else
	echo "bumping to monomer-db-${DATE} ..."
#	bump_package
	echo ${SHA_OLD}
	echo ${SHA_NEW} 
fi