Re: Enabling uupdate to simply remove files from upstream source
Ansgar Burchardt <firstname.lastname@example.org> writes:
> Please keep it usable for packages that do not use uscan to get the
> upstream tarball. I have some packages where I generate the upstream
> tarball from a VCS repository, but have to exclude some files. It would
> be nice to use the tool for such cases as well.
Teaching uscan how to do things like git archive might be very useful.
One of my packages currently has the following, which I bet could be
replaced by a sufficiently Git-aware uscan and a bit of glue for finding
the upstream Git repository and understanding the upstream tag format
(perhaps in debian/watch?).
# These variables are used by get-orig-source, to construct dkms.conf, and
# to set the build version. You will need to change TAG to package stable
# releases instead of experimental releases.
DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
TAG := $(shell echo 'openafs-stable-$(VERSION)' | sed 's/\./_/g')
REPO := git://git.openafs.org/openafs.git
# Upstream does tarball releases for major releases, but not for point
# relesaes, and the tarball releases are split into src and doc and contain
# the WINNT directory. Dropping WINNT, which is not used on Debian, saves a
# substantial amount of space in the source package, and there's no reason
# to include the files generated by regen.sh when we're going to run it
# again ourselves anyway.
# This rule therefore generates an upstream tarball from the upstream Git
# tag, rather than the tarball release, without the generated files that are
# not in Git and without the WINNT directory. It assumes that git-core is
# installed and there's network connectivity to the upstream repository.
git archive --remote='$(REPO)' --prefix='openafs_$(DEBVERS).orig/' \
--format=tar '$(TAG)' | tar xf -
rm -r openafs_$(DEBVERS).orig/src/WINNT
tar cf openafs_$(DEBVERS).orig.tar openafs_$(DEBVERS).orig
rm -r openafs_$(DEBVERS).orig
gzip -9 openafs_$(DEBVERS).orig.tar
Russ Allbery (email@example.com) <http://www.eyrie.org/~eagle/>