Tales from the Gryphon

Looking at porcelain: Towards a generic, distribution agnostic tool for building packages from a VCS

  • Edit this page
  • RecentChanges
  • History
  • Preferences
  • Comment
Tales from the Gryphon

Relevant Links

  • New key
  • GPG key
  • PGP key
  • Policy

Categories(91)

  • Books(29)
    • Action(3)
    • Classics(1)
    • Espionage(9)
    • Fantasy(10)
    • Fiction(1)
    • Sci-Fi(5)
  • Debian(8)
    • Official(2)
  • Software(26)
    • Arch(1)
    • Git(4)
    • Packaging(7)
    • Debian(9)
    • IkiWiki(2)
    • Security(3)
  • Movies(5)
  • SysAdmin(1)
  • Spam(10)
  • Travel(2)
  • Miscellaneous(7)

Archives

← 2010
Months
Jan Feb Mar Apr May Jun
Jul Aug Sep Oct Nov Dec
← September
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30    

Indices

  • 2004
    • 05
    • 06
    • 07
    • 10
    • 11
  • 2005
    • 03
    • 05
    • 06
  • 2006
    • 01
    • 08
    • 12
  • 2007
    • 01
    • 08
    • 11
    • 12
  • 2008
    • 01
    • 04
    • 05
    • 06
  • 2009
    • 02
    • 03
    • 04
    • 05
  • 2010
    • 03
    • 08

My Books:
Widget_logo


Valid XHTML 1.1 Valid CSS! Linux Counter #69681 RSS Valid Ikiwiki hacker emblem

Manoj's hackergotchi
Saturday 18 April
2009
Looking at porcelain: Towards a generic, distribution agnostic tool for building packages from a VCS
[
  • software :: 
  • packaging :: 
]

License: GPL

This is a continuation from before.

Before I go plunging into writing code for a generic vcs-pkg implementation, I wanted to take a close look at my current, working, non-generic implementation: making sure that the generic implementation can support at least this one concrete work-flow will keep me grounded.

One of the features of my home grown porcelain for building package has been that I use a fixed layout for all the packages I maintain. There is a top level directory for all working trees. Each package gets a sub-directory under this working area. And in each package sub-directory, are the upstream versions, the checked out VCS working directory, and anything else package related. With this layout, knowing the package name is enough to locate the working directory. This enable me to, for example, hack away at a package in Emacs, and when done, go to any open terminal window, and say stage_release kernel-package or tag_releases ucf without needing to know what the current directory is (usually, the packages working directory is several levels deep — /usr/local/git/debian/make-dfsg/make-dfsg-3.91, for instance.

However, this is less palatable for a generic tool – imposing a directory structure layout is pretty heavy. And I guess I can always create a function called cdwd, or something, to take away the tedium of typing out long cd commands.

Anyway, looking at my code, there is the information that the scripts seem to need in order to do their work.

  • Staging area. This is where software to be built is exported (and this area is visible from my build virtual machine).
    • User specified (configuration)
  • Working Area. This is the location where all my packaging work happens. Each package I work on has a sub-directory in here, and the working directories for each package live in the package sub-directory. Note: Should not be needed.
    • User specified.
  • Working directory. This is the checked out tree from the VCS, and this is the place where we get the source tree from which the package can be built.
    • Since we know the location of the working are, if the package name is known, we can just look in the package’s sub-directory in the working area.
      • For rpm based sources, look for the spec file
      • For Debian sources, locate debian/rules
    • If package name is not known, look for spec or debian/rules in the current directory, and parse either the spec file or debian/changelog.
    • If in a VCS directory, look for the base of the tree
      • tla tree-root
      • bzr info
      • git rev-parse --show cdup
      • hg root
      • You have to climb the tree for subversion
    • If you are in a debian directory, and changelog and rules files exist

    Then, look for the spec file or debian/rules in the base directory

  • package name
    • User specified, on the command line
    • If in the working directory of the package, can be parsed from the spec or changelog files.
  • upstream tar archive
    • Usually located in the parent directory of the working directory (the package specific sub-directory of the working area)
    • If pristine-tar is in use, given two trees (branches, commits. etc), namely:
      • a tree for upstream (default: the branch ~upstream~)
      • a tree for the delta (default: the branch ~pristine-tar~)

      The tree can be generated

    • Given an upstream tree (default: the branch ~upstream~), a tar archive can be generated, but is likely to be not bit-for-bit identical to the original tar archive.

So, if I do away with the whole working area layout convention, this can be reduced to just requiring the user to:

  • Specify Staging area
  • Call the script in the working directory (dpkg-buildpackage imposes this too).
  • Either use pristine-tar or have the upstream tar archive in the parent directory of the working directory

Hmm. One user specified directory, where the results are dumped. I can live with that. However, gitpkg has a different concept: it works purely on the git objects, you feed it upto three tree objects, the first being the tree with sources to build, and the second and third trees being looked at only if the upstream tar archive can not be located, and passes the trees to pristine tar to re-construct the upstram tar. The package name and version are constructed after the source-tar archive is extracted to the staging area. I like the minimality of this.

This is continued here.

Manoj

Comments


Add a comment
  • 16/Towards a generic, distribution agnostic tool for building packages from a VCS
  • 22/Ontologies: Towards a generic, distribution agnostic tool for building packages from a VCS

Webmaster <webmaster@golden-gryphon.com>
Last commit: Sunday night, April 26th, 2009

License: GPL

Last edited Sunday night, April 26th, 2009