⛏️ index : haiku.git

author Adrien Destugues <pulkomandy@pulkomandy.tk> 2020-05-01 14:48:02.0 +02:00:00
committer Alex von Gluck IV <kallisti5@unixzen.com> 2021-06-21 21:32:13.0 +00:00:00
commit
aa929f9bbc6dfc2c3aa2c0a4e8b9bfe747ba0dde [patch]
tree
6bd30a5e7bc0c4688e364722f4f8d6ffad4a4956
parent
c2067874aa4cf95a97e98e6d388b4910b047754d
download
aa929f9bbc6dfc2c3aa2c0a4e8b9bfe747ba0dde.tar.gz

Use a tag: identifier for haiku and haikuports repositories

This resolves the confusion about the "url" field in repository
definition files. However it changes the identifier of repositories. It
seems to be a good idea to do this with a new release, as users will
need to switch to new repos anyway and can accept special instructions
at that time (we will include the instructions in the release notes).

The new format uses a tag: uri as specified in https://tools.ietf.org/html/rfc4151

The rationale for this is:
- We need a way to uniquely identify repositories
- We want anyone to be able to create a repository easily, with no
  central registration, and in a way that does not results in accidental
  conflicts. We do not want to be running a registry to grant people an
  identifier for their repository.
- Backwards compatibility with existing repositories and software should be
  preserved: some code and file formats in Haiku package tools expect or
  expected the identifier to be parsable as a BUrl. Existing 3rd-party
  repositories use an http or https URL as an identifier and may
  continue to do so (changing the identifier of existing repositories is
  not desirable)
- Forwards compatibility if we want to change this again later
- Optional: repository identifiers should be user readable.

The tag: URI resolves this in the following way:
- Backwards compatibility: it is still an URI, as the identifier
  previously was.
- Forward compatibility: We can change to another URI scheme if we want to.
  In fact, each repository can decide what type of URI they want to use,
  "tag" is only a recommendation and put in use for the repos we
  provide.
- Uniqueness + no centralization: the tag: URI specifies namespaces tied
  to a domain name (which is already needed to host a repository) and a
  date at which the domain is owned by the entity generating a tag. Inside
  that namespace, they can do as they wish.
- User readability: the format is simple and text-based.

Other possible alternatives are:
- keeping the current solution of using http URLs. It has proven
  confusing because the repository hosting may be moved or mirrored
  while preserving the identifier. There is also work in progress to
  distribute packages using other protocols (eg. IPFS).
- Using an uuid. This provides unique, decentralized identifiers, but
  is not user-readable. Backwards compatibility can be provided by
  wrapping the uuid into an "urn:uuid:" URI (see
  https://www.itu.int/en/ITU-T/asn1/Pages/UUID/uuids.aspx).
- Using some other URI scheme such as "urn:oid:". I investigated some, but
  found none that provide a decentralized namespacing solution (except
  for "tag", of course).
- Using a custom URI scheme of our own. This would normally require declaring
  it to the IANA (example: https://www.iana.org/assignments/uri-schemes/prov/apt
  for Debian packages) in order to not make the internet more of a mess
  than it already is. We would still need to define a way to generate
  URIs that protects people from getting accidental conflicts. The
  solution would probably be similar to what the "tag" URI scheme does, as
  there doesn't seem to be many other ways to guarantee uniqueness in
  (cyber)space and time without registration.
- Not using an URI scheme: in addition to the problems of a custom URI
  scheme, this would break backwards compatibility (existing software
  would not accept the new format) and forwards compatibility (without a
  scheme in the identifier, it is hard to detect what it is supposed to
  be if we change formats later on)

Change-Id: Ibc577d26827cb6ca18c787ba969f72bdff5cb572
Reviewed-on: https://review.haiku-os.org/c/haiku/+/3684
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>

Diff

 src/data/repository_infos/haiku      | 2 +-
 src/data/repository_infos/haikuports | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/data/repository_infos/haiku b/src/data/repository_infos/haiku
index 8019700..39c22df 100644
--- a/src/data/repository_infos/haiku
+++ b/src/data/repository_infos/haiku
@@ -1,7 +1,7 @@
name Haiku
vendor "Haiku Project"
summary "The Haiku repository (for Haiku %HAIKU_VERSION_NO_REVISION%)"
priority 1
baseurl https://eu.hpkg.haiku-os.org/haiku/r1beta3/%HAIKU_PACKAGING_ARCH%/current
identifier https://hpkg.haiku-os.org/haiku/r1beta3/%HAIKU_PACKAGING_ARCH%/current
identifier tag:haiku-os.org,2001:repositories/haiku/r1beta3/%HAIKU_PACKAGING_ARCH%
architecture %HAIKU_PACKAGING_ARCH%
diff --git a/src/data/repository_infos/haikuports b/src/data/repository_infos/haikuports
index 86935e9..9b5e70e 100644
--- a/src/data/repository_infos/haikuports
+++ b/src/data/repository_infos/haikuports
@@ -1,7 +1,7 @@
name HaikuPorts
vendor "Haiku Project"
summary "The HaikuPorts repository (for Haiku %HAIKU_VERSION_NO_REVISION%)"
priority 1
baseurl https://eu.hpkg.haiku-os.org/haikuports/master/%HAIKU_PACKAGING_ARCH%/current
identifier https://hpkg.haiku-os.org/haikuports/master/%HAIKU_PACKAGING_ARCH%/current
identifier tag:haikuports.org,2013:repositories/haikuports/master/%HAIKU_PACKAGING_ARCH%
architecture %HAIKU_PACKAGING_ARCH%