Distribution on download.gnu.org.ua
The server download.gnu.org.ua distributes software using the traditional anonymous ftp and https protocols. For brevity, in this document all links are shown as https.
The server offers two main distribution points:
https://download.gnu.org.ua/pub/release, for stable releases. https://download.gnu.org.ua/pub/alpha, for alpha releases.
Project administrators can upload their projects to any of these using the gnupload tool.
Basic Syntax
The basic invocation syntax is:
gnupload --to download.gnu.org.ua:ftp/project files
or:
gnupload --to 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 https://download.gnu.org.ua/pub/release/rush, one would run:
gnupload --to 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 stored in your account settings. 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 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
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 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
The examples below are written supposing that a gnupload file is present.
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-regex 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-regex, e.g.
--symink-regex='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 (release) 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:
- Removes symbolic links rush-1.6.tar.gz and rush-1-latest.tar.gz
- Links rush-1.6.tar.gz to rush-1-latest.tar.gz
- Links rush-1.6.tar.bz2 to rush-1-latest.tar.bz2
- 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.