Check-in [66b1ddf665]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Comment: | Add support for clearsigned `InRelease` file. |
---|---|
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
66b1ddf6651a50ea5daac291c8ac08a0 |
User & Date: | mario 2018-01-27 10:40:16 |
2022-09-25
| ||
12:37 | import v0.7 · introduce combined modes · JavaScript embed option check-in: 2d4ea1818e user: mario tags: trunk | |
2018-01-27
| ||
10:40 | Add support for clearsigned `InRelease` file. check-in: 66b1ddf665 user: mario tags: trunk | |
2015-03-08
| ||
18:29 | Transform PHP function parameter /*type*/ hints into assert() statements. check-in: 5eaf0c63f6 user: mario tags: trunk | |
Changes to apt-phparchive.
1 2 3 4 5 6 7 | #!/usr/bin/php -qCddisable_functions=mysql_query <?php /** * api: cli * type: application * title: apt-phparchive * description: generates Packages.* and Release.* indexes for _trivial_ APT repository | | | > > < | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | #!/usr/bin/php -qCddisable_functions=mysql_query <?php /** * api: cli * type: application * title: apt-phparchive * description: generates Packages.* and Release.* indexes for _trivial_ APT repository * version: 0.7 * author: mario <mario#include-once:org> * category: utility * config: * { name: KEYNAME, value: dpkg1, title: "GPG key identifier", description: "used as GPG key for signing the Packages.gpg file" } * status: stable * * * Traverses directories for common package files. * Should index .deb .php .zip .exe .msi and possibly .rpm all at once. * * It's best invoked as: * * apt-phparchive generate . * * That creates "Packages" and "Packages.xz" and "Release", "Release.gpg" * and "InRelease" entries. Requires installed Unix tools and GPG for signing. * * Arguments are only loosely modelled after "apt-ftparchive". * * Package types: * - DEB archives are inspected with ar|gzip|tar * - PHP plugins are searched for a comment block with key:value meta infos according to http://milki.include-once.org/genericplugins/ |
72 73 74 75 76 77 78 79 80 81 82 83 84 85 | * - RPM converison tested with 4.8, might fail if the output prettyprinting * got changed in other versions. * - The PHP plugin meta data "standard" isn't really one. Its current * usage is still in flux. Wordpress plugin files are pre-converted by the * generic_pmd handler. * - No idea how APT-RPM would actually require the Packages index. The * current rewriting into standard APT fields: might possibly break it. * */ #-- init if (!function_exists("str_getcsv")) { function str_getcsv($str) { return array_map("trim", explode(",", $str)); } } include("pluginmetadata.php"); | > > > | 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | * - RPM converison tested with 4.8, might fail if the output prettyprinting * got changed in other versions. * - The PHP plugin meta data "standard" isn't really one. Its current * usage is still in flux. Wordpress plugin files are pre-converted by the * generic_pmd handler. * - No idea how APT-RPM would actually require the Packages index. The * current rewriting into standard APT fields: might possibly break it. * - There's a apt_preferences penalty for fully populated "InRelease" * indexes. Setting any of Label, Suite, Version fields raises an * overwrite warning from apt. All badly documented. * */ #-- init if (!function_exists("str_getcsv")) { function str_getcsv($str) { return array_map("trim", explode(",", $str)); } } include("pluginmetadata.php"); |
265 266 267 268 269 270 271 272 273 274 275 | #-- compress "Packages" function Packages_bz2() { global $dir; out( `bzip2 -kf $dir/Packages` ); } #-- create "Release" file function Release() { | > > > > > > | > > > > | > > > > > > | | | 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | #-- compress "Packages" function Packages_bz2() { global $dir; out( `bzip2 -kf $dir/Packages` ); } function Packages_xz() { global $dir; out( `xz -kf $dir/Packages` ); } #-- create "Release" file function Release() { out(join("\n", array( # "Origin: Ubuntu", # "Label: $GLOBALS[KEYNAME]", # "Suite: artful", # "Version: 17.10", "Date: " . gmdate(DATE_RFC822) . "", # "Codename: artful\n", "Architectures: amd64 i386 all", "Components: universe multiverse", "Description: $GLOBALS[KEYNAME]", "NotAutomatic: no", "ButAutomaticUpgrades: yes", )) . "\n"); // iterate over checksum types and index files foreach (array("MD5Sum"=>"md5", "SHA1"=>"sha1", "SHA256"=>"sha256", "RIPE160"=>"ripemd160") as $hashname=>$hash) { out( "$hashname:\n" ); foreach ((glob("Packages*")+glob("Release*")) as $fn) { // Not sure if we have to, but "Release" file gets ignored if ($fn == "Release") { $filesize = 0; $chksum = hash($hash, ""); } else { |
301 302 303 304 305 306 307 308 309 310 311 312 313 | " ", $fn, "\n" ); } } out("\n"); } #-- sign "Release.gpg" function Release_gpg() { global $dir, $KEYNAME; out( | > > > > > > > | | | > | > | 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 | " ", $fn, "\n" ); } } out("\n"); } #-- inline-signed Release file # https://wiki.debian.org/DebianRepository/Format function InRelease() { global $dir, $KEYNAME; out(`gpg --yes -s --clearsign --digest-algo SHA512 -u $KEYNAME -o /dev/stdout $dir/Release`); } #-- sign "Release.gpg" function Release_gpg() { global $dir, $KEYNAME; out( `gpg --yes -abs --digest-algo SHA512 -u $KEYNAME -o $dir/Release.gpg $dir/Release` ); } #-- perform all index generation things at once function Generate() { global $dir, $argv0, $args; out(`$argv0 Packages $dir --cache {$args->cache} > $dir/Packages`); # out(`$argv0 Packages.bz2 $dir`); out(`$argv0 Packages.xz $dir`); out(`$argv0 Release $dir > $dir/Release`); out(`$argv0 Release.gpg $dir`); out(`$argv0 InRelease $dir > $dir/InRelease`); } }//main |