225 | | - "dir:entry" : string : "bin" |
226 | | - "file:type" : uint : 1 (0x1) |
227 | | - "file:mtime" : uint : 1258110729 (0x4afd3f09) |
228 | | - "dir:entry" : string : "awk" |
229 | | - "file:type" : uint : 2 (0x2) |
230 | | - "file:mtime" : uint : 1258110676 (0x4afd3ed4) |
231 | | - "symlink:path" : string : "gawk" |
232 | | - "dir:entry" : string : "gawk" |
233 | | - "file:permissions" : uint : 493 (0x1ed) |
234 | | - "file:mtime" : uint : 1258110676 (0x4afd3ed4) |
235 | | - "data" : raw : size: 301699, offset: 0 |
236 | | - "file:attribute" : string : "BEOS:APP_VERSION" |
237 | | - "file:attribute:type" : uint : 1095782486 (0x41505056) |
238 | | - "data" : raw : size: 680, offset: 301699 |
239 | | - "file:attribute" : string : "BEOS:TYPE" |
240 | | - "file:attribute:type" : uint : 1296649555 (0x4d494d53) |
241 | | - "data" : raw : size: 35, offset: 302379 |
242 | | |
243 | | |
244 | | === Attribute Types === |
245 | | |
246 | | The following attribute types are specified by the archive format. Any other attributes will be ignored. |
247 | | |
248 | | ==== B_HPKG_ATTRIBUTE_NAME_DIRECTORY_ENTRY ("dir:entry") ==== |
| 204 | - B_HPKG_ATTRIBUTE_ID_DIR_ENTRY : string : "bin" |
| 205 | - B_HPKG_ATTRIBUTE_ID_FILE_TYPE : uint : 1 (0x1) |
| 206 | - B_HPKG_ATTRIBUTE_ID_FILE_MTIME : uint : 1258110729 (0x4afd3f09) |
| 207 | - B_HPKG_ATTRIBUTE_ID_DIR_ENTRY : string : "awk" |
| 208 | - B_HPKG_ATTRIBUTE_ID_FILE_TYPE : uint : 2 (0x2) |
| 209 | - B_HPKG_ATTRIBUTE_ID_FILE_MTIME : uint : 1258110676 (0x4afd3ed4) |
| 210 | - B_HPKG_ATTRIBUTE_ID_SYMLINK_PATH : string : "gawk" |
| 211 | - B_HPKG_ATTRIBUTE_ID_DIR_ENTRY : string : "gawk" |
| 212 | - B_HPKG_ATTRIBUTE_ID_FILE_PERMISSIONS : uint : 493 (0x1ed) |
| 213 | - B_HPKG_ATTRIBUTE_ID_FILE_MTIME : uint : 1258110676 (0x4afd3ed4) |
| 214 | - B_HPKG_ATTRIBUTE_ID_DATA : raw : size: 301699, offset: 0 |
| 215 | - B_HPKG_ATTRIBUTE_ID_FILE_ATTRIBUTE : string : "BEOS:APP_VERSION" |
| 216 | - B_HPKG_ATTRIBUTE_ID_FILE_ATTRIBUTE_TYPE : uint : 1095782486 (0x41505056) |
| 217 | - B_HPKG_ATTRIBUTE_ID_DATA : raw : size: 680, offset: 301699 |
| 218 | - B_HPKG_ATTRIBUTE_ID_FILE_ATTRIBUTE : string : "BEOS:TYPE" |
| 219 | - B_HPKG_ATTRIBUTE_ID_FILE_ATTRIBUTE_TYPE : uint : 1296649555 (0x4d494d53) |
| 220 | - B_HPKG_ATTRIBUTE_ID_DATA : raw : size: 35, offset: 302379 |
| 221 | |
| 222 | |
| 223 | === Attribute IDs === |
| 224 | |
| 225 | The following attribute IDs are specified by the archive format. Any other attributes will be ignored. |
| 226 | |
| 227 | ==== B_HPKG_ATTRIBUTE_ID_DIRECTORY_ENTRY ("dir:entry") ==== |
413 | | TODO... |
| 392 | This section specifies how informative package attributes (package-name, version, provides, requires, ...) are stored in a HPKG file. It builds on top of the container format, defining the types of attributes, their order, and allowed values. |
| 393 | |
| 394 | E.g. a ".PackageInfo" file, containing a package description that is being converted into a package file: |
| 395 | {{{ |
| 396 | name = mypackage |
| 397 | version = 0.7.2-1 |
| 398 | architecture = x86 |
| 399 | summary = "is a very nice package" |
| 400 | description = "has lots of cool features\nand is written in MyC++" |
| 401 | vendor = "Me, Myself & I, Inc." |
| 402 | packager = "me@test.com" |
| 403 | copyrights = [ "(C) 2009-2011, Me, Myself & I, Inc." ] |
| 404 | licenses = [ "Me, Myself & I Commercial License", "MIT" ] |
| 405 | provides = [ |
| 406 | cmd:me |
| 407 | lib:libmyself = 0.7 |
| 408 | ] |
| 409 | requires = [ |
| 410 | haiku >= r1 |
| 411 | wget |
| 412 | ] |
| 413 | }}} |
| 414 | could be represented by this attribute tree: |
| 415 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_NAME : string : "mypackage" |
| 416 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR : string : "0" |
| 417 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MINOR : string : "7" |
| 418 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MICRO : string : "2" |
| 419 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_RELEASE : uint : 1 |
| 420 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_ARCHITECTURE : uint : 1 |
| 421 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_SUMMARY : string : "is a very nice package" |
| 422 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_DESCRIPTION : string : "has lots of cool features\nand is written in MyC++" |
| 423 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VENDOR : string : "Me, Myself & I, Inc." |
| 424 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_PACKAGER : string : "me@test.com" |
| 425 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_COPYRIGHT : string : "(C) 2009-2011, Me, Myself & I, Inc." |
| 426 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_LICENSE : string : "Me, Myself & I Commercial License" |
| 427 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_LICENSE : string : "MIT" |
| 428 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES : string : "cmd:me" |
| 429 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES_TYPE : uint : 2 |
| 430 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES : string : "lib:libmyself" |
| 431 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES_TYPE : uint : 1 |
| 432 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR : string : "0" |
| 433 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MINOR : string : "7" |
| 434 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_REQUIRES : string : "haiku" |
| 435 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_RESOLVABLE_OPERATOR : uint : 4 |
| 436 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR : string : "r1" |
| 437 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_REQUIRES : string : "wget" |
| 438 | |
| 439 | |
| 440 | === Attribute IDs === |
| 441 | |
| 442 | The following attribute IDs are specified by the package format. Any other attributes will be rejected. |
| 443 | |
| 444 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_NAME ("package:name") ==== |
| 445 | - '''Type:''' string |
| 446 | - '''Value:''' Name of the package. |
| 447 | - '''Allowed Values:''' Any name composed of <alphanum_underline> (i.e. [a-zA-Z0-9_]). |
| 448 | - '''Child Attributes:''' none |
| 449 | |
| 450 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_SUMMARY ("package:summary") ==== |
| 451 | - '''Type:''' string |
| 452 | - '''Value:''' Short description of the package. |
| 453 | - '''Allowed Values:''' Any single-lined string. |
| 454 | - '''Child Attributes:''' none |
| 455 | |
| 456 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_DESCRIPTION ("package:description") ==== |
| 457 | - '''Type:''' string |
| 458 | - '''Value:''' Long description of the package. |
| 459 | - '''Allowed Values:''' Any string (may contain multiple lines). |
| 460 | - '''Child Attributes:''' none |
| 461 | |
| 462 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_VENDOR ("package:vendor") ==== |
| 463 | - '''Type:''' string |
| 464 | - '''Value:''' Name of the person/organization that is publishing this package. |
| 465 | - '''Allowed Values:''' Any single-lined string. |
| 466 | - '''Child Attributes:''' none |
| 467 | |
| 468 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_PACKAGER ("package:packager") ==== |
| 469 | - '''Type:''' string |
| 470 | - '''Value:''' E-Mail of person that created this package. |
| 471 | - '''Allowed Values:''' Any single-lined string, but e-mail preferred. |
| 472 | - '''Child Attributes:''' none |
| 473 | |
| 474 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_FLAGS ("package:flags") ==== |
| 475 | - '''Type:''' uint |
| 476 | - '''Value:''' Set of boolean flags applying to package. |
| 477 | - '''Allowed Values:''' Any combination of the following. |
| 478 | |
| 479 | ||1||B_PACKAGE_FLAG_APPROVE_LICENSE||this package's license requires approval (i.e. must be shown to and acknowledged by user before installation)|| |
| 480 | ||2||B_PACKAGE_FLAG_SYSTEM_PACKAGE||this is a system package (i.e. lives under /boot/system)|| |
| 481 | - '''Default Value:''' 0. |
| 482 | - '''Child Attributes:''' none |
| 483 | |
| 484 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_ARCHITECTURE ("package:architecture") ==== |
| 485 | - '''Type:''' uint |
| 486 | - '''Value:''' System architecture this package was built for. |
| 487 | - '''Allowed Values:''' |
| 488 | |
| 489 | ||0||B_PACKAGE_ARCHITECTURE_ANY||this package doesn't depend on the system architecture|| |
| 490 | ||1||B_PACKAGE_ARCHITECTURE_X86||x86, 32-bit, built with gcc4|| |
| 491 | ||2||B_PACKAGE_ARCHITECTURE_X86_GCC2||x86, 32-bit, built with gcc2|| |
| 492 | - '''Child Attributes:''' none |
| 493 | |
| 494 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR ("package:version.major") ==== |
| 495 | - '''Type:''' string |
| 496 | - '''Value:''' Major (first) part of package version. |
| 497 | - '''Allowed Values:''' Any single-lined string, composed of <alphanum_underline> |
| 498 | - '''Child Attributes:''' |
| 499 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MINOR: The minor part of the package version. |
| 500 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MICRO: The micro part of the package version. |
| 501 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_RELEASE: The release part of the package version. |
| 502 | |
| 503 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MINOR ("package:version.minor") ==== |
| 504 | - '''Type:''' string |
| 505 | - '''Value:''' Minor (second) part of package version. |
| 506 | - '''Allowed Values:''' Any single-lined string, composed of <alphanum_underline> |
| 507 | - '''Child Attributes:''' none |
| 508 | |
| 509 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MICRO ("package:version.micro") ==== |
| 510 | - '''Type:''' string |
| 511 | - '''Value:''' Micro (third) part of package version. |
| 512 | - '''Allowed Values:''' Any single-lined string, composed of <alphanum_underline> |
| 513 | - '''Child Attributes:''' none |
| 514 | |
| 515 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_RELEASE ("package:version.release") ==== |
| 516 | - '''Type:''' string |
| 517 | - '''Value:''' Release (fourth) part of package version. |
| 518 | - '''Allowed Values:''' Any single-lined string, composed of <alphanum_underline> |
| 519 | - '''Child Attributes:''' none |
| 520 | |
| 521 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_COPYRIGHT ("package:copyright") ==== |
| 522 | - '''Type:''' string |
| 523 | - '''Value:''' Copyright applying to the software contained in this package. |
| 524 | - '''Allowed Values:''' Any (preferably single-lined) string. |
| 525 | - '''Child Attributes:''' none |
| 526 | |
| 527 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_LICENSE ("package:license") ==== |
| 528 | - '''Type:''' string |
| 529 | - '''Value:''' Name of license applying to the software contained in this package. |
| 530 | - '''Allowed Values:''' Any single-lined string. |
| 531 | - '''Child Attributes:''' none |
| 532 | |
| 533 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES ("package:provides") ==== |
| 534 | - '''Type:''' string |
| 535 | - '''Value:''' Name of a (optionally typed) entity that is being provided by this package. |
| 536 | - '''Allowed Values:''' Any string matching [ <alphanum-underline> ':' ] <alphanum_underline>. |
| 537 | - '''Child Attributes:''' none |
| 538 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_RESOLVABLE_TYPE: The resolvable type as int. |
| 539 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR: The major part of the resolvable version. |
| 540 | |
| 541 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_PROVIDES_TYPE ("package:provides.type") ==== |
| 542 | - '''Type:''' uint |
| 543 | - '''Value:''' Type of resolvable. |
| 544 | - '''Allowed Values:''' |
| 545 | |
| 546 | ||0||B_PACKAGE_RESOLVABLE_TYPE_DEFAULT||this resolvable isn't typed ()|| |
| 547 | ||1||B_PACKAGE_RESOLVABLE_TYPE_LIBRARY||this resolvable represents a library ('lib:')|| |
| 548 | ||2||B_PACKAGE_RESOLVABLE_TYPE_COMMAND||this resolvable represents a console command ('cmd:')|| |
| 549 | ||3||B_PACKAGE_RESOLVABLE_TYPE_APPLICATION||this resolvable represents an application ('app:')|| |
| 550 | ||4||B_PACKAGE_RESOLVABLE_TYPE_ADD_ON||this resolvable represents an add-on ('add-on:')|| |
| 551 | - '''Child Attributes:''' none |
| 552 | |
| 553 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_REQUIRES ("package:requires") ==== |
| 554 | - '''Type:''' string |
| 555 | - '''Value:''' Name of an entity that is required by this package (and hopefully being provided by another). |
| 556 | - '''Allowed Values:''' Any string matching [ <alphanum-underline> ':' ] <alphanum_underline>. |
| 557 | - '''Child Attributes:''' |
| 558 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_RESOLVABLE_OPERATOR: The resolvable operator as int. |
| 559 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR: The major part of the resolvable version. |
| 560 | |
| 561 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_SUPPLEMENTS ("package:supplements") ==== |
| 562 | - '''Type:''' string |
| 563 | - '''Value:''' Name of an entity that is supplemented by this package (i.e. this package will automatically be selected for installation if the supplemented resolvables are already installed). |
| 564 | - '''Allowed Values:''' Any string matching [ <alphanum-underline> ':' ] <alphanum_underline>. |
| 565 | - '''Child Attributes:''' |
| 566 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_RESOLVABLE_OPERATOR: The resolvable operator as int. |
| 567 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR: The major part of the resolvable version. |
| 568 | |
| 569 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_CONFLICTS ("package:conflicts") ==== |
| 570 | - '''Type:''' string |
| 571 | - '''Value:''' Name of an entity that this package conflicts with (i.e. only one of both can be installed at any time). |
| 572 | - '''Allowed Values:''' Any string matching [ <alphanum-underline> ':' ] <alphanum_underline>. |
| 573 | - '''Child Attributes:''' |
| 574 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_RESOLVABLE_OPERATOR: The resolvable operator as int. |
| 575 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR: The major part of the resolvable version. |
| 576 | |
| 577 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_FRESHENS ("package:freshens") ==== |
| 578 | - '''Type:''' string |
| 579 | - '''Value:''' Name of an entity that is being freshened by this package (i.e. this package will patch one or more files of the package that provide this resolvable). |
| 580 | - '''Allowed Values:''' Any string matching [ <alphanum-underline> ':' ] <alphanum_underline>. |
| 581 | - '''Child Attributes:''' |
| 582 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_RESOLVABLE_OPERATOR: The resolvable operator as int. |
| 583 | - B_HPKG_ATTRIBUTE_ID_PACKAGE_VERSION_MAJOR: The major part of the resolvable version. |
| 584 | |
| 585 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_REPLACES ("package:replaces") ==== |
| 586 | - '''Type:''' string |
| 587 | - '''Value:''' Name of an entity that is being replaced by this package (used if the name of a package changes, or if a package has been split). |
| 588 | - '''Allowed Values:''' Any string matching [ <alphanum-underline> ':' ] <alphanum_underline>. |
| 589 | - '''Child Attributes:''' none |
| 590 | |
| 591 | ==== B_HPKG_ATTRIBUTE_ID_PACKAGE_CHECKSUM ("package:checksum") ==== |
| 592 | - '''Type:''' string |
| 593 | - '''Value:''' SHA256-chechsum of this package, in hexdump format. N.B.: this attribute can only be found in package repository files, not in package files. |
| 594 | - '''Allowed Values:''' 64-bytes of hexdump. |
| 595 | - '''Child Attributes:''' none |
| 596 | |
| 597 | == Haiku Package Repository Format == |
| 598 | |
| 599 | Very similar to the package format, there's a Haiku Package Repository (HPKR) file format. Such a file contains informative attributes about the package repository and package attributes for all packages contained in the repository. However, this format does not contain any files. |
| 600 | |
| 601 | Two stacked format layers can be identified: |
| 602 | - A generic container format for structured data. |
| 603 | - A package format, extending the archive format with attributes for package management. |
| 604 | |
| 605 | |
| 606 | === The Data Container Format === |
| 607 | |
| 608 | A HPKR file consists of three sections: |
| 609 | Header:: |
| 610 | Identifies the file as HPKR file and provides access to the other sections. |
| 611 | Repository Info:: |
| 612 | A section containing an archived BMessage of a BRepositoryInfo object. |
| 613 | Package Attributes:: |
| 614 | A section just like the package attributes section of the HPKG, only that this section contains the package attributes of all the packages contained in the repository (not just one). |
| 615 | |
| 616 | |
| 617 | ==== Header ==== |
| 618 | |
| 619 | The header has the following structure: |
| 620 | |
| 621 | {{{ |
| 622 | struct hpkg_repo_header { |
| 623 | uint32 magic; |
| 624 | uint16 header_size; |
| 625 | uint16 version; |
| 626 | uint64 total_size; |
| 627 | |
| 628 | // repository info section |
| 629 | uint32 info_compression; |
| 630 | uint32 info_length_compressed; |
| 631 | uint32 info_length_uncompressed; |
| 632 | |
| 633 | // package attributes section |
| 634 | uint32 packages_compression; |
| 635 | uint64 packages_length_compressed; |
| 636 | uint64 packages_length_uncompressed; |
| 637 | uint64 packages_strings_length; |
| 638 | uint64 packages_strings_count; |
| 639 | }; |
| 640 | }}} |
| 641 | |
| 642 | magic:: |
| 643 | The string 'hpkr' (B_HPKG_REPO_MAGIC). |
| 644 | header_size:: |
| 645 | The size of the header. |
| 646 | version:: |
| 647 | The version of the HPKR format the file conforms to. The current version is |
| 648 | 1 (B_HPKG_REPO_VERSION). |
| 649 | total_size:: |
| 650 | The total file size. |
| 651 | |
| 652 | info_compression:: |
| 653 | The compression algorithm used for the repository info section. |
| 654 | info_length_compressed:: |
| 655 | The compressed size of the repository info section. Equals |
| 656 | info_length_uncompressed, if the section is not compressed. |
| 657 | info_length_uncompressed:: |
| 658 | The uncompressed size of the repository info section. |
| 659 | |
| 660 | packages_compression:: |
| 661 | The compression algorithm used for the package attributes section. |
| 662 | packages_length_compressed:: |
| 663 | The compressed size of the package attributes section. Equals |
| 664 | attributes_length_uncompressed, if the section is not compressed. |
| 665 | packages_length_uncompressed:: |
| 666 | The uncompressed size of the package attributes section. |
| 667 | packages_strings_length:: |
| 668 | The size of the strings subsection of the package attributes section. |
| 669 | packages_strings_count:: |
| 670 | The number of entries in the strings subsection of the package attributes section. |