Codebase list rust-stfu8 / 96f26008-241c-44f7-97cf-b16432225604/main dev /

Tree @96f26008-241c-44f7-97cf-b16432225604/main (Download .tar.gz) @96f26008-241c-44f7-97cf-b16432225604/mainraw · history · blame

# Symlink {build => src}/$pkg/debian/patches for easier editing.
# If you give a second argument $2, will create this patch, add Cargo.toml to
# it, open it for editing, refresh the patch, and call cargo build for you.
# If the build succeeds, exits with success, and you can re-rerun
# If the build fails, will "quilt add" everything so you can begin editing the
# files without forgetting to add them.

set -e


if ! test -d "src/$pkg/debian"; then
	echo >&2 "not a directory: src/$pkg/debian"
	exit 1

test -d "src/$pkg/debian/patches" || mkdir "src/$pkg/debian/patches"
rm -rf "build/$pkg/debian/patches"
rm -rf "build/$pkg/.pc"
mkdir -p "build/$pkg/debian"
ln -sfT "$PWD/src/$pkg/debian/patches" "build/$pkg/debian/patches"

if [ -z "$2" ]; then exit 0; fi

cd "build/$pkg"
export QUILT_PATCHES=debian/patches
quilt new "$patchname"
quilt add Cargo.toml
sensible-editor Cargo.toml
quilt refresh
find src -type f -execdir quilt add '{}' +

while ! cargo build --all-features; do

cat <<-eof
Spawning a sub-shell. Please try to fix the build failure by editing files in
src/, which have been already quilt-added for you to $patchname. Afterwards,
don't forgot to run "quilt refresh". To exit this loop without having fixed the
problem, press Ctrl-D then quickly Ctrl-C.
quilt refresh


echo "patching was a success!"