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

Proposal new source archive format



We've had a couple of discussions about shortcomings of the way
we currently implement source packages, and the various ways to
work around it. To summarise, the shortcomings of the current system
are:

* can not handle multiple tar archives
* can not handle seperate patches
* can not handle bzip2 compressed files
* can not handle binary files
* can not handle .sig files for upstream distributed files

Some people have gone to great lenghts to work around these problems
by creating their own build systems. However I feel it is important
that instead of working around shortcomings in dpkg-source we should
intead fix it to make these features available to everyone in a
common and document way.

Lets look at some of the issues involved:

We have a couple of different types of entities involved:
* original upstream sources (one or more tar archives)
* upstream patches
* .sig files for upstream distributed files
* debianization files
* debian patches

All upstream files should be listed in the .dsc file with a md5sum.

So, what should a new system look like? Here is a simple proposal,
without much details:

* Modify the format .dsc file to list the files that contains the sources
of a package, as well as how to extract that source. The sources here are
all tar archives, either gzip or bzip2 compressed, and the upstream
patches. For each source there can be a flag that states in what
directory to unpack a source. This way we can handle sources that don't
create a subdirectory for themselves, or a source that is shipped in
multiple archives not all of which must be extracted in the same
location.

* We use a new file, debian/sources, which lists all source files
and has instructions for unpacking them. For a full description
of the file see the attached manpage.

* fiels can be marked as either `upstream' or `debian'. All upstream files
will be listed in the .dsc file.

* Patches will be applied in the they are listed in the debian/sources
file.

* When unpacking a package we extract all the tar archives, but don't apply
any patches. This means we will have the package in its original upstream
form.

* there is a dpkg-patch tool that can apply or reverse patches. It will
check if patches are applied in order, and can unpack the original source
and produce a diff from that to the current source so we can easily 
generate a new patch. The status for each patch (applied/not applied)
will be stores in a debian/status file.

* when building a binary package we apply all patches. We don't support
conditional patches since if a patch doesn't work under all conditions
it is broken anyway.

* when building a source package all patches are reversed. Any patches
that remain are will be the debian-ization patch.

Wichert.

-- 
  _________________________________________________________________
 / Generally uninteresting signature - ignore at your convenience  \
| wichert@liacs.nl                    http://www.liacs.nl/~wichert/ |
| 1024D/2FA3BC2D 576E 100B 518D 2F16 36B0  2805 3CB8 9250 2FA3 BC2D |


SOURCES(5)              dpkg-source manual             SOURCES(5)


NNAAMMEE
       debian/sources - Debian source archive control file

DDEESSCCRRIIPPTTIIOONN
       The _d_e_b_i_a_n_/_s_o_u_r_c_e_s file lists all the sources for a source
       archive. This includes both source  archives  in  the  ttaarr
       format and patches.

       It  is  used  by  ddppkkgg--ssoouurrccee when building or extracing a
       source archive, and by ddppkkgg--ppaattcchh to manage patches  which
       can be applied.

SSYYNNTTAAXX
       Each line contains a definition of either a source archive
       or a patch.  If a line begins with a `##' it is  considered
       a comment and ignored.  A definition looks like this:

              origin type filename [options]

       oorriiggiinn states where a source is coming from. Currently the
       only allowed options are `ddeebbiiaann' and `uuppssttrreeaamm'.  If  the
       origin  is  `uuppssttrreeaamm' the file will be listed in the _._d_s_c
       file.

       ttyyppee is the type of file. Allowed options  are  `ttaarr'  and
       `ppaattcchh'.  You do not need to state the compression method,
       ddppkkgg--ssoouurrccee will do that automatically.

       ffiilleennaammee is (surprise!) the filename of the  file  we  are
       defining.   For  (tar)  archives  the  filename  does  not
       include a path, it must reside in the directory  in  which
       dpkg-source  is  run when extracting, or the parent direc-
       tory when building a package. For patches the path is rel-
       ative to the path where the archives are.

       All  files  can  be compressed using either ggzziipp or bbzziipp22,
       ddppkkgg--ssoouurrccee will detect the compression type automatically
       and uncompress the files.

       options  specify  how  to  extract  an  archive or apply a
       patch. The following options are allowed:

       ddiirr|ddiirreeccttoorryy  _<_d_i_r_>
              directory in which to apply a patch or  extract  an
              archive. If the directory does not exist it will be
              created.

       rreevv|rreevveerrssee (only for patches)
              Apply a reversed patch.

       ffuuzzzz _<_l_e_v_e_l_> (only for patches)
              Apply the patch with fuzz factor _<_l_e_v_e_l_>.





Debian project              April 2000                          1





SOURCES(5)              dpkg-source manual             SOURCES(5)


       nnoossppaaccee|iiggnnoorree--wwhhiitteessppaaccee (only for patches)
              Ignore any white space changes  between  the  patch
              and the source.

EEXXAAMMPPLLEE
       This  is  an  example of a _d_e_b_i_a_n_/_s_o_u_r_c_e_s file for the vviimm
       package. It shows that vim uses two tar archives  for  its
       source,  and  has  a  number  of  patches  stored  in  the
       _v_i_m_-_5_._5_/_d_e_b_i_a_n_/_p_a_t_c_h_e_s directory, 4 of which are  upstream
       patches.

              # Normal upstream sources
              upstream tar vim-src-5.5.tar.gz
              upstream tar vim-rt-5.5.tar.gz
              # Upstream patches
              # 5.5.001: Configure in the top directory did not pass on an
              # argument with a space correctly.  For example
              # "./configure --previs="/My home".
              upstream patch vim-5.5/debian/patches/5.5.001
              # 5.5.002: Compilation error for using "fds[] & POLLIN".
              upstream patch vim-5.5/debian/patches/5.5.002
              # 5.5.003: The autoconf check for sizeof(int) is wrong on
              # machines where sizeof(size_t) != sizeof(int).
              upstream patch vim-5.5/debian/patches/5.5.003
              # 5.5.004: On Unix it's not possible to interrupt ":sleep 100".
              upstream patch vim-5.5/debian/patches/5.5.004
              # pixmapbg: support a pixmap background in the editing window
              debian patch vim-5.5/debian/patches/deb-pixmapbg
              # newxterm: handle features of new xterm
              debian patch vim-5.5/debian/patches/deb-newxterm

AAUUTTHHOORR
       Wichert Akkerman <wakkerma@debian.org> for Debian

SSEEEE AALLSSOO
       ddppkkgg--ssoouurrccee(1)





















Debian project              April 2000                          2


Attachment: pgpdYI6jLP6_O.pgp
Description: PGP signature


Reply to: