mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 09:17:30 +03:00
26c3dd960f
This matches the behavior of Mercurial itself.
32 lines
993 B
Bash
Executable File
32 lines
993 B
Bash
Executable File
#!/bin/sh -eu
|
|
#
|
|
# Build a remotefilelog debian package from the current repo
|
|
|
|
if [ ! -d .hg ]; then
|
|
echo 'You are not at the repository root!' 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
cp -r contrib/debian debian
|
|
trap "rm -r '$PWD/debian'" EXIT
|
|
|
|
version=$(hg log -r . -T'{latesttag}+{latesttagdistance}-{node|short}')
|
|
|
|
control=debian/control
|
|
changelog=debian/changelog
|
|
# This looks like sed -i, but sed -i behaves just differently enough
|
|
# between BSD and GNU sed that I gave up and did the dumb thing.
|
|
sed "s/__VERSION__/$version/" < $changelog > $changelog.tmp
|
|
date=$(date --rfc-2822)
|
|
sed "s/__DATE__/$date/" < $changelog.tmp > $changelog
|
|
rm $changelog.tmp
|
|
|
|
debuild -us -uc -b || exit 1
|
|
OUTPUTDIR=${OUTPUTDIR:=packages/debian-unknown}
|
|
mkdir -p $OUTPUTDIR
|
|
find ../remotefilelog*.deb ../remotefilelog_*.build \
|
|
../remotefilelog_*.changes -type f -newer $control -print0 | \
|
|
xargs -Inarf -0 mv narf "$OUTPUTDIR"
|
|
echo "Built packages for $version:"
|
|
find "$OUTPUTDIR" -type f -newer $control -name '*.deb'
|