chiark / gitweb /
WIP
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jun 2018 23:39:23 +0000 (00:39 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 30 Jun 2018 23:39:23 +0000 (00:39 +0100)
dgit-downstream-dsc.7.pod

index f6aff7ec889ed7fa909a20106b6adeb49a151cd0..59ef6c32d99da90966651301a34d634fa03bcc08 100644 (file)
@@ -1,6 +1,6 @@
 =head1 NAME
 
-dgit-downstream-dsc - tutorial for downstreams publishing source packages
+dgit-downstream-dsc - setting up dgit push for a new distro
 
 =head1 INTRODUCTION
 
@@ -15,11 +15,14 @@ or with traditional tools such as B<apt-get source>.
 
 Note that often it is unnecessary to
 publish traditional source packages.
-Source packages are complex, idiosyncratic and difficult to work with.
+Debian-format source packages can be complex,
+idiosyncratic and difficult to work with.
 You should avoid them if you can.
 If you do not need to publish source packages,
-you can work as a Debian downstream purely using dgit and git branches.
-You can push your source code as a git branch to an ordinary git server.
+you can work as a Debian downstream purely using git branches,
+(using dgit to get the source from Debian in git form).
+You can build binaries directly from git,
+and push package source code as a git branch to an ordinary git server.
 See L<dgit-user(7)>.
 
 Not every option is covered here.
@@ -32,7 +35,7 @@ You need to choose some names.
 
 =over
 
-=item "distro" name
+=item I<distro> name
 
 dgit understands each thing it interacts with as a B<distro>.
 So in dgit terms, you are setting up a distro.
@@ -57,14 +60,14 @@ you might call your distro fsfe or fsfe.org.
 In the rest of this document we will write
 I<distro> for your distro name.
 
-=item "suite" names
+=item I<suite> names
 
 In dgit and Debian archive terminology, a B<suite> is a line of
 development, and/or a Debian release.
 For example, at the time of writing, Debian has suites like
-sid> aka unstable>, buster aka testing,
-stretch aka stable.
-There are also ancillary suites like stretch-security.
+B<sid> aka B<unstable>, B<buster> aka B<testing>,
+and B<stretch> aka B<stable>.
+There are also ancillary suites like B<stretch-security>.
 
 If your releases align with Debian's releases,
 then your suites should contain the Debian suite names.
@@ -76,7 +79,7 @@ For example, FSFE might end up with suites like fsfe-stretch.
 Suite names end up in git ref and branch names,
 and on dgit command lines.
 Suite names can contain alphanumerics and C<->.
-Other characters may work but is not recommended.
+Other characters may work but are not recommended.
 
 =back
 
@@ -107,8 +110,9 @@ needs to have at least read access to the git server.
 Ideally everything would be published
 via the git smart https protocol.
 
-The git server should have a stable name and path structure.
-Best is to give it a DNS name of its own.
+The git server name, and public git url structure,
+should be chosen so they will not need to change in the future.
+Best is to give the git server a DNS name of its own.
 
 Debian's dgit git server has special access control rules,
 implemented in B<dgit-repos-server> and B<dgit-repos-policy-debian>
@@ -117,7 +121,9 @@ but in most installations this is not needed.
 If there is no or little distinction between
 (i) developers who are entitled to upload (push) and
 (ii) repository administrators,
-then a git server with ordinary access control will do.
+then a it is sufficient to provide a
+git server with a unix account for each user who will pushing,
+perhaps using ssh restricted commands.
 
 =item Debian-format archive (repository)
 
@@ -201,7 +207,7 @@ C</push.git-host>, etc.
 
 The path to your repositories.
 dgit push will try to push to
-C<git-proto>[C<git-user-force>|C<username>B<@>]C<git-path>B</>I<package>
+C<git-proto>[C<git-user-force>|C<username>B<@>]C<git-path>B</>I<package>B<.git>
 
 =item B<dgit-distro.>I<distro>B<.git-check>, B<.git-check-suffix>
 
@@ -225,12 +231,12 @@ and C<git-check-suffix> to B</info/refs>.
 
 =item B<dgit-distro.>I<distro>B</push.git-check>, B</push.git-create>
 
-dgit push also needs to be able to check whether theh repo exists.
+dgit push also needs to be able to check whether the repo exists.
 
 You can set both of these to B<ssh-cmd>,
 which will use an ssh shell command to test repository existence.
 Or leave them unset, and dgit push will use the readonly details.
-If repositories are created automatically0 on push, somehow,
+If repositories are created automatically on push, somehow,
 you can set C<git-create> to B<true>.
 
 =item B<dgit-distro.>I<distro>B<.upload-host>
@@ -253,7 +259,7 @@ in the 2nd field of each B<sources.list> entry.
 =item B<dgit-distro.>I<distro>B<.archive-query>, B<.archive-query-url>
 
 If you have a smallish distro,
-set this to B<aptget:> (with acolon).
+set this to B<aptget:> (with a colon).
 
 If your distro is large
 (eg, if it contains a substantial fraction of Debian)
@@ -266,8 +272,12 @@ it is better to implement the Debian archive ftpmaster API.
 See L<https://api.ftp-master.debian.org/>,
 and set C<archive-query> to B<ftpmasterapi:> (with a colon)
 and C<archive-query-url> to your API base URL.
+dgit uses these queries:
+B<suites>,
+B<dsc_in_suite/>I<isuite>B</>I<package> and
+B<file_in_archive/>I<pat>
 
--item B<dgit-suite.>I<suite>B<.distro> I<distro>
+=item B<dgit-suite.>I<suite>B<.distro> I<distro>
 
 Set this for every one of your suites.
 You will have to update this when new suites are created.
@@ -276,6 +286,58 @@ to dgit.
 
 =back
 
+=head1 TEMPLATE GIT REPOSITORY
+
+When dgit push is used for I<package> for the first time,
+it must create a git repository on the git server.
+
+If C<git-create> is set to B<ssh-cmd>, 
+dgit will use the user's shell access to the server to
+B<cp -a _template.git> I<package>B<.git>.
+So you should create B<_template.git> with suitable contents.
+
+=head1 SSH COMMANDS
+
+When a user who can push runs dgit,
+dgit uses ssh to access the git server.
+
+To make ssh restricted command easier,
+and for the benefit of dgit-repos-server,
+dgit's ssh commands
+each start with a parseable commentish rune.
+
+The ssh commands used by dgit are these:
+
+=over
+
+=item B<: dgit> I<distro> B<git-check> I<package> B<;>...
+
+Test whether I<package> has a git repo on the server already.
+Should print B<0> or B<1> and a newline,
+and exit status zero in either case.
+The rest of the command, after B<;>,
+is a shell implementation of this test.
+Used when C<git-check> is set to B<ssh-cmd>.
+
+=item B<: dgit> I<distro> B<git-create> I<package> B<;>...
+
+Create the git repository for I<package> on the server.
+See L</TEMPLATE GIT REPOSITORY>, above.
+The rest of the command is an appropriate invocation of cd and cp.
+Used when C<git-create> is set to B<ssh-cmd>.
+
+=item B<git-receive-pack>..., B<git-upload-pack>...
+
+dgit invokes git to access the repository;
+git then runs these commands.
+Note that dgit push will first do a git fetch over ssh,
+so you must provide upload-pack as well as receive-pack.
+
+=back
+
+(There are also other ssh commands
+which are historical or obscure.)
+
 =head1 SEE ALSO
 
 dgit(1)