You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

125 lines
3.5 KiB

  1. .Dd November 18, 2014
  2. .Dt PKG_REPOS 3
  3. .Os
  4. .Sh NAME
  5. .Nm pkg_repos , pkg_repos_total_count , pkg_repos_activated_count
  6. .Nm pkg_repo_url , pkg_repo_ident , pkg_repo_name , pkg_repo_ident_from_name
  7. .Nm pkg_repo_key , pkg_repo_fingerprints
  8. .Nm pkg_repo_signature_type , pkg_repo_mirror_type , pkg_repo_enabled
  9. .Nm pkg_repo_find_ident , pkg_repo_find_name
  10. .Nd manipulate repositories
  11. .Sh LIBRARY
  12. .Lb libpkg
  13. .Sh SYNOPSIS
  14. .In pkg.h
  15. .Ft int
  16. .Fn pkg_repos "struct pkg_repo **r"
  17. .Ft int
  18. .Fn pkg_repos_total_count "void"
  19. .Ft int
  20. .Fn pkg_repos_activated_count "void"
  21. .Ft const char *
  22. .Fn pkg_repos_url "struct pkg_repo *"
  23. .Ft const char *
  24. .Fn pkg_repo_ident "struct pkg_repo *"
  25. .Ft const char *
  26. .Fn pkg_repo_name "struct pkg_repo *"
  27. .Ft const char *
  28. .Fn pkg_repo_ident_from_name "const char *"
  29. .Ft const char *
  30. .Fn pkg_repo_key "struct pkg_repo *"
  31. .Ft const char *
  32. .Fn pkg_repo_fingerprints "struct pkg_repo *"
  33. .Ft signature_t
  34. .Fn pkg_repo_signature_type "struct pkg_repo *"
  35. .Ft bool
  36. .Fn pkg_repo_enabled "struct pkg_repo *"
  37. .Ft mirror_t
  38. .Fn pkg_repo_mirror_type "struct pkg_repo *"
  39. .Ft struct pkg_repo *
  40. .Fn pkg_repo_find_ident "const char *ident";
  41. .Ft struct pkg_repo *
  42. .Fn pkg_repo_find_name "const char *name";
  43. .Sh DESCRIPTION
  44. .Fn pkg_repos
  45. Takes the address of a pointer to the repository.
  46. The pointer should be initialised to NULL before being passed to the
  47. function, on each iteration the r will point to the new repository.
  48. Returns EPKG_FATAL if an error occurred, otherwise return EPKG_OK until
  49. the last repository is found in that case EPKG_END is returned.
  50. .Pp
  51. .Fn pkg_repos_total_count
  52. returns the total number of defined repositories.
  53. .Pp
  54. .Fn pkg_repos_activated_count
  55. returns the total number of
  56. .Qq enabled
  57. repositories.
  58. .Pp
  59. .Fn pkg_repo_url
  60. takes a pointer to a repository as argument and returns the
  61. .Qq url
  62. defined for this repository.
  63. .Pp
  64. .Fn pkg_repo_ident
  65. takes a pointer to a repository as argument and returns the internal
  66. identification string of the repository.
  67. .Pp
  68. .Fn pkg_repo_name
  69. takes a pointer to a repository as argument and returns the
  70. .Qq name
  71. of the repository.
  72. .Pp
  73. .Fn pkg_repo_key
  74. takes a pointer to a repository as argument and returns the path to
  75. the public key.
  76. If the repository is not signed by a public key, NULL will be returned.
  77. .Pp
  78. .Fn pkg_repo_fingerprints
  79. takes a pointer to a repository as argument and returns the path to
  80. the fingerprints. If the repository is not signed using the
  81. .Qq FINGERPRINT
  82. method, NULL will be returned.
  83. .Pp
  84. .Fn pkg_repo_signature_type
  85. Take a pointer to a repository as argument and return the type of
  86. signature it uses.
  87. .Bl -tag -width SIG_FINGERPRINT
  88. .It Cm SIG_NONE
  89. The repository is not signed
  90. .It Cm SIG_PUBKEY
  91. The repository is signed using the PUBKEY method
  92. .It Cm SIG_FINGERPRINT
  93. The repository is signed using the FINGERPRINT method
  94. .El
  95. .Pp
  96. .Fn pkg_repo_enabled
  97. takes a pointer to a repository as argument and returns
  98. .Cm true
  99. if the repository is
  100. .Qq enabled .
  101. Otherwise, return
  102. .Cm false .
  103. .Pp
  104. .Fn pkg_repo_mirror_type
  105. takes a pointer to a repository as argument and returns the type of
  106. mirroring it uses.
  107. .Bl -tag -width NOMIRROR
  108. .It Cm SRV
  109. The repository is using SRV record query to get the mirrors.
  110. .It Cm HTTP
  111. The repository is using the HTTP query method to get the mirrors.
  112. .It Cm NOMIRROR
  113. The repository does not have any mirror.
  114. .El
  115. .Pp
  116. .Fn pkg_repo_find_ident
  117. Take an internal indentification string as argument and return a pointer to
  118. a repository. If no repository matches, NULL is returned.
  119. .Pp
  120. .Fn pkg_repo_find_name
  121. Take a repository
  122. .Qq name
  123. as argument and return a pointer to a repository. If no repository matches,
  124. NULL is returned.