:: Re: [DNG] remove systemd for the lo…
Top Page
Delete this message
Reply to this message
Author: aitor_czr
Date:  
To: dng
Subject: Re: [DNG] remove systemd for the love of Yog-Sothoth already
Hi again,

I recomend you to use pristine-tar in combination with git-buildpackage.

******* EXAMPLE 1: HOW TO GET THE SOURCES USING PRISTINE-TAR ************

1) Download any git repository (for example, systemd):

    $ git clone https://gitlab.com/aitor_cz/bulmages.git


2) Enter into the project:

    $ cd bulmages


3) Extract the pristine-tar branch:

    $ git checkout pristine-tar


4) There are two delta binaries in this branch (one belonging to the
master branch, and the other belonging to the release branch):

    $ ls -s
       total 405956
      405660 
bulmages-master_0.16.0.20150107.1241-73c2dd9d.orig.tar.bz2.delta
      288 bulmages-release_0.15.0-5b3c913b.orig.tar.bz2.delta
      4 bulmages-master_0.16.0.20150107.1241-73c2dd9d.orig.tar.bz2.id
      4 bulmages-release_0.15.0-5b3c913b.orig.tar.bz2.id


5) If you want to obtain the tarball (sources) of one of them (for
example, the master branch) type the following:

    $ pristine-tar checkout 
../bulmages-master_0.16.0.20150107.1241-73c2dd9d.orig.tar.bz2
    pristine-tar: successfully generated 
../bulmages-master_0.16.0.20150107.1241-73c2dd9d.orig.tar.bz2


6) Now, go to the parent directory, and check the hash:

    $ md5sum bulmages-master_0.16.0.20150107.1241-73c2dd9d.orig.tar.bz2
    9359934456b86da8489d24a947828239 
bulmages-master_0.16.0.20150107.1241-73c2dd9d.orig.tar.bz2


    Your proccess will be physically equivalent !!
    This allows to check the purity of the sources, because the 
mantainer of a debian package must not do changes in it (the upstream 
branch is for developers).


************ EXAMPLE 2: HOW TO BUILD WITH PRISTINE-TAR
*************************

1) Download a concret branch:

    $ git clone --branch release15 --single-branch 
https://gitlab.com/aitor_cz/bulmages.git


2) Now we will use git-import-orig, so remove the metadatas in bulmages
(the .git folder)

    $ rm -rf bulmages/.git
    $ mkdir release15
    $ cd release15
    $ git-import-orig --pristine-tar ../bulmages
      What will be the source package name? [] bulmages-release
      What is the upstream version? [] 0.15.0-5b3c913b
      gbp:info: Importing 
'../bulmages-release_0.15.0-5b3c913b.orig.tar.bz2' to branch 'master'...
      gbp:info: Source package is bulmages-release
      gbp:info: Upstream version is 0.15.0-5b3c913b
      pristine-tar: committed 
bulmages-release_0.15.0-5b3c913b.orig.tar.bz2.delta to branch pristine-tar
      gbp:info: Successfully imported version 0.15.0-5b3c913b of 
../bulmages-release_0.15.0-5b3c913b.orig.tar.bz2


3) Extract the pristine-tar branch:

    $ git checkout pristine-tar
      Switched to branch 'pristine-tar'


    $ ls -l
      bulmages-release_0.15.0-5b3c913b.orig.tar.bz2.delta
      bulmages-release_0.15.0-5b3c913b.orig.tar.bz2.id


The tarball bulmages-release_0.15.0-5b3c913b.orig.tar.bz2 is again in
the parent directory.

4) If yout want to do some changes, commit them an build with
git-buildpackage:

    $ git-buildpackage --git-export-dir="../build-area" \
                       --git-pristine-tar \
                       --git-tag \
                       --git-ignore-branch



************** EXAMPLE 3: HOW TO GENERATE THE PRISTINE-TAR BRANCH
**********************

As Joey Hess explains in his article:

http://joeyh.name/blog/entry/generating_pristine_tarballs_from_git_repositories/

the above examples are from the perspective of a maintainer of a Debian
package. But this can also be used by the authors who generate the
pristine tarballs in the first place. Check them into git using
pristine-tar. Then you can regenerate any tarball you've ever released
using just your project's git repository.

$ pristine-tar commit ../bulmages-release_0.15.0-5b3c913b.orig.tar.bz2
tags/0.15.0-5b3c913b

Have a nice day :)

Aitor.

P.D.- There is another alternative for the second example:

       $ gbp buildpackage --git-upstream-tag=0.15.0-5b3c913b \
                          --git-debian-branch=release15 \
                          --git-no-pristine-tar \
                          --git-pristine-tar-commit


On 25/08/15 16:24, Svante Signell <svante.signell@???> wrote:
> On Mon, 2015-08-24 at 17:09 +0200, aitor_czr wrote:
>> >Hi Svante,
>> >
>> >Pristine-tar branch guarantees a constant checksum in the sources
>> >*.bz2. The packager should not make changes in the source (this is
>> >only for the developer), all the changes must be done in the debian
>> >branch using quilt. Shortly i will write a little guide explaining how
>> >to create the pristine-tar branch (Joey Hess wrote something about
>> >that), etc...
> pristine-tar is needed to build the source package with
> dpkg-buildpackage (dpkg-source -b builds the source file).
> However I still have not found out how to build the source package from
> the pristine-tar branch and the binary files with dpkg-buildpackage.
>
>> >On 24/08/15 14:00, Svante Signell<svante.signell@???> wrote:
>> >
>>> > >This issue is still hindering me from fully maintain packages, a clear
>>> > >TODO is needed, preferably somewhere on the Devuan website.
> I meant a developers guide here:)
>
>>> > > I've started
>>> > >writing one but it is just started.