Skip to content

Commit 81ceaa4

Browse files
committed
Various mocking fixes.
1 parent a62cad3 commit 81ceaa4

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

mock-the-feds.sh

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/bin/bash
22

33
SCM=~/projects/samba/samba-perf
4+
BASE="8108f0d"
5+
VERS="4.4.0"
46
PKG=~/projects/fedora/samba
57
REPO=~/repos/f23/x86_64
68
REPO_NAME="jarrpa"
@@ -16,23 +18,27 @@ fi
1618

1719
pushd $PKG
1820

19-
VERSION=$(grep "define samba_version" samba.spec | awk '{print $3}')
20-
RELEASE=$(grep "define main_release" samba.spec | awk '{print $3}')
21-
SRPM="samba-${VERSION}-${RELEASE}.fc23.src.rpm"
21+
pushd $SCM
22+
RELNUM=`git rev-list ${BASE}..HEAD --abbrev-commit | wc -l`
23+
RELEASE="${RELNUM}.${BASE}"
2224

23-
if [ -f "${REPO}/${SRPM}" ]; then
24-
CMD="SAMBA_PKGS=`dnf -C list installed | grep \"samba\\\|ctdb\\\|libwb\\\|libsmb\" | awk '{print $1}'`; sudo dnf reinstall \$SAMBA_PKGS"
25-
else
26-
CMD="sudo dnf --disablerepo=* --enablerepo=${REPO_NAME} update"
27-
fi
25+
SRPM="samba-${VERS}-${RELEASE}.fc23.src.rpm"
2826

29-
pushd $SCM
30-
git archive --format=tar.gz --prefix=samba-${VERSION}/ HEAD -o $PKG/samba-${VERSION}.tar.gz
27+
git archive --format=tar.gz --prefix=samba-${VERS}/ HEAD -o $PKG/samba-${VERS}.tar.gz
3128
popd
3229

30+
sed -i "s/\\(define samba_version \\).*/\\1${VERS}/" samba.spec
31+
sed -i "s/\\(define main_release \\).*/\\1${RELEASE}/" samba.spec
32+
md5sum samba-${VERS}.tar.gz >sources
3333
fedpkg --dist f23 srpm
3434
sudo mock ${MOCK_OPTS} -r f23-x86_64 rebuild ${SRPM}
3535

3636
popd
3737

38+
if [ -f "${REPO}/${SRPM}" ]; then
39+
CMD="SAMBA_PKGS=\`dnf -C list installed | grep \"samba\\\|ctdb\\\|libwb\\\|libsmb\" | awk '{printf \$1; printf \" \"}'\`; sudo dnf -y reinstall \$SAMBA_PKGS"
40+
else
41+
CMD="sudo dnf -y --disablerepo=* --enablerepo=${REPO_NAME} update"
42+
fi
43+
3844
./scripts/hark-a-vagrant.sh ${CMD}

0 commit comments

Comments
 (0)