diff --git a/cdist/conf/type/__package_pkg_openbsd/gencode-remote b/cdist/conf/type/__package_pkg_openbsd/gencode-remote index 1df87997..9d760655 100755 --- a/cdist/conf/type/__package_pkg_openbsd/gencode-remote +++ b/cdist/conf/type/__package_pkg_openbsd/gencode-remote @@ -50,8 +50,11 @@ fi pkg_version="$(cat "$__object/explorer/pkg_version")" -# TODO: Shouldn't be hardcoded -echo export PKG_PATH=ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$machine/ +if [ -f "$__object/parameter/pkg_path" ]; then + pkg_path="$(cat "$__object/parameter/pkg_path")" +else + pkg_path="ftp://ftp.openbsd.org/pub/OpenBSD/$os_version/packages/$machine/" +fi if [ "$pkg_version" ]; then state_is="present" @@ -65,6 +68,7 @@ case "$state_should" in present) # use this because pkg_add doesn't properly handle errors cat << eof +export PKG_PATH="$pkg_path" status=\$(pkg_add "$pkgopts" "$name--$flavor") # no error diff --git a/cdist/conf/type/__package_pkg_openbsd/parameter/optional b/cdist/conf/type/__package_pkg_openbsd/parameter/optional index 77fd22b3..43278d16 100644 --- a/cdist/conf/type/__package_pkg_openbsd/parameter/optional +++ b/cdist/conf/type/__package_pkg_openbsd/parameter/optional @@ -1,3 +1,4 @@ name flavor state +pkg_path