Skip to content

(#16752) Add support for pkg.conf on openbsd#1297

Closed
ahpook wants to merge 1 commit intopuppetlabs:masterfrom
ahpook:16752-openbsd-pkgconf
Closed

(#16752) Add support for pkg.conf on openbsd#1297
ahpook wants to merge 1 commit intopuppetlabs:masterfrom
ahpook:16752-openbsd-pkgconf

Conversation

@ahpook
Copy link
Contributor

@ahpook ahpook commented Nov 28, 2012

Previously only local file sources were supported for openbsd
packages. Pkg.conf is a mechanism that openbsd uses to download
packages from HTTP sources as well. This patch adds checking for
the presence of 'installpath' lines in pkg.conf and, if one
are found and if the last character of an installpath line is a
::File::SEPARATOR (aka / character on openbsd) then it will
become the value of the environment variable PKG_PATH previous to
pkgadd invocation, which tells pkgadd to use the URL.

Previously only local file sources were supported for openbsd
packages. Pkg.conf is a mechanism that openbsd uses to download
packages from HTTP sources as well. This patch adds checking for
the presence of 'installpath' lines in pkg.conf and, if one
are found and if the last character of an installpath line is a
::File::SEPARATOR (aka `/` character on openbsd) then it will
become the value of the environment variable PKG_PATH previous to
pkgadd invocation, which tells pkgadd to use the URL.
@ahpook
Copy link
Contributor Author

ahpook commented Nov 28, 2012

I know I need help with tests for this behaviour change, I found it difficult to understand just from looking at the existing spec/unit/provider/package/openbsd_spec.rb how to:

  • fake the contents of a pkg.conf in order to exercise this code path
  • add to or modify the existing tests to ensure both success and failure were validated

Would appreciate any guidance on these and I'd be happy to amend the commit with further info; it's just been sitting in my local repo for a while and I wanted to publish and solicit help. Thank you!!

@jasperla
Copy link
Contributor

Regarding the first test item, you could create a pkg.conf with a line that points to a non-existing mirror, or a mirror which lacks the packages. For example:

installpath = scp://somerandomhostthatdoesntexist.com/pub/OpenBSD/snapshots/packages/amd64/
installpath = ftp://ftp.fr.openbsd.org/pub/OpenBSD/snapshots/packages/somenonexistingarch/

@joshcooper
Copy link
Contributor

Superceded by #1379

@joshcooper joshcooper closed this Jan 8, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants