Distribution on download.gnu.org.ua

From Puszcza Wiki
Revision as of 05:46, 26 November 2019 by Gray (Talk | contribs)

Jump to: navigation, search

The anonymous FTP server at download.gnu.org.ua offers two main distribution points:

   ftp://download.gnu.org.ua/pub/release, for stable releases.
   ftp://download.gnu.org.ua/pub/alpha, for alpha releases.

Project administrators can upload their projects to any of these using the gnupload tool.

Contents

Basic Syntax

The basic invocation syntax is:

 gnupload --to ftp://download.gnu.org.ua:ftp/project files

or:

 gnupload --to ftp://download.gnu.org.ua:alpha/project files

where project is the project system name and files are the files to distribute. For example, to put files rush-1.2.tar.gz and rush-1.2.tar.bz2 on ftp://download.gnu.org.ua/pub/release/rush, one would run:

 gnupload --to ftp://download.gnu.org.ua:ftp/rush rush-1.2.tar.gz rush-1.2.tar.bz

Before submitting files, gnupload will sign them using your GPG key. If you have several GPG keys, you can select the right one by supplying its ID via the --user command line option, as in:

 gnupload --to ftp://download.gnu.org.ua:ftp/rush --user 55D0C732 rush-1.2.tar.gz

Note on Host Keys

Gnupload uses sftp in batch mode to upload files to the server. This expects your .ssh/known_hosts file to contain the host key of download.gnu.org.ua. If it does not, sftp will fail and you will get a diagnostic output similar to the following:

 Signing project-1.0.tar.gz... 
 Uploading project-1.0.tar.gz to download.gnu.org.ua:ftp/project... 
 Host key verification failed. 
 Couldn't read packet: Connection reset by peer

The recommended way to fix it is to obtain the host key via ssh-keyscan as shown in the example below:

 ssh-keyscan download.gnu.org.ua >> ~/.ssh/known_hosts

Another way is to initiate an interactive sftp session by running

 sftp download.gnu.org.ua

It will ask you to confirm connecting to the host:

 Connecting to download.gnu.org.ua... 
 The authenticity of host 'download.gnu.org.ua (193.186.15.45)' can't be established. RSA key fingerprint is bf:14:5d:ae:3d:11:0d:f7:bd:92:2d:6d:25:ae:f7:6f. 
 Are you sure you want to continue connecting (yes/no)?

Type yes, hit enter and close the session by typing Ctrl-D. This will store the host key in your ssh database.

Notice, that this procedure have to be done only once.

Configuration File

At startup, gnupload searches the current working directory for a file named .gnupload. If found, this file is parsed according to the following rules:

  • Empty lines are removed.
  • Lines beginning with a # (comments) are removed.
  • Each newline character is replaced with a single space.
  • The resulting string is prepended to the actual command line.

You can use this file to supply the default options to gnupload. For example, consider this configuration file contents:

 # A sample .gnupload file 
 --to ftp://download.gnu.org.ua:ftp/rush 
 --user 55D0C732 
 # End of file

Given this file and following the example from the previous section, uploading rush-1.2.tar.gz becomes as simple as:

 gnupload rush-1.2.tar.gz

Symlinks

An often used practice is to have symlink named project-latest.tar.gz pointing to the latest tarball for project. Gnupload provides a special option for that purpose. The command line:

 gnupload --symlink-re rush-1.2.tar.gz

uploads the file rush-1.2.tar.gz and symlinks it to rush-latest.tar.gz.

This option uses a sed(1) regular expression to locate the version number in the file name. The default regular expression recognizes the usual version numbers (one to three decimal integers, delimited by dots and separated with a single dash from the project name). In case you use another version numbering scheme, you can supply your customized sed expression as an argument to --symlink-re, e.g.

 --symink-re='s|-[0-9][0-9a-z\.]*\(-[0-9][0-9a-z]*\)\?\.|-latest.|'

Advanced Operations

Apart from distributing releases, gnupload can be used to manage the distribution directory contents. Special options for doing so are:

--delete files
Delete files from the directory. When applied to alpha directory, the named files are irrevocably lost. When applied to ftp directory, files are moved from ftp into a special archive storage. If you make a mistake when applying --delete to your stable ftp, you can ask puszcza-hackers@gnu.org.ua to restore accidentally removed files.
--symlink oldfile newfile
Create a symbolic link from oldfile to newfile. If newfile already exists and is a symbolic link, it will be removed.
Any number of oldfile newfile pairs can be supplied to this option.
--rmsymlink files
Remove symbolic links. Arguments are any number of symbolic link names to remove. Attempting to remove an unexisting symlink is not an error.
--
The double-dash marks the end of command line options. It is usually used to separated files to upload from the rest of commands. See the following section for an example.

Complex Requests

Any number of operations can be requested in a single gnupload invocation. Consider this example:

 gnupload --delete rush-1.5a.tar.gz rush-1.5a.tar.bz2 \
          --symlink rush-1.6.tar.gz rush-1-latest.tar.gz rush-1.6.tar.bz2 rush-1-latest.tar.bz2 \
          -- rush-2.0.tar.gz rush-2.0.tar.bz2

It does the following:

  1. Removes symbolic links rush-1.6.tar.gz and rush-1-latest.tar.gz
  2. Links rush-1.6.tar.gz to rush-1-latest.tar.gz
  3. Links rush-1.6.tar.bz2 to rush-1-latest.tar.bz2
  4. Uploads files rush-2.0.tar.gz and rush-2.0.tar.bz2.

Notice the use of double-dash (--) to separate upload names from the rest of the requests.

Technical Details

The upload procedure conforms to GNU Automated FTP Uploads protocol, version 1.1. Download.gnu.org.ua accepts uploads to /incoming/ftp and /incoming/alpha using any of the following methods: sftp, scp, or rsync via ssh.

Uploads are processed in real time.

Personal tools
Namespaces

Variants
Actions
Navigation
Tools