[buildd-tools-devel] Using apt-ftparchive to generate Packages/Release
Andres Mejia
mcitadel at gmail.com
Tue Nov 23 00:46:15 UTC 2010
On Sun, Nov 21, 2010 at 8:41 AM, Roger Leigh <rleigh at codelibre.net> wrote:
> Hi,
>
> Just an example to demonstrate:
>
> f% apt-ftparchive packages .
> Package: sbuild-build-depends-time-dummy
> Maintainer: Debian buildd-tools Developers <buildd-tools-devel at lists.alioth.debian.org>
> Architecture: powerpc
> Version: 0.invalid.0
> Depends: base-files, base-passwd, bash, coreutils, dash, debianutils, diffutils, dpkg, e2fsprogs, findutils, grep, gzip, hostname, ncurses-base, ncurses-bin, perl-base, sed, login, sysvinit-utils, sysvinit, tar, bsdutils, mount, util-linux, libc6-dev | libc-dev, gcc (>= 4:4.4.3), g++ (>= 4:4.4.3), make, dpkg-dev (>= 1.13.5), debhelper (>> 4.1.0), texi2html, texinfo, automaken, cdbs
> Filename: ./sbuild-build-depends-time-dummy.deb
> Size: 890
> MD5sum: 440be9ec12408cc9575aa0ab1171e97d
> SHA1: 28f95fff5bd8c9fedaef3b33f0338352293fcfab
> SHA256: 1fe4d22f0999694585ecbaffad31e4196e2ac34c7bc5f7b1d3036ffa1b92120b
> Description: Dummy package to satisfy dependencies with apt - created by sbuild
> This package was created automatically by sbuild and should never appear on
> a real system. You can safely remove it.
>
> This could be automated with a config file, so we can use "generate"
> instead:
>
> % cat test.conf
> Dir {
> ArchiveDir ".";
> CacheDir ".";
> };
>
> Default {
> Packages::Compress ". gzip bzip2";
> Sources::Compress "gzip bzip2";
> Contents::Compress "gzip bzip2";
> };
>
> BinDirectory "." {
> Packages "Packages";
> Contents "Contents";
> SrcPackages "Sources";
> };
>
> % apt-ftparchive generate test.conf
> .: 1 files 890B 0s
> Done Packages, Starting contents.
> Contents: 1 files 890B 0s
> Done. 890B in 1 archives. Took 0s
>
> % ls
> Contents.bz2 Contents.gz Packages Packages.bz2 Packages.gz rel.conf Release sbuild-build-depends-time-dummy.deb test.conf
>
> % cat rel.conf
> APT::FTPArchive::Release::Origin "sbuild-build-depends-archive";
> APT::FTPArchive::Release::Label "sbuild-build-depends-archive";
> APT::FTPArchive::Release::Suite "invalid";
> APT::FTPArchive::Release::Codename "invalid";
> APT::FTPArchive::Release::Architectures "powerpc";
> APT::FTPArchive::Release::Description "Sbuild Build Dependency Temporary Archive";
>
> % apt-ftparchive -c rel.conf release . > Release
>
> % cat Release
> Architectures: powerpc
> Codename: invalid
> Date: Sun, 21 Nov 2010 13:27:17 UTC
> Description: Sbuild Build Dependency Temporary Archive
> Label: sbuild-build-depends-archive
> Origin: sbuild-build-depends-archive
> Suite: invalid
> MD5Sum:
> 2489533eb8f96ce992681b47a3304796 976 Packages
> c62a1d38679a9013beef166f5c94a057 665 Packages.bz2
> 8c6b9ddb03553cc8765588c1201e4f9f 606 Packages.gz
> d41d8cd98f00b204e9800998ecf8427e 0 Release
> SHA1:
> 9e03cf8b1a3f27c11ffbd1f0b81ea5a9688fdfd9 976 Packages
> 67e7a2229643e447e82ea93979e7514a6ce306c7 665 Packages.bz2
> a424780059f612e464bcd799e2d6547dc8f4d1ee 606 Packages.gz
> da39a3ee5e6b4b0d3255bfef95601890afd80709 0 Release
> SHA256:
> c35331b3069745575809a641ae8f134bc80d7afa82b3f421130270af686e11ed 976 Packages
> f8f0b044d34fc3473635513d2cfb43b58887ff0885e13a80339ee1ef62a113b8 665 Packages.bz2
> 635dc28fd063a200eceb04b769afc9eb62b4fd60738e61c7e2e34397777b4e02 606 Packages.gz
> e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 0 Release
>
> It probably needs running from a parent directory, rather than '.',
> so we don't get the Release file showing up in Release, but other
> than that it's simple to do and would make the code rather more
> readable.
>
>
> Regards,
> Roger
>
> --
> .''`. Roger Leigh
> : :' : Debian GNU/Linux http://people.debian.org/~rleigh/
> `. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
> `- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkzpIZIACgkQVcFcaSW/uEiTIQCg4cVoJ7BxadJO19RzVB28HGdb
> knUAn2rIAFw+WAVfqdZi32LPT+3cSXE7
> =YMwj
> -----END PGP SIGNATURE-----
>
>
Ok, using apt-utils does make this easier. I'll get to work on this.
And about running in the parent directory, wouldn't this be better?
$ apt-ftparchive -c rel.conf release . > "path/to/archive"/Release
Or change ArchiveDir in the config file.
Dir {
ArchiveDir "/path/to/archive";
};
Also, let's turn off use of contents and bzip2 so we can keep the
dummy archive as basic as we can and hopefully get fewer bugs.
--
Regards,
Andres Mejia
More information about the Buildd-tools-devel
mailing list