2 # Symlink {build => src}/$pkg/debian/patches for easier editing.
4 # If you give a second argument $2, will create this patch, add Cargo.toml to
5 # it, open it for editing, refresh the patch, and call cargo build for you.
7 # If the build succeeds, exits with success, and you can re-rerun update.sh
8 # If the build fails, will "quilt add" everything so you can begin editing the
9 # files without forgetting to add them.
15 if ! test -d "src/$pkg/debian"; then
16 echo >&2 "not a directory: src/$pkg/debian"
20 test -d "src/$pkg/debian/patches" || mkdir
"src/$pkg/debian/patches"
21 rm -rf "build/$pkg/debian/patches"
22 rm -rf "build/$pkg/.pc"
23 mkdir
-p "build/$pkg/debian"
24 ln -sfT "$PWD/src/$pkg/debian/patches" "build/$pkg/debian/patches"
26 if [ -z "$2" ]; then exit 0; fi
29 export QUILT_PATCHES
=debian
/patches
30 patchname
="${2%.patch}.patch"
31 quilt new
"$patchname"
33 sensible-editor Cargo.toml
35 find src
-type f
-execdir quilt add
'{}' +
37 while ! cargo build
--all-features; do
40 Spawning a sub-shell. Please try to fix the build failure by editing files in
41 src/, which have been already quilt-added for you to $patchname. Afterwards,
42 don't forgot to run "quilt refresh". To exit this loop without having fixed the
43 problem, press Ctrl-D then quickly Ctrl-C.
50 echo "patching was a success!"