# Release to something other than unstable, e.g. experimental
# CHROOT=$chroot
# Build using another schroot than debcargo-unstable-amd64-sbuild
+# SBUILD_OPTS=
+# will pass to sbuild; for example SBUILD_OPTS=--arch=i386
set -e
SCRIPTDIR="$(dirname $(readlink -f "$0"))"
if [ -n "$DEBCARGO" ]; then
true
-elif which debcargo >/dev/null; then
- DEBCARGO=$(which debcargo)
+elif type -p debcargo >/dev/null 2>&1; then
+ DEBCARGO=$(type -p debcargo)
elif [ -f "$HOME/.cargo/bin/debcargo" ]; then
DEBCARGO="$HOME/.cargo/bin/debcargo"
else
( cd "$PKGNAME" && dpkg-buildpackage -d -S --no-sign )
# sign if not UNRELEASED
if echo "$DEBDIST" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
- debsign "${SRCNAME}_source.changes"
+ debsign ${DEBSIGN_KEYID:+-k $DEBSIGN_KEYID} "${SRCNAME}_source.changes"
fi
fi
EXTRA_DEBS=( "$@" )
+if [ -n "$*" -a -z "$IGNORE_MISSING_BUILD_DEPS" ]; then
+ IGNORE_MISSING_BUILD_DEPS=1
+ echo >&2 "Given non-empty extra debs; defaulting IGNORE_MISSING_BUILD_DEPS=1"
+fi
check_build_deps() {
mkdir -p dpkg-dummy
"${EXTRA_DEBS_AUTOPKGTEST_OPTS[@]}" \
"${AUTOPKGTEST_OPTS[@]}" \
"${LINTIAN_OPTS[@]}" \
+ ${SBUILD_OPTS} \
"$SRCNAME.dsc"
if [ "$SKIP_AUTOPKGTEST" != 1 ]; then
report "analyzing autopkgtest log: $BUILDNAME.test.log"
# sign if not UNRELEASED
if echo "$DEBDIST" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
- debsign ${DEBSIGN_KEYID:+-k $DEBSIGN_KEYID }--no-re-sign "$BUILDNAME.changes"
+ debsign ${DEBSIGN_KEYID:+-k $DEBSIGN_KEYID} --no-re-sign "$BUILDNAME.changes"
fi
--- /dev/null
+#!/bin/bash
+# Filter package-versions of our rust packages, that are not in NEW.
+
+comm -13 \
+ <(curl -s https://ftp-master.debian.org/new.html \
+ | sed -nre 's,.*<a href="new/rust-([a-zA-Z0-9-]*)_([.a-zA-Z0-9-]*)\.html">.*,\1 \2,gp' \
+ | sort) \
+ -
-#!/bin/sh
+#!/bin/bash
# Given a full version string, output just the part that is significant for
# semver. i.e.. 0.x.* becomes 0.x and x.* becomes x for x != 0.
sed -r \
-#!/bin/sh
+#!/bin/bash
# Grant DM upload permissions on all crates maintained by a DM.
if [ "$#" -ne 1 ]; then
-#!/bin/sh
+#!/bin/bash
# Symlink {build => src}/$pkg/debian/patches for easier editing.
#
# If you give a second argument $2, will create this patch, add Cargo.toml to
-#!/bin/sh
+#!/bin/bash
# List all packages that produce rust binaries, from this repo.
grep -l "\[packages.bin\]" src/*/debian/debcargo.toml \
| cut -d/ -f2 \
--- /dev/null
+#!/bin/sh
+dev/list-pending.sh | dev/filter-not-NEW.sh | dev/filter-package-in-debian.sh
+++ /dev/null
-#!/bin/bash
-# List pending branches that we have, but that are not in NEW.
-# You might find it also useful to pipe the output of this into filter-package-in-debian.sh
-set -e
-
-git fetch origin --prune
-comm -13 \
- <(curl -s https://ftp-master.debian.org/new.html | \
- grep '<td class="package">rust-' | \
- sed -nre 's/.*\brust-([-A-Za-z0-9.]+)\b.*/\1/gp' | \
- sort) \
- <(git branch --list -r 'origin/pending-*' --format='%(refname)' | \
- sed -e 's,refs/remotes/origin/pending-,,g' | \
- sort) | \
-while read x; do
- echo $x $(git show "origin/pending-$x:src/$x/debian/changelog" | dpkg-parsechangelog -l- -SVersion)
-done
--- /dev/null
+#!/bin/bash
+# List pending branches that we have.
+# You may want to run dev/sync-pending-branches.sh first.
+# You may find it useful to pipe the output of this into filter-package-in-debian.sh
+#
+set -e
+
+git fetch origin --prune
+
+if [ "${PENDING_LOCAL}" = 1 ]; then
+git branch --list 'pending-*' --format='%(refname)' \
+ | sed -e 's,refs/heads/pending-,,g' \
+ | sort \
+ | while read x; do
+ echo $x $(git show "pending-$x:src/$x/debian/changelog" | dpkg-parsechangelog -l- -SVersion)
+ done
+else
+git branch --list -r 'origin/pending-*' --format='%(refname)' \
+ | sed -e 's,refs/remotes/origin/pending-,,g' \
+ | sort \
+ | while read x; do
+ echo $x $(git show "origin/pending-$x:src/$x/debian/changelog" | dpkg-parsechangelog -l- -SVersion)
+ done
+fi
abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; }
-which grep-dctrl >/dev/null || abort 1 "grep-dctrl not found, install dctrl-tools"
-which aptitude >/dev/null || abort 1 "aptitude not found, install it"
+type grep-dctrl >/dev/null || abort 1 "grep-dctrl not found, install dctrl-tools"
+type aptitude >/dev/null || abort 1 "aptitude not found, install it"
+type gawk >/dev/null || abort 1 "gawk not found, install gawk"
ARCHIVE="${ARCHIVE:-unstable}"
ARCHIVT="${ARCHIVT:-testing}"
-#!/bin/sh
+#!/bin/bash
abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; }
if [ -n "$DEBCARGO" ]; then
true
-elif which debcargo >/dev/null; then
- DEBCARGO=$(which debcargo)
+elif type -p debcargo >/dev/null 2>&1; then
+ DEBCARGO=$(type -p debcargo)
elif [ -f "$HOME/.cargo/bin/debcargo" ]; then
DEBCARGO="$HOME/.cargo/bin/debcargo"
else
-#!/bin/sh
+#!/bin/bash
for i in src/*/debian/RFS; do
echo "$(git log -1 --pretty="format:%ct" "$i")" "$i"
done | sort | while read t i; do
if ! head -1 $(dirname "$i")/changelog |grep -q UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
echo -e "\e[31mRFS but the first line of the changelog doesn't contain UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO\e[0m"
fi
+ if grep -q FIXME $(dirname "$i")/copyright; then
+ echo -e "\e[31mRFS but still contains FIXME in debian/copyright\e[0m"
+ fi
# trim the content
content=$(xargs '-d\n' echo -n < "$i")
if test -n "$content"; then
#!/bin/bash
set -e
-packages=( $(dev/list-pending-not-NEW.sh | dev/filter-package-in-debian.sh | grep -v ' 0$' | cut '-d ' -f1) )
+packages=( $(dev/list-pending.sh | dev/filter-package-in-debian.sh | grep -v ' 0$' | cut '-d ' -f1) )
if [ -z "$packages" ]; then exit 0; fi
set -x
{ echo >&2 "Please sync with origin/master before running this."; exit 1; }
git merge "${packages[@]/#/pending-}"
-git push origin master "${packages[@]/#/:pending-}"
+git push origin master
+if [ "${PENDING_LOCAL}" != 1 ]; then
+ git push origin "${packages[@]/#/:pending-}"
+fi
dev/sync-pending-branches.sh
# Sync remote pending branches locally, and prune merged branches.
set -e
+git_hash() {
+ git rev-parse -q --verify "$@" || true
+}
+
git fetch origin --prune
PREVBRANCH="$(git rev-parse --abbrev-ref HEAD)"
+
+# delete merged
git branch --merged | tr -d ' ' | grep ^pending- | xargs -trn1 git branch -d
-git branch --list -r 'origin/pending-*' --format='%(refname:lstrip=3)' | xargs -trn1 git checkout
+merged=( $(git branch --list -r 'origin/pending-*' --format='%(refname:lstrip=3)' --merged) )
+git push origin "${merged[@]/#/:}"
+
+# sync local branches
+git branch --list -r 'origin/pending-*' --format='%(refname:lstrip=3)' | while read b; do
+ if [ -z "$(git_hash "$b")" ]; then
+ git checkout "$b"
+ fi
+done
git checkout "$PREVBRANCH"
+git branch --list 'pending-*' --format='%(refname:lstrip=2)' | while read b; do
+ if [ "$(git_hash "$b")" != "$(git_hash "origin/$b")" ]; then
+ echo >&2 "WARNING: Local $b ($(git_hash "$b")) differs from remote $b ($(git_hash "origin/$b"))"
+ fi
+done
-#!/bin/sh
+#!/bin/bash
# Repackage a crate at the exact version that it was packaged at.
#
# Usage: ./repackage.sh <CRATE> [<SEMVER>]
-#!/bin/sh
+#!/bin/bash
# Package or update a new or existing crate.
#
# Usage: [REALVER=<EXACTVER>] ./release.sh <CRATE> [<SEMVER>]
abort() { local x=$1; shift; for i in "$@"; do echo >&2 "$0: abort: $i"; done; exit "$x"; }
-mkdir -p "$(dirname "$0")/.git/hooks"
-HOOK_COMMIT="$(dirname "$0")/.git/hooks/pre-commit"
-
if [ -n "$DEBCARGO" ]; then
true
-elif which debcargo >/dev/null; then
- DEBCARGO=$(which debcargo)
+elif type -p debcargo >/dev/null 2>&1; then
+ DEBCARGO=$(type -p debcargo)
elif [ -f "$HOME/.cargo/bin/debcargo" ]; then
DEBCARGO="$HOME/.cargo/bin/debcargo"
else
case $dcver in
2.0.*|2.1.*|2.2.*|2.3.*) abort 1 "unsupported debcargo version $dcver. try reinstalling with \`cargo install debcargo --force\`";;
2.4.*) true;;
+2.5.*) true;;
*) abort 1 "unsupported debcargo version: $dcver";;
esac