Skip to content

Commit 36776cf

Browse files
committed
mock script updates.
1 parent d4887ef commit 36776cf

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

mock-the-feds.sh

+23-4
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
SCM="~/projects/samba/samba-perf"
44
PKG="~/projects/fedora/samba"
5+
REPO="~/repo/f23/x86_64"
6+
REPO_NAME="jarrpa"
7+
NODES="ganesh"
58

69
MOCK_OPTS="--no-clean --without=configure --nocheck --no-cleanup-after"
710
if [ "x${1}" == "xclean" ]; then
@@ -18,13 +21,29 @@ VERSION=$(grep "define samba_version" samba.spec | awk '{print $3}')
1821
RELEASE=$(grep "define main_release" samba.spec | awk '{print $3}')
1922
SRPM="samba-${VERSION}-${RELEASE}.fc23.src.rpm"
2023

24+
if [ -f "${REPO}/${SRPM}" ]; then
25+
OLD_MD5=`md5sum ${REPO}/${SRPM} | awk '{print $1}'`
26+
else
27+
OLD_MD5=""
28+
fi
29+
2130
pushd $SCM
2231
git archive --format=tar.gz --prefix=samba-${VERSION}/ HEAD -o $PKG/samba-${VERSION}.tar.gz
2332
popd
2433

2534
fedpkg --dist f23 srpm
2635

27-
echo "sudo mock ${MOCK_OPTS} -r f23-x86_64 rebuild ${SRPM}"
28-
sudo mock ${MOCK_OPTS} -r f23-x86_64 rebuild ${SRPM}
29-
popd
30-
vagrant rsync
36+
NEW_MD5=`md5sum ${SRPM} | awk '{print $1}'`
37+
38+
if [ "${NEW_MD5}" != "${OLD_MD5}" ]; then
39+
echo "sudo mock ${MOCK_OPTS} -r f23-x86_64 rebuild ${SRPM}"
40+
sudo mock ${MOCK_OPTS} -r f23-x86_64 rebuild ${SRPM}
41+
popd
42+
vagrant rsync
43+
if [ "x${OLD_MD5}" != "x" ]; then
44+
CMD="SAMBA_PKGS=`dnf list installed | grep \"samba\\\|ctdb\\\|libwb\\\|libsmb\" | awk '{print $1}'`; sudo dnf reinstall ${SAMBA_PKGS}"
45+
else
46+
CMD="sudo dnf --disablerepo=* --enablerepo=${REPO_NAME} update"
47+
fi
48+
vagrant ssh ${NODES} -c "${CMD}"
49+
fi

0 commit comments

Comments
 (0)