Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

376 righe
16 KiB

support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
support for hex v2, multiple repository fetching, private organizations (#1884) * update to hex_core for hex-v2 repo support (#1865) * update to hex_core for hex-v2 repo support This patch adds only single repo hex-v2 support through hex_core. Packages no longer filtered out by buildtool metadata and the package index is updated per-package instead of fetched as one large ets dump. * tell travis to also build hex_core branch * support list of repos for hex packages (#1866) * support list of repos for hex packages repos are defined under the hex key in rebar configs. They can be defined at the top level of a project or globally, but not in profiles and the repos configured in dependencies are also ignored. Searching for packages involves first checking for a match in the local repo index cache, in the order repos are defined. If not found each repo is checked through the hex api for any known versions of the package and the first repo with a version that fits the constraint is used. * add {repos, replace, []} for overriding the global & default repos * add hex auth handling for repos (#1874) auth token are kept in a hex.config file that is modified by the rebar3 hex plugin. Repo names that have a : separating a parent and child are considered organizations. The parent repo's auth will be included with the child. So an organization named hexpm:rebar3_test will include any hexpm auth tokens found in the rebar3_test organization's configuration. * move packages to top level of of hexpm cache dir (#1876) * move packages to top level of of hexpm cache dir * append organization name to parent's repo_url when parsing repos * only eval config scripts and apply overrides once per app (#1879) * only eval config scripts and apply overrides once per app * move new resource behaviour to rebar_resource_v2 and keep v1 * cleanup use of rebar_resource module and unused functions * cleanup error messages and unused code * when discovering apps support mix packages as unbuilt apps (#1882) * use hex_core tarball unpacking support in pkg resource (#1883) * use hex_core tarball unpacking support in pkg resource * ignore etag if package doesn't exist and delete if checksum fails * add back tests for bad package checksums * improve bad registry checksum error message
6 anni fa
  1. %% Test suite for the handling hexpm repo configurations
  2. -module(rebar_pkg_repos_SUITE).
  3. -compile(export_all).
  4. -include_lib("common_test/include/ct.hrl").
  5. -include_lib("eunit/include/eunit.hrl").
  6. -include("rebar.hrl").
  7. all() ->
  8. [default_repo, repo_merging, repo_replacing,
  9. auth_merging, organization_merging, {group, resolve_version}].
  10. groups() ->
  11. [{resolve_version, [use_first_repo_match, use_exact_with_hash, fail_repo_update,
  12. ignore_match_in_excluded_repo, optional_prereleases]}].
  13. init_per_group(resolve_version, Config) ->
  14. Repo1 = <<"test-repo-1">>,
  15. Repo2 = <<"test-repo-2">>,
  16. Repo3 = <<"test-repo-3">>,
  17. Hexpm = <<"hexpm">>,
  18. Repos = [Repo1, Repo2, Repo3, Hexpm],
  19. Deps = [{"A", "0.1.1", <<"good checksum">>, Repo1, false},
  20. {"A", "0.1.1", <<"good checksum">>, Repo2, false},
  21. {"B", "1.0.0", Repo1, false},
  22. {"B", "2.0.0", Repo2, false},
  23. {"B", "1.4.0", Repo3, false},
  24. {"B", "1.4.3", Hexpm, false},
  25. {"B", "1.4.6", Hexpm, #{reason => 'RETIRED_INVALID'}},
  26. {"B", "1.5.0", Hexpm, false},
  27. {"B", "1.5.6-rc.0", Hexpm, true},
  28. {"C", "1.3.1", <<"bad checksum">>, Repo1, false},
  29. {"C", "1.3.1", <<"good checksum">>, Repo2, false}],
  30. [{deps, Deps}, {repos, Repos} | Config];
  31. init_per_group(_, Config) ->
  32. Config.
  33. end_per_group(_, _) ->
  34. ok.
  35. init_per_testcase(use_first_repo_match, Config) ->
  36. Deps = ?config(deps, Config),
  37. Repos = ?config(repos, Config),
  38. State = setup_deps_and_repos(Deps, Repos),
  39. meck:new(rebar_packages, [passthrough, no_link]),
  40. %% fail when the first repo is updated since it doesn't have a matching package
  41. %% should continue anyway
  42. meck:expect(rebar_packages, update_package,
  43. fun(_, _, _State) -> ok end),
  44. meck:expect(rebar_packages, verify_table,
  45. fun(_State) -> true end),
  46. [{state, State} | Config];
  47. init_per_testcase(use_exact_with_hash, Config) ->
  48. Deps = ?config(deps, Config),
  49. Repos = ?config(repos, Config),
  50. State = setup_deps_and_repos(Deps, Repos),
  51. meck:new(rebar_packages, [passthrough, no_link]),
  52. %% fail when the first repo is updated since it doesn't have a matching package
  53. %% should continue anyway
  54. meck:expect(rebar_packages, update_package,
  55. fun(_, _, _State) -> ok end),
  56. meck:expect(rebar_packages, verify_table,
  57. fun(_State) -> true end),
  58. [{state, State} | Config];
  59. init_per_testcase(fail_repo_update, Config) ->
  60. Deps = ?config(deps, Config),
  61. Repos = ?config(repos, Config),
  62. State = setup_deps_and_repos(Deps, Repos),
  63. meck:new(rebar_packages, [passthrough, no_link]),
  64. %% fail when the first repo is updated since it doesn't have a matching package
  65. %% should continue anyway
  66. [Repo1 | _] = Repos,
  67. meck:expect(rebar_packages, update_package,
  68. fun(_, #{name := Repo}, _State) when Repo =:= Repo1 -> fail;
  69. (_, _, _State) -> ok end),
  70. meck:expect(rebar_packages, verify_table,
  71. fun(_State) -> true end),
  72. [{state, State} | Config];
  73. init_per_testcase(ignore_match_in_excluded_repo, Config) ->
  74. Deps = ?config(deps, Config),
  75. Repos = [Repo1, _, Repo3 | _] = ?config(repos, Config),
  76. %% drop repo1 and repo2 from the repos to be used by the pkg resource
  77. State = setup_deps_and_repos(Deps, [R || R <- Repos, R =/= Repo3, R =/= Repo1]),
  78. meck:new(rebar_packages, [passthrough, no_link]),
  79. %% fail when the first repo is updated since it doesn't have a matching package
  80. %% should continue anyway
  81. [_, _, Repo3 | _] = Repos,
  82. meck:expect(rebar_packages, update_package,
  83. fun(_, _, _State) -> ok end),
  84. meck:expect(rebar_packages, verify_table,
  85. fun(_State) -> true end),
  86. [{state, State} | Config];
  87. init_per_testcase(optional_prereleases, Config) ->
  88. Deps = ?config(deps, Config),
  89. Repos = ?config(repos, Config),
  90. State = setup_deps_and_repos(Deps, Repos),
  91. meck:new(rebar_packages, [passthrough, no_link]),
  92. meck:expect(rebar_packages, update_package,
  93. fun(_, _, _State) -> ok end),
  94. meck:expect(rebar_packages, verify_table,
  95. fun(_State) -> true end),
  96. [{state, State} | Config];
  97. init_per_testcase(auth_merging, Config) ->
  98. meck:new(file, [passthrough, no_link, unstick]),
  99. meck:new(rebar_packages, [passthrough, no_link]),
  100. Config;
  101. init_per_testcase(organization_merging, Config) ->
  102. meck:new(file, [passthrough, no_link, unstick]),
  103. meck:new(rebar_packages, [passthrough, no_link]),
  104. Config;
  105. init_per_testcase(_, Config) ->
  106. Config.
  107. end_per_testcase(Case, _Config) when Case =:= auth_merging ;
  108. Case =:= organization_merging ->
  109. meck:unload(file),
  110. meck:unload(rebar_packages);
  111. end_per_testcase(Case, _Config) when Case =:= use_first_repo_match ;
  112. Case =:= use_exact_with_hash ;
  113. Case =:= fail_repo_update ;
  114. Case =:= ignore_match_in_excluded_repo ;
  115. Case =:= optional_prereleases ->
  116. meck:unload(rebar_packages);
  117. end_per_testcase(_, _) ->
  118. ok.
  119. default_repo(_Config) ->
  120. Repo1 = #{name => <<"hexpm">>,
  121. api_key => <<"asdf">>},
  122. MergedRepos = rebar_hex_repos:repos([{repos, [Repo1]}]),
  123. ?assertMatch([#{name := <<"hexpm">>,
  124. api_key := <<"asdf">>,
  125. api_url := <<"https://hex.pm/api">>}], MergedRepos).
  126. repo_merging(_Config) ->
  127. Repo1 = #{name => <<"repo-1">>,
  128. api_url => <<"repo-1/api">>},
  129. Repo2 = #{name => <<"repo-2">>,
  130. repo_url => <<"repo-2/repo">>,
  131. repo_verify => false},
  132. Result = rebar_hex_repos:merge_repos([Repo1, Repo2,
  133. #{name => <<"repo-2">>,
  134. api_url => <<"repo-2/api">>,
  135. repo_url => <<"bad url">>,
  136. repo_verify => true},
  137. #{name => <<"repo-1">>,
  138. api_url => <<"bad url">>,
  139. repo_verify => true},
  140. #{name => <<"repo-2">>,
  141. api_url => <<"repo-2/api-2">>,
  142. repo_url => <<"other/repo">>}]),
  143. ?assertMatch([#{name := <<"repo-1">>,
  144. api_url := <<"repo-1/api">>,
  145. repo_verify := true},
  146. #{name := <<"repo-2">>,
  147. api_url := <<"repo-2/api">>,
  148. repo_url := <<"repo-2/repo">>,
  149. repo_verify := false}], Result).
  150. repo_replacing(_Config) ->
  151. Repo1 = #{name => <<"repo-1">>,
  152. api_url => <<"repo-1/api">>},
  153. Repo2 = #{name => <<"repo-2">>,
  154. repo_url => <<"repo-2/repo">>,
  155. repo_verify => false},
  156. ?assertMatch([Repo1, Repo2, #{name := <<"hexpm">>}],
  157. rebar_hex_repos:repos([{repos, [Repo1]},
  158. {repos, [Repo2]}])),
  159. %% use of replace is ignored if found in later entries than the first
  160. ?assertMatch([Repo1, Repo2, #{name := <<"hexpm">>}],
  161. rebar_hex_repos:repos([{repos, [Repo1]},
  162. {repos, replace, [Repo2]}])),
  163. ?assertMatch([Repo1],
  164. rebar_hex_repos:repos([{repos, replace, [Repo1]},
  165. {repos, [Repo2]}])).
  166. auth_merging(_Config) ->
  167. Repo1 = #{name => <<"repo-1">>,
  168. api_url => <<"repo-1/api">>},
  169. Repo2 = #{name => <<"repo-2">>,
  170. repo_url => <<"repo-2/repo">>,
  171. repo_verify => false},
  172. State = rebar_state:new([{hex, [{repos, [Repo1, Repo2]}]}]),
  173. meck:expect(file, consult,
  174. fun(_) ->
  175. {ok, [#{<<"repo-1">> => #{read_key => <<"read key">>,
  176. write_key => <<"write key">>},
  177. <<"repo-2">> => #{read_key => <<"read key 2">>,
  178. repos_key => <<"repos key 2">>,
  179. write_key => <<"write key 2">>},
  180. <<"hexpm">> => #{write_key => <<"write key hexpm">>}}]}
  181. end),
  182. ?assertMatch({ok,
  183. #resource{state=#{repos := [#{name := <<"repo-1">>,
  184. read_key := <<"read key">>,
  185. write_key := <<"write key">>},
  186. #{name := <<"repo-2">>,
  187. read_key := <<"read key 2">>,
  188. repos_key := <<"repos key 2">>,
  189. write_key := <<"write key 2">>},
  190. #{name := <<"hexpm">>,
  191. write_key := <<"write key hexpm">>}]}}},
  192. rebar_pkg_resource:init(pkg, State)),
  193. ok.
  194. organization_merging(_Config) ->
  195. Repo1 = #{name => <<"hexpm:repo-1">>,
  196. api_url => <<"repo-1/api">>},
  197. Repo2 = #{name => <<"hexpm:repo-2">>,
  198. repo_url => <<"repo-2/repo">>,
  199. repo_verify => false},
  200. State = rebar_state:new([{hex, [{repos, [Repo1, Repo2]}]}]),
  201. meck:expect(file, consult,
  202. fun(_) ->
  203. {ok, [#{<<"hexpm:repo-1">> => #{read_key => <<"read key">>},
  204. <<"hexpm:repo-2">> => #{read_key => <<"read key 2">>,
  205. repos_key => <<"repos key 2">>,
  206. write_key => <<"write key 2">>},
  207. <<"hexpm">> => #{write_key => <<"write key hexpm">>}}]}
  208. end),
  209. ?assertMatch({ok,
  210. #resource{state=#{repos := [#{name := <<"hexpm:repo-1">>,
  211. parent := <<"hexpm">>,
  212. read_key := <<"read key">>,
  213. write_key := <<"write key hexpm">>},
  214. #{name := <<"hexpm:repo-2">>,
  215. parent := <<"hexpm">>,
  216. read_key := <<"read key 2">>,
  217. repos_key := <<"repos key 2">>,
  218. write_key := <<"write key 2">>},
  219. #{name := <<"hexpm">>,
  220. write_key := <<"write key hexpm">>}]}}},
  221. rebar_pkg_resource:init(pkg, State)),
  222. ok.
  223. use_first_repo_match(Config) ->
  224. State = ?config(state, Config),
  225. ?assertMatch({ok,{package,{<<"B">>, {{2,0,0}, {[],[]}}, Repo2},
  226. <<"some checksum">>, false, []},
  227. #{name := Repo2,
  228. http_adapter_config := #{profile := rebar}}},
  229. rebar_packages:resolve_version(<<"B">>, <<"> 1.4.0">>, undefined,
  230. ?PACKAGE_TABLE, State)),
  231. ?assertMatch({ok,{package,{<<"B">>, {{1,4,0}, {[],[]}}, Repo3},
  232. <<"some checksum">>, false, []},
  233. #{name := Repo3,
  234. http_adapter_config := #{profile := rebar}}},
  235. rebar_packages:resolve_version(<<"B">>, <<"~> 1.4.0">>, undefined,
  236. ?PACKAGE_TABLE, State)).
  237. %% tests that even though an easier repo has C-1.3.1 it doesn't use it since its hash is different
  238. use_exact_with_hash(Config) ->
  239. State = ?config(state, Config),
  240. ?assertMatch({ok,{package,{<<"C">>, {{1,3,1}, {[],[]}}, Repo2},
  241. <<"good checksum">>, false, []},
  242. #{name := Repo2,
  243. http_adapter_config := #{profile := rebar}}},
  244. rebar_packages:resolve_version(<<"C">>, <<"1.3.1">>, <<"good checksum">>,
  245. ?PACKAGE_TABLE, State)).
  246. fail_repo_update(Config) ->
  247. State = ?config(state, Config),
  248. ?assertMatch({ok,{package,{<<"B">>, {{1,4,0}, {[],[]}}, Repo3},
  249. <<"some checksum">>, false, []},
  250. #{name := Repo3,
  251. http_adapter_config := #{profile := rebar}}},
  252. rebar_packages:resolve_version(<<"B">>, <<"~> 1.4.0">>, undefined,
  253. ?PACKAGE_TABLE, State)).
  254. ignore_match_in_excluded_repo(Config) ->
  255. State = ?config(state, Config),
  256. Repos = ?config(repos, Config),
  257. ?assertMatch({ok,{package,{<<"B">>, {{1,4,6}, {[],[]}}, Hexpm},
  258. <<"some checksum">>, #{reason := 'RETIRED_INVALID'}, []},
  259. #{name := Hexpm,
  260. http_adapter_config := #{profile := rebar}}},
  261. rebar_packages:resolve_version(<<"B">>, <<"~> 1.4.0">>, undefined,
  262. ?PACKAGE_TABLE, State)),
  263. [_, Repo2 | _] = Repos,
  264. ?assertMatch({ok,{package,{<<"A">>, {{0,1,1}, {[],[]}}, Repo2},
  265. <<"good checksum">>, false, []},
  266. #{name := Repo2,
  267. http_adapter_config := #{profile := rebar}}},
  268. rebar_packages:resolve_version(<<"A">>, <<"0.1.1">>, <<"good checksum">>,
  269. ?PACKAGE_TABLE, State)).
  270. optional_prereleases(Config) ->
  271. State = ?config(state, Config),
  272. ?assertMatch({ok,{package,{<<"B">>, {{1,5,0}, {[],[]}}, Hexpm},
  273. <<"some checksum">>, false, []},
  274. #{name := Hexpm,
  275. http_adapter_config := #{profile := rebar}}},
  276. rebar_packages:resolve_version(<<"B">>, <<"~> 1.5.0">>, undefined,
  277. ?PACKAGE_TABLE, State)),
  278. ?assertMatch({ok,{package,{<<"B">>, {{1,5,6}, {[<<"rc">>,0],[]}}, Hexpm},
  279. <<"some checksum">>, true, []},
  280. #{name := Hexpm,
  281. http_adapter_config := #{profile := rebar}}},
  282. rebar_packages:resolve_version(<<"B">>, <<"1.5.6-rc.0">>, <<"some checksum">>,
  283. ?PACKAGE_TABLE, State)),
  284. %% allow prerelease through configuration
  285. State1 = rebar_state:set(State, deps_allow_prerelease, true),
  286. ?assertMatch({ok,{package,{<<"B">>, {{1,5,6}, {[<<"rc">>,0],[]}}, Hexpm},
  287. <<"some checksum">>, true, []},
  288. #{name := Hexpm,
  289. http_adapter_config := #{profile := rebar}}},
  290. rebar_packages:resolve_version(<<"B">>, <<"~> 1.5.0">>, <<"some checksum">>,
  291. ?PACKAGE_TABLE, State1)).
  292. %%
  293. setup_deps_and_repos(Deps, Repos) ->
  294. catch ets:delete(?PACKAGE_TABLE),
  295. true = rebar_packages:new_package_table(),
  296. insert_deps(Deps),
  297. State = rebar_state:new([{hex, [{repos, [#{name => R} || R <- Repos]}]}]),
  298. rebar_state:create_resources([{pkg, rebar_pkg_resource}], State).
  299. insert_deps(Deps) ->
  300. lists:foreach(fun({Name, Version, Repo, Retired}) ->
  301. ets:insert(?PACKAGE_TABLE, #package{key={rebar_utils:to_binary(Name),
  302. ec_semver:parse(Version),
  303. rebar_utils:to_binary(Repo)},
  304. dependencies=[],
  305. retired=Retired,
  306. checksum = <<"some checksum">>});
  307. ({Name, Version, Checksum, Repo, Retired}) ->
  308. ets:insert(?PACKAGE_TABLE, #package{key={rebar_utils:to_binary(Name),
  309. ec_semver:parse(Version),
  310. rebar_utils:to_binary(Repo)},
  311. dependencies=[],
  312. retired=Retired,
  313. checksum = Checksum})
  314. end, Deps).