Using bazaar (baz)
Jérôme Marant
jerome.marant@free.fr
Tue, 15 Mar 2005 13:41:11 +0100
Quoting Rob Browning <rlb@defaultvalue.org>:
> Rob Browning <rlb@defaultvalue.org> writes:
>
> > That's the main thing I'm planning to fix today.
>
> OK. I've changed the code here so that we use dpatch, and so that
> nothing's automatic. We generate debian/patches/autofiles.dpatch like
> this:
>
> define update_debian_autofiles_dpatch
> ${cleanup_all}
> # rm aclocal.m4 so it doesn't confuse newer autoconfs, but touc=
h it
> # so ./Makefile won't be upset if it's not recreated (b/c not
> needed).
> (set -e; \
> echo -n "trap 'exit 230' EXIT"; \
> echo -n " && rm -f aclocal.m4 && touch aclocal.m4"; \
> echo -n " && aclocal"; \
> echo -n " && autoconf"; \
> echo -n " && rm -rf autom4te.cache"; \
> echo -n " && trap - EXIT"; \
> echo -n " && exit") \
> | dpatch-edit-patch patch autofiles
> endef
>
> You can invoke this code manually via "debian/rules autofiles-sync",
> and the prepare-release target still asks about running it.
Looks good. I guess you apply all patches first, then unapply them all,
right?
BTW, I did not understand about this exit 230. It looks that it aborts
dpatch and thus does not generate the patch. Isn't exit 0 expected
instead?
> While the above piping works fine, it isn't ideal, so I thought I
> might ask the dpatch maintainer what he thinks about adding something
> like --command=CMD that would allow you to tell dpatch to run
> something other than an interactive shell. Then we could just say:
>
> dpatch-edit-patch --command debian/update-autofiles patch autofiles
I like the idea, yes.
> Also, for now, I did not add the *.dpatch md5 based check for a
> possibly out of date autofiles.dpatch that we discussed earlier. Such
> a check *would* make it very unlikely that you'd ever end up with
> autofiles that didn't correctly reflect the contents of the other
> relevant dpatches, but it would also force you to run an
> autofiles-sync in many cases where one was not needed.
...
> The safety check that I had been thinking about was something like
> this:
>
> define check_autofiles_dpatch
> @if ! debian/dpatch-md5s-differ-from-autofiles; \
> then \
> echo 'Some of the dpatch files have changed.'; \
> echo "Please run "debian/rules autofiles-sync" and retry.'; \
> false; \
> fi
> endef
>
> We just have to decide if the extra safety is worth the extra
> badgering.
After all, if you think it'll prevent us from mistakes, you can
go ahead.
Cheers,
--
Jérôme Marant