Using bazaar (baz)

Rob Browning rlb@defaultvalue.org
Tue, 15 Mar 2005 08:34:30 -0600


J=E9r=F4me Marant <jerome.marant@free.fr> writes:

>> 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?

The autofiles dpatch is (must be) listed last in 00list, so yes,
dpatch-edit-patch will apply all of the other patches to the temp tree
first.

>>   define update_debian_autofiles_dpatch
>> 	${cleanup_all}
>>         # rm aclocal.m4 so it doesn't confuse newer autoconfs, but touch=
 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
>>

> 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?

The "set -e" and the initial trap is a trick to make sure that if the
command sequence fails for any reason, it'll exit with 230 rather than
with the exit code of the failed command.  This is so that
dpatch-edit-patch will know something went wrong.  I'm not sure why
dpatch-edit-patch doesn't consider any failure code a failure, but it
doesn't.  The final "trap - EXIT" clears the EXIT trap after we're
finished so we can exit normally.  Let me know if I didn't explain
that clearly enough.

> After all, if you think it'll prevent us from mistakes, you can
> go ahead.

Well, adding that should make it nearly impossible to end up with an
autofiles.dpatch that isn't "in sync" with all of the dpatches, but
practically speaking, it would also mean that every time you change or
add *any* dpatch, you'll have to run "debian/rules autofiles-sync".
Would that be too aggravating?  I'm not sure myself.

--=20
Rob Browning
rlb @defaultvalue.org and @debian.org; previously @cs.utexas.edu
GPG starting 2002-11-03 =3D 14DD 432F AE39 534D B592  F9A0 25C8 D377 8C7E 7=
3A4