1

The manpage for apt-ftparchive reads:

release
        The release command generates a Release file from a directory tree. It 
    recursively searches the given directory for uncompressed and compressed
    Packages, Sources, Contents, Components and icons files as well as Release,
    Index and md5sum.txt files by default 
    (APT::FTPArchive::Release::Default-Patterns). Additional filename patterns can
    be added by listing them in APT::FTPArchive::Release::Patterns. It then writes
    to stdout a Release file containing (by default) an MD5, SHA1, SHA256 and
    SHA512 digest for each file.
    Values for the additional metadata fields in the Release file are taken 
from the corresponding variables under APT::FTPArchive::Release, e.g.
APT::FTPArchive::Release::Origin. The supported fields are Origin, Label,
Suite, Version, Codename, Date, NotAutomatic, ButAutomaticUpgrades,
Acquire-By-Hash, Valid-Until, Signed-By, Architectures, Components and
Description.

I need to set these fields in the generated Release file, made with:

user@server:/srv/repo/dists/ascii$ apt-ftparchive release . > Release

How can I do that?

What are these APT::FTPArchive::Release::... variables and how do I set them?

fadedbee
  • 2,098

2 Answers2

2

The command apt-config's man page shows that it can be used to set these variables, with a --option option.

Unfortunately the options do not stick, which renders the setting them in apt-config absolutely pointless. (There probably is a reason, I just don't know enough to see it yet.)

Luckily, this --option option also works on apt-ftparchive, I had just overlooked that section of the man page:

   -o, --option
       Set a Configuration Option; This will set an arbitrary configuration option. 
       The syntax is -o Foo::Bar=bar.  
       -o and --option can be used multiple times to set different options.

So the full command line was:

user@server:/srv/repo/dists/ascii$ apt-ftparchive \
  -o APT::FTPArchive::Release::Origin="Devuan" \
  -o APT::FTPArchive::Release::Label="Devuan" \
  -o APT::FTPArchive::Release::Suite="stable" \
  -o APT::FTPArchive::Release::Version="2.0" \
  -o APT::FTPArchive::Release::Codename="ascii" \
  -o APT::FTPArchive::Release::Architectures="armhf" \
  -o APT::FTPArchive::Release::Components="main" \
  release . > Release
fadedbee
  • 2,098
1

You could also create a release.conf file:

APT::FTPArchive::Release::Origin="Devuan"
APT::FTPArchive::Release::Label="Devuan"
APT::FTPArchive::Release::Suite="stable"
APT::FTPArchive::Release::Version="2.0"
APT::FTPArchive::Release::Codename="ascii"
APT::FTPArchive::Release::Architectures="armhf"
APT::FTPArchive::Release::Components="main"

and run

user@server:/srv/repo/dists/ascii$ apt-ftparchive release -c release.conf . > Release