@@ -21,10 +21,15 @@ on_exit () {
21
21
trap on_exit EXIT
22
22
23
23
if [ " ${IS_PATCH} " = " true" ]; then
24
- git diff HEAD -- . ' :!debian' > ../upstream.patch
25
- git diff HEAD -- debian > ../debian.patch
24
+ git diff HEAD > ../upstream.patch
26
25
git clean -fdx
27
26
git reset --hard HEAD
27
+ git remote add upstream https://github.com/mongodb/mongo-c-driver
28
+ git fetch upstream
29
+ CURRENT_BRANCH=$( git rev-parse --abbrev-ref HEAD)
30
+ git checkout upstream/debian/unstable
31
+ git checkout ${CURRENT_BRANCH}
32
+ git checkout upstream/debian/unstable -- ./debian/
28
33
if [ -s ../upstream.patch ]; then
29
34
[ -d debian/patches ] || mkdir debian/patches
30
35
mv ../upstream.patch debian/patches/
@@ -33,20 +38,15 @@ if [ "${IS_PATCH}" = "true" ]; then
33
38
git commit -m ' Evergreen patch build - upstream changes'
34
39
git log -n1 -p
35
40
fi
36
- if [ -s ../debian.patch ]; then
37
- git apply --index ../debian.patch
38
- git commit -m ' Evergreen patch build - Debian packaging changes'
39
- git log -n1 -p
40
- fi
41
41
fi
42
42
43
43
cd ..
44
44
45
45
git clone https://salsa.debian.org/installer-team/debootstrap.git debootstrap.git
46
46
export DEBOOTSTRAP_DIR=` pwd` /debootstrap.git
47
- sudo -E ./debootstrap.git/debootstrap unstable ./unstable-chroot/ http://cdn-aws.deb.debian.org/debian
47
+ sudo -E ./debootstrap.git/debootstrap --variant=buildd unstable ./unstable-chroot/ http://cdn-aws.deb.debian.org/debian
48
48
cp -a mongoc ./unstable-chroot/tmp/
49
- sudo chroot ./unstable-chroot /bin/bash -c " (\
49
+ sudo chroot ./unstable-chroot /bin/bash -c ' (\
50
50
apt-get install -y build-essential git-buildpackage fakeroot debhelper cmake libssl-dev pkg-config python3-sphinx python3-sphinx-design zlib1g-dev libsasl2-dev libsnappy-dev libzstd-dev libmongocrypt-dev libjs-mathjax libutf8proc-dev furo && \
51
51
chown -R root:root /tmp/mongoc && \
52
52
cd /tmp/mongoc && \
@@ -55,11 +55,19 @@ sudo chroot ./unstable-chroot /bin/bash -c "(\
55
55
python3 build/calc_release_version.py > VERSION_CURRENT && \
56
56
python3 build/calc_release_version.py -p > VERSION_RELEASED && \
57
57
git add --force VERSION_CURRENT VERSION_RELEASED && \
58
- git commit VERSION_CURRENT VERSION_RELEASED -m 'Set current/released versions' && \
58
+ git commit VERSION_CURRENT VERSION_RELEASED -m "Set current/released versions" && \
59
+ git remote remove upstream || true && \
60
+ git remote add upstream https://github.com/mongodb/mongo-c-driver && \
61
+ git fetch upstream && \
62
+ export CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" && \
63
+ git checkout upstream/debian/unstable && \
64
+ git checkout ${CURRENT_BRANCH} && \
65
+ git checkout upstream/debian/unstable -- ./debian/ && \
66
+ git commit -m "fetch debian directory from the debian/unstable branch" && \
59
67
LANG=C /bin/bash ./debian/build_snapshot.sh && \
60
68
debc ../*.changes && \
61
69
dpkg -i ../*.deb && \
62
- gcc -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -o example-client src/libmongoc/examples/example-client.c -lmongoc-1.0 -lbson-1.0 )"
70
+ gcc -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -o example-client src/libmongoc/examples/example-client.c -lmongoc-1.0 -lbson-1.0 )'
63
71
64
72
[ -e ./unstable-chroot/tmp/mongoc/example-client ] || (echo " Example was not built!" ; exit 1)
65
73
(cd ./unstable-chroot/tmp/ ; tar zcvf ../../deb.tar.gz * .dsc * .orig.tar.gz * .debian.tar.xz * .build * .deb)
@@ -72,9 +80,9 @@ sudo chroot ./unstable-chroot /bin/bash -c "(\
72
80
dpkg-buildpackage -b && dpkg-buildpackage -S )"
73
81
74
82
# And now do it all again for 32-bit
75
- sudo -E ./debootstrap.git/debootstrap --arch i386 unstable ./unstable-i386-chroot/ http://cdn-aws.deb.debian.org/debian
83
+ sudo -E ./debootstrap.git/debootstrap --variant=buildd -- arch i386 unstable ./unstable-i386-chroot/ http://cdn-aws.deb.debian.org/debian
76
84
cp -a mongoc ./unstable-i386-chroot/tmp/
77
- sudo chroot ./unstable-i386-chroot /bin/bash -c " (\
85
+ sudo chroot ./unstable-i386-chroot /bin/bash -c ' (\
78
86
apt-get install -y build-essential git-buildpackage fakeroot debhelper cmake libssl-dev pkg-config python3-sphinx python3-sphinx-design zlib1g-dev libsasl2-dev libsnappy-dev libzstd-dev libmongocrypt-dev libjs-mathjax libutf8proc-dev furo && \
79
87
chown -R root:root /tmp/mongoc && \
80
88
cd /tmp/mongoc && \
@@ -83,11 +91,19 @@ sudo chroot ./unstable-i386-chroot /bin/bash -c "(\
83
91
python3 build/calc_release_version.py > VERSION_CURRENT && \
84
92
python3 build/calc_release_version.py -p > VERSION_RELEASED && \
85
93
git add --force VERSION_CURRENT VERSION_RELEASED && \
86
- git commit VERSION_CURRENT VERSION_RELEASED -m 'Set current/released versions' && \
94
+ git commit VERSION_CURRENT VERSION_RELEASED -m "Set current/released versions" && \
95
+ git remote remove upstream || true && \
96
+ git remote add upstream https://github.com/mongodb/mongo-c-driver && \
97
+ git fetch upstream && \
98
+ export CURRENT_BRANCH="$(git rev-parse --abbrev-ref HEAD)" && \
99
+ git checkout upstream/debian/unstable && \
100
+ git checkout ${CURRENT_BRANCH} && \
101
+ git checkout upstream/debian/unstable -- ./debian/ && \
102
+ git commit -m "fetch debian directory from the debian/unstable branch" && \
87
103
LANG=C /bin/bash ./debian/build_snapshot.sh && \
88
104
debc ../*.changes && \
89
105
dpkg -i ../*.deb && \
90
- gcc -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -o example-client src/libmongoc/examples/example-client.c -lmongoc-1.0 -lbson-1.0 )"
106
+ gcc -I/usr/include/libmongoc-1.0 -I/usr/include/libbson-1.0 -o example-client src/libmongoc/examples/example-client.c -lmongoc-1.0 -lbson-1.0 )'
91
107
92
108
[ -e ./unstable-i386-chroot/tmp/mongoc/example-client ] || (echo " Example was not built!" ; exit 1)
93
109
(cd ./unstable-i386-chroot/tmp/ ; tar zcvf ../../deb-i386.tar.gz * .dsc * .orig.tar.gz * .debian.tar.xz * .build * .deb)
0 commit comments