Using bazaar (baz)

Rob Browning rlb@defaultvalue.org
Tue, 15 Mar 2005 00:14:38 -0600


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

You can invoke this code manually via "debian/rules autofiles-sync",
and the prepare-release target still asks about running it.

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

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.

Since the prompt to rebuild autofiles.dpatch in prepare-release should
ensure that I never release packages that haven't been properly
updated, that only leaves the convenience vs safety question in the
non-release cases -- i.e. when people change a patch and then run
"fakeroot debian/rules binary" or dpkg-buildpackage directly.

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.

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