[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Pristine source from upstream VCS repository

Russ Allbery <rra@debian.org> writes:

>> Am I right in thinking that the ‘get-orig-source’ target should ignore
>> the version strings in ‘debian/changelog’, and should instead get
>> whatever version is the latest available from upstream?
> I think the way that you're using it is more useful (and possible) than
> doing what an exact reading of the current text would indicate, and I do
> the same thing that you're doing.

FYI, from the ffmpeg-debian (and soon mplayer) package, we (or at least
I) use the following approach:

  SVNDATE=`date +%Y%m%d`
  debian/rules get-orig-source SVN_VERSION=${SVNDATE}

Debian rules detects the SVN_VERSION like this:

DEB_SOURCE := $(shell dpkg-parsechangelog | sed -n 's/^Source: //p')
DEB_VERSION := $(shell dpkg-parsechangelog | sed -n 's/^Version: //p')
UPSTREAM_VERSION := $(shell echo $(DEB_VERSION) | sed -r 's/[^:]+://; s/-[^-]+$$//')
SVN_VERSION := $(shell echo $(UPSTREAM_VERSION) | sed -nr 's/^[0-9.:-]+\.svn([0-9]+)$$/\1/p')


        chmod +x debian/strip.sh
        sh debian/get-orig-source.sh -d$(SVN_VERSION)

The proposed approach features:

 - a seperate shell script for the actual work
 - debian/rules figuring out the current version from debian/changelog
 - user is able to override the exact upstream version

(obvious) issues:

 - in this context, only midnight snapshots are possible
 - if upstream changes the VCS location or its layout, this mechanism
   will break
 - regex determining SVN_VERSION is very dependent on the choosen
   versioning scheme. mplayer and ffmpeg need to use a different regex!

I believe this approach matches both the letter and the spirit of debian
policy notes about that target.

Suggestions how to simplify this (espc. the get-orig-source.sh script,
see the branches on git.debian.org) are appreciated.

Reinhard Tartler, KeyID 945348A4

Reply to: