Return to Video

Preferred_Debian_Packaging.webm

  • Nesynchronizované
    Thank you very much.
  • Nesynchronizované
    Thanks everybody for coming,…
  • Nesynchronizované
    If you are packaging software and you want
    me to work on with you,
  • Nesynchronizované
    this is how you can do that.
  • Nesynchronizované
    It is a very self-??? talk:
  • Nesynchronizované
    I just want to explain some of the things
    that I like,
  • Nesynchronizované
    some practice that I prefer about Debian
    packaging,
  • Nesynchronizované
    and I don't pretend this is any sort of
    official,
  • Nesynchronizované
    permanent or final thing.
  • Nesynchronizované
    I just wanted to share some ideas that I
    have about the way that I work with
  • Nesynchronizované
    packages, in the hope that maybe, hmm,
    for two hopes:
  • Nesynchronizované
    One is that I hope that I can show you
    something that you have not heard of,
  • Nesynchronizované
    or maybe you were doing differently,
  • Nesynchronizované
    or maybe you think it is the right think
    to do and it is just nice to see somebody
  • Nesynchronizované
    somebody else doing it.
  • Nesynchronizované
    My second hope is that you can tell me
    what I am doing wrong,
  • Nesynchronizované
    and you can help me learn and improve
    on my own packaging techniques.
  • Nesynchronizované
    If you see something that I am proposing
    up here,
  • Nesynchronizované
    and you think there is a problem with it,
    I would like to hear about it too.
  • Nesynchronizované
    I just want to see more of the culture
    within Debian,
  • Nesynchronizované
    of people who are doing packaging,
    explaining what they are doing,
  • Nesynchronizované
    and so I thought I would just step up and
    explain:
  • Nesynchronizované
    "Here is some of the practice that I do",
  • Nesynchronizované
    In the hope that other people will do the
    same and explain what they are doing,
  • Nesynchronizované
    and maybe they can learn from me and
    I can learn from them.
  • Nesynchronizované
    Without much further ????, I am just going
    to dive into it.
  • Nesynchronizované
    If you have questions, I am perfectly
    happy to be interrupted,
  • Nesynchronizované
    we have some folks with walking mics
    in the crowd:
  • Nesynchronizované
    you can just raise your hand.
  • Nesynchronizované
    I you have got a question or an
    interruption or whatever,
  • Nesynchronizované
    that is fine.
  • Nesynchronizované
    I ??? I got the whole 15 minutes,
    I think there are 20 minutes,
  • Nesynchronizované
    I ??? the whole time, so there will be
    also time for questions at the end
  • Nesynchronizované
    if you prefer.
  • Nesynchronizované
    But I do not mind being interrupted.
  • Nesynchronizované
    So, this is all on this web page here,
  • Nesynchronizované
    you could probably skip this talk and go
    read the web page,
  • Nesynchronizované
    but then you would not have the nice
    ??? actions,
  • Nesynchronizované
    and it is easier to tell me that I am
    wrong in person,
  • Nesynchronizované
    so I would like to have that happen.
  • Nesynchronizované
    I put this up on the Debian wiki,
  • Nesynchronizované
    because I want anyone to be able to find
    it.
  • Nesynchronizované
    If you thing you have got some good ideas,
    you should put it on the Debian Wiki too:
  • Nesynchronizované
    other people can take advantage of the
    ideas that you have got.
  • Nesynchronizované
    First baseline is: I really like revision
    control.
  • Nesynchronizované
    And I know that it makes me a certain
    flavor on nerd,
  • Nesynchronizované
    but when we are working with things that
    are as complicated as software packages,
  • Nesynchronizované
    hmmm, I think a lot of people don't get
    that in Debian we are not just working on
  • Nesynchronizované
    one software package:
  • Nesynchronizované
    you are actually probably, if you are doing
    a responsibly work,
  • Nesynchronizované
    on at least two software packages, and
    maybe 5.
  • Nesynchronizované
    So you have got the version that is
    unstable and you have got
  • Nesynchronizované
    the version that you try to maintain for
    stable as well.
  • Nesynchronizované
    And we are committing to doing maintenance
    work.
  • Nesynchronizované
    A lot of our work in the project is ???
    in nature:
  • Nesynchronizované
    we want to clean up the mess and we want
    us to stay out of the way and
  • Nesynchronizované
    to make sure things work, functionally,
  • Nesynchronizované
    for people who are relying on the
    operating system to not get in their way.
  • Nesynchronizované
    So revision control I think is really
    helpful because it means you can
  • Nesynchronizované
    keep track of what changes you have done
    on different branches of the project
  • Nesynchronizované
    while you are maintaining both of them.
  • Nesynchronizované
    Basically, ??? require working with
    the revision system I am comfortable with,
  • Nesynchronizované
    I prefer Git, I am not going to have a
    religious word about it.
  • Nesynchronizované
    If upstream uses Git, I am even happier,
    and I try to make my packaging depend on
  • Nesynchronizované
    upstream's revision control.
  • Nesynchronizované
    I like to use 'git-buildpackage', and I
    like to use it with debhelper.
  • Nesynchronizované
    If you have not tried out
    'git-buildpackage',
  • Nesynchronizované
    we are going to have a
    'git-buildpackage' skill share session
  • Nesynchronizované
    later on today actually, and I welcome
    you to come and share your tricks with it,
  • Nesynchronizované
    or learn some tricks from other people.
  • Nesynchronizované
    It is a particular way that you can keep
    your Debian packaging in a Git repository,
  • Nesynchronizované
    and it helps you to keep track of all of
    the changes that ave happened within
  • Nesynchronizované
    your packaging and within upstream to
    make sure you are not accidentally
  • Nesynchronizované
    making other changes.
  • Nesynchronizované
    So it is very easy to go back and review
    what you have done.
  • Nesynchronizované
    I find that really useful.
  • Nesynchronizované
    I definitely also like to keep upstream's
    source code in the same revision control
  • Nesynchronizované
    system.
  • Nesynchronizované
    I like to keep the tarballs in the
    revision control system because it means
  • Nesynchronizované
    that if someone is interested, they can
    uses a tool called 'debcheckout'.
  • Nesynchronizované
    You can use 'debcheckout' with a name of
    a package:
  • Nesynchronizované
    you say just "I am really interested in
    package 'foo',
  • Nesynchronizované
    let me see the source code for that":
  • Nesynchronizované
    debcheckout foo
  • Nesynchronizované
    You get the source code, and you get the
    source code from a revision control
  • Nesynchronizované
    system that you can now track and you
    can just propose changes on.
  • Nesynchronizované
    You can also extract the tarball from that
    revision control system.
  • Nesynchronizované
    'debcheckout' actually works even if you
    do not have upstream stuff in there,
  • Nesynchronizované
    but I like to keep it all in one revision
    control system,
  • Nesynchronizované
    it is just easier to find everything when
    you want.
  • Nesynchronizované
    Some of these things that I prefer have
    to do with what the upstream software
  • Nesynchronizované
    developer has done, so I am less inclined
    to try the package an upstream software
  • Nesynchronizované
    project if they just throw tarballs here
    over the wall to an FTP side
  • Nesynchronizované
    every now and then.
  • Nesynchronizované
    It makes it more difficult for me to know
    what they are doing,
  • Nesynchronizované
    and why they are doing it.
  • Nesynchronizované
    So i like it, I have already said, when
    upstream uses Git,
  • Nesynchronizované
    I also like when upstream signs their
    releases,
  • Nesynchronizované
    and say "hey, this is specific release",
  • Nesynchronizované
    Because that is a signal that I can use,
    or somebody else that understands the
  • Nesynchronizované
    project: as said "we think that this
    something that other people can use",
  • Nesynchronizované
    or "this is a particular version we would
    like other people to test".
  • Nesynchronizované
    There are a lot of other situations where
    maybe it is not so important.
  • Nesynchronizované
    And having that be cryptographically
    signed is really useful.
  • Nesynchronizované
    I care about cryptographic signature on
    software because I want to know that
  • Nesynchronizované
    what I am running is related to the code
    that somebody else out should be run.
  • Nesynchronizované
    And if you don't verify your software
    cryptographically, anyone could
  • Nesynchronizované
    intercept the network connection
    between you and that software,
  • Nesynchronizované
    and modify the software before it gets
    to you.
  • Nesynchronizované
    And the cryptographic signature just says:
  • Nesynchronizované
    "look, this is a version that I am OK
    with. I am putting it out there and
  • Nesynchronizované
    it comes from me".
  • Nesynchronizované
    And so I can have a trace back to that
    point.
  • Nesynchronizované
    ??? just talk about briefly about how you
    do cryptographic verification of upstream.
  • Nesynchronizované
    You might know upstream: you might know
    them personally, you know their key
  • Nesynchronizované
    already, that is fine.
  • Nesynchronizované
    That is not the usual case: we work on
    the Internet.
  • Nesynchronizované
    In the situation where your upstream is
    signing their tarballs
  • Nesynchronizované
    and you have not met them, you do not
    have to sign their key,
  • Nesynchronizované
    you do not have to say "I announce this
    is their key".
  • Nesynchronizované
    This is probably the same one that is
    signing every release,
  • Nesynchronizované
    so you should keep track of that.
  • Nesynchronizované
    Debian has a nice way to keep track of
    that:
  • Nesynchronizované
    you can tell Debian how to find the new
    version of the upstream tarball.
  • Nesynchronizované
    This is in the Debian 'watch' file.
  • Nesynchronizované
    If you type 'man uscan', you can learn
    more about Debian 'watch',
  • Nesynchronizované
    and Debian 'watch' has now a feature that
    lets you say
  • Nesynchronizované
    "that is not only this way you find the
    tarball,
  • Nesynchronizované
    but upstream publishes signatures
    and the signatures look like this".
  • Nesynchronizované
    You know, they got a '.sig' at the end.
  • Nesynchronizované
    So there is a particular arcane way to
    specify that, but if you specify that,
  • Nesynchronizované
    then 'uscan' can find not only the
    upstream tarball but can find the
  • Nesynchronizované
    upstream signature and, if you drop
    upstream's signing key -
  • Nesynchronizované
    which of course I did not put on the wiki
    page, someone should add it that and
  • Nesynchronizované
    fix it - you can put the upstream signing
    key in 'debian/upstream/signing-key.asc'.
  • Nesynchronizované
    And then if you do that, when you say
    'uscan', you can tell…
  • Nesynchronizované
    Maybe some people here do notk
    now how to use 'uscan'.
  • Nesynchronizované
    'uscan' is a very simple tool,
    you run it from a software package that
  • Nesynchronizované
    has a 'debian' directory, or even one
    level up if you keep all of your software
  • Nesynchronizované
    packages in one folder. You can go one
    level up and say 'uscan', and it will look
  • Nesynchronizované
    in all of the folder that are children
    of it, and look for new version by
  • Nesynchronizované
    trying to find for new upstreams versions
    in 'debian/watch'.
  • Nesynchronizované
    And if you have configured 'debian/watch'
    properly, it can find the new upstream
  • Nesynchronizované
    signatures, and if you have got the
    'upstream/signing-key.asc', then
  • Nesynchronizované
    it will actually verify the signature for
    you as part of fetching the new
  • Nesynchronizované
    upstream tarball.
  • Nesynchronizované
    So you can get all of those things just
    by setting ???? that way.
  • Nesynchronizované
    There is a hand up down there, could we
    get the mic down to the hand ?
  • Nesynchronizované
    Or to the person who has that hand, it is
    not just a hand. [public laugh]
  • Nesynchronizované
    [someone] Publish a tarball and a hash, '.sha1',
    and sign that hash, '.sha1.asc'.
  • Nesynchronizované
    Can 'uscan' cope with this and check the
    signature on the hash and that the hash
  • Nesynchronizované
    belongs to that tarball ?
  • Nesynchronizované
    [Daniel] I do not believe that 'uscan' can
    do that currently. So anybody out there
  • Nesynchronizované
    who wants to make things better for the
    world should go hack on 'uscan':
  • Nesynchronizované
    that is a pretty straightforward thing
    that we should fix because I agree
  • Nesynchronizované
    that is common pattern.
  • Nesynchronizované
    [someone] I have no answer to this
    question by I have another question:
  • Nesynchronizované
    how do you convince upstreams who do
    not release tarballs or who do
  • Nesynchronizované
    not set tags in Git ?
  • Nesynchronizované
    [Daniel] Who do not make tags in Git ?
  • Nesynchronizované
    [someone] Yes, if there is no tags you
    can not check out a tarball.
  • Nesynchronizované
    Is there any good way to convince
    upstream to do this ?
  • Nesynchronizované
    [Daniel] Git has this nice feature, which
    is that you can create a tag,
  • Nesynchronizované
    which is associate with a particular
    revision,
  • Nesynchronizované
    and you would like to have a tag
    everywhere that a tarball has been
  • Nesynchronizované
    released from. I am tempted to pull up
    a Git view and show people some tags.
  • Nesynchronizované
    The question that you ask is a social
    one, not just a technical one,
  • Nesynchronizované
    and I actually find that my upstreams
    are pretty responsive.
  • Nesynchronizované
    Usually I frame my request as "hey, it
    looks like you made this tarball from
  • Nesynchronizované
    this particular commit 'id'. If you could
    tag you releases, it would be really
  • Nesynchronizované
    helpful to me, and here is the command
    that I would use to tag the release".
  • Nesynchronizované
    And I say "git tag…" and of course I
    can never remember so first I look it up,
  • Nesynchronizované
    but it is either 'tag name' 'commit id' or
    'commit id' 'tag name'.
  • Nesynchronizované
    But I would look it up and I would write
    the e-mail so that all they have to do is
  • Nesynchronizované
    they read it, understand my argument,
    and execute one command.
  • Nesynchronizované
    And then it starts them ??????
  • Nesynchronizované
    And if you say 'tag -s' then your tag will
    be cryptographically signed, which
  • Nesynchronizované
    I think is a really good thing to do too.
  • Nesynchronizované
    So, cryptographic verification of
    upstream.
  • Nesynchronizované
    As I said, I want to keep upstream's code
    in the revision control system.
  • Nesynchronizované
    I also like to keep…
  • Nesynchronizované
    In my ideal case upstream is using Git:
    I am using Git for packaging.
  • Nesynchronizované
    I actually like to keep upsteam's Git
    history fully in my repository,
  • Nesynchronizované
    so that I do not just have the tarballs,
    but I actually have all of their commits.
  • Nesynchronizované
    And that turns out to be really useful
    for two specific cases:
  • Nesynchronizované
    In one case, there is a common scenario
    where upstream will fix a bug,
  • Nesynchronizované
    but they have not made a release yet.
  • Nesynchronizované
    And that bug is really, really obviously
    problematic for the folks who are
  • Nesynchronizované
    using Debian, so want to fix it.
  • Nesynchronizované
    All I can do, because I have their full
    revision history, I can use Git to "cherry
  • Nesynchronizované
    pick" the upstream commit.
  • Nesynchronizované
    And then I "cherry pick" that upstream
    commit and I can have it applied
  • Nesynchronizované
    separately and release an Debian version
    that has the fix, even before upstream
  • Nesynchronizované
    has made a release with the fix.
  • Nesynchronizované
    So one nice thing about having upstream
    revision is that I can pull fixes from
  • Nesynchronizované
    upstream before they decided
    to release it.
  • Nesynchronizované
    The other advantage is the other
    way around.
  • Nesynchronizované
    Often when I am doing packaging,
    I discover a problem,
  • Nesynchronizované
    and maybe I can fix the problem.
  • Nesynchronizované
    And if that maybe I am already shipping
    a Debian package that fixes the problem.
  • Nesynchronizované
    If my Debian fixes can be directly applied
    to upstream, then I can use whatever
  • Nesynchronizované
    their preferred upstream patch
    submission guidelines are,
  • Nesynchronizované
    whether it is a Github pull request, or
    a patch to a mailing list,
  • Nesynchronizované
    or a "hey can you pull this from my Git
    repository over here", e-mail…
  • Nesynchronizované
    The fact that I am using the same Git
    history that they are using makes it
  • Nesynchronizované
    much easier for me to push my changes
    back to them.
  • Nesynchronizované
    So, it sort of smooth the interaction if
    you can consolidate and use the same
  • Nesynchronizované
    revision control system as their.
  • Nesynchronizované
    Towards that aim, I use a system now
    called 'patch q',
  • Nesynchronizované
    which is part of 'git buildpackage'.
  • Nesynchronizované
    So 'git buildpackage' is 'gbp', 'patch q'
    is 'pq',
  • Nesynchronizované
    so to deal with 'patch q' you say
    'gbp pq'
  • Nesynchronizované
    and then you have some commands.
  • Nesynchronizované
    And what that does, is it takes…
  • Nesynchronizované
    How many of you are Debian packagers ?
  • Nesynchronizované
    How many of you package
    software for Debian ?
  • Nesynchronizované
    A very large percentage, but not everyone.
  • Nesynchronizované
    I hope some folks are considering starting
    packaging if you have not done it yet.
  • Nesynchronizované
    Of those of you who package software,
    how many of you package software
  • Nesynchronizované
    with modifications, how many of you ship
    a modified version of upstream sources ?
  • Nesynchronizované
    Beyond the 'debian' directory, just Debian
    patches ?
  • Nesynchronizované
    So the common way to do that, for the
    Debian 3.0 ??? packaging skill, is that in
  • Nesynchronizované
    your 'debian' directory you have a
    'patches' sub-directory that has a set of
  • Nesynchronizované
    individual patches that apply certain
    changes, and they are applied in order
  • Nesynchronizované
    based on the file called
    'debian/patches/series'.
  • Nesynchronizované
    So maintaining that is kind of a drag
    when upstream makes big changes:
  • Nesynchronizované
    then all of sudden you have got this set
    of patches and they do not quite apply…
  • Nesynchronizované
    I is a drag even you do not have it in
    the 'debian/patches/' directory.
  • Nesynchronizované
    But what Debian 'patch q' does is it maps
    that directory of patches into a little
  • Nesynchronizované
    branch on your Git revision history.
  • Nesynchronizované
    So when you get a new upstream version,
    you can say 'patch q rebase',
  • Nesynchronizované
    and it treats it just as Git: it takes the
    'patch q'…
  • Nesynchronizované
    You have already imported the new version,
    and it re-applies your patches,
  • Nesynchronizované
    and sometimes that means some minor
    adjustments.
  • Nesynchronizované
    Git is really good at figuring out what
    the right minor adjustments are to make,
  • Nesynchronizované
    and so all of the sudden the 'patch q' is
    re-based, you refresh it in your revision
  • Nesynchronizované
    control system, and there you go.
  • Nesynchronizované
    So I like to use 'git-buildpackage' 'patch q',
    tagging, as already brought up,
  • Nesynchronizované
    thank you for that, I like to to tag
    everything that I release,
  • Nesynchronizované
    I like to push that as soon as I can,
    so that other people who are following
  • Nesynchronizované
    my work can now where my releases
    come from.
  • Nesynchronizované
    The reason that I like other people
    following my work is
  • Nesynchronizované
    they can fix my bugs easier.
  • Nesynchronizované
    I make mistakes, everybody makes mistakes,
    and it is really important to me that
  • Nesynchronizované
    if someone catches one of my mistakes,
    I can accept their feedback,
  • Nesynchronizované
    their criticism, their improvements,
    as easily as possible.
  • Nesynchronizované
    I want a low barrier to entry for people
    to help me fix my problems,
  • Nesynchronizované
    it is selfishness. So I try to patch it
    and publish this things for people
  • Nesynchronizované
    can find it.
  • Nesynchronizované
    I am ??? on these pretty fast because
    were are almost at the time.
  • Nesynchronizované
    I like to put in some place where other
    people get to the them,
  • Nesynchronizované
    at the moment I like to put them in
    'collab-maint',
  • Nesynchronizované
    it has some problems but it is better
    than not publishing your stuff,
  • Nesynchronizované
    and it is nice because it is sort of
    a public use.
  • Nesynchronizované
    I like to standardize how of my branches
    are named, so if I am working on
  • Nesynchronizované
    something that has got a stable version,
    that is for Jessie, I will name the branch
  • Nesynchronizované
    'jessie', because I ???
  • Nesynchronizované
    ???? multiple branches ???
  • Nesynchronizované
    I try to push as frequently as I have made
    something that looks sensible.
  • Nesynchronizované
    I do not feel obliged to push my commits
    to a public repository when I am still
  • Nesynchronizované
    experimenting, I actually really like to
    experiment, and I also like to keep track
  • Nesynchronizované
    of my experiments while I am doing them.
  • Nesynchronizované
    So I try to push when there is a sensible
    set of changes, and I am trying to get
  • Nesynchronizované
    myself to a point where I can understand
    what I have done, even if it wrong.
  • Nesynchronizované
    If I can get myself to a conceptual point
    where it is done, I will push my changes
  • Nesynchronizované
    so other people can see what I am
    working on, and then work from there.
  • Nesynchronizované
    That is OK to push something that is
    wrong,
  • Nesynchronizované
    as long as you push something that
    people can understand.
  • Nesynchronizované
    When you make a 'git commit' (if you are
    working with Git),
  • Nesynchronizované
    One of the things that helps me to think
    about commit messages…
  • Nesynchronizované
    People often think that commit messages
    should say "what change you made".
  • Nesynchronizované
    I think that the 'git patch' shows what
    change what change you have made,
  • Nesynchronizované
    and I thin your commit messages should
    say "why you made the change".
  • Nesynchronizované
    That is what people really want to read.
  • Nesynchronizované
    If you need to explain technically why
    the thing that you did
  • Nesynchronizované
    maps to the conceptual thing that you
    wanted to do, that is fine:
  • Nesynchronizované
    do that in your commit message too.
    But it is really important to say why
  • Nesynchronizované
    you made the change. It is not just like
    "initialize variable to 'no'":
  • Nesynchronizované
    OK, we can see that from the patch,
    but you what you are really saying
  • Nesynchronizované
    is "there was a crash if someone did 'x',
  • Nesynchronizované
    and we are avoiding that crash by
    setting this to 'no'.
  • Nesynchronizované
    So I like to send patches via email,
  • Nesynchronizované
    so I try to configure Git email, which
    make it really easy to just
  • Nesynchronizované
    push patches back upstream.
  • Nesynchronizované
    If I am starting taking over a project
    that somebody else has past on,
  • Nesynchronizované
    and they did not use Git, I will try to
    restore all of the imports.
  • Nesynchronizované
    I would be happy to talk with people
    about how to do that,
  • Nesynchronizované
    if you have questions come find me.
  • Nesynchronizované
    I like to keep my files ???? simple:
    there is a tool 'wrap-and-sort',
  • Nesynchronizované
    that just canonicalizes your files to
    make them look in a simple and
  • Nesynchronizované
    sensible way. And it is nice because it
    means that everything is…
  • Nesynchronizované
    It does things like alphabetize your
    list of build depends,
  • Nesynchronizované
    and brake them out one per line.
    The nice thing about that,
  • Nesynchronizované
    since you are using revision control,
    when you make a change
  • Nesynchronizované
    to your build depends, the changes
    become very easy to see:
  • Nesynchronizované
    "oh, they added one new package here,
    there is a single '+'".
  • Nesynchronizované
    When ???? so you can see that kind of
    thing.
  • Nesynchronizované
    I like to use ? deb five ? to format
    Debian copyright to be machine readable,
  • Nesynchronizované
    it is nice for people who are doing scans
    of the archive and try reason about
  • Nesynchronizované
    what the patterns are, and licensing of
    free software.
  • Nesynchronizované
    And if I am doing something really crazy,
    that is going to make a big change,
  • Nesynchronizované
    I like to use a feature branch in
    revision control.
  • Nesynchronizované
    So we have got one minute left,
    I want to open it up for other questions.
  • Nesynchronizované
    ????
  • Nesynchronizované
    [attendee]
Title:
Preferred_Debian_Packaging.webm
Video Language:
English
Team:
Debconf
Projekt:
2015_debconf15

English subtitles

Revízie Compare revisions