summaryrefslogtreecommitdiff
path: root/src/rebar_pkg_resource.erl
Commit message (Collapse)AuthorAgeFilesLines
* Fix fetching of private packages from orgs on hex repos (#2020)Bryan Paxton2019-03-071-3/+3
| | | | | | | | | | | | | - vendor in hex_core at v0.5.0 - Change where repo_name should be the org and not the parent - Changed rebar_utils:url_append_path/2 to not explicitly add a '?', this is returned in the Query chunk by http_uri:parse/1 (e.g., "?foo=bar") - update organization_merging test to expect the sub-repo as the repo_name - Add tests for rebar_utils:url_append_path/2 - Stop referencing/setting "organization" in config and use new organization settings (api_repository and repo_organization) - Do not set (assume) the read key is valid for any/every repo - Set repo_organization and api_repository to org - Update tests to check for new config opts
* fix resolving versions from vcs (#1915)Tristan Sloughter2018-10-141-1/+1
| | | | | | app_info was turning any vsn into a binary which the vcs_vsn function interprets as being an actual version and not something like <<"git">>. original_vsn shouldn't be converted as it is then not longer "original".
* support for hex v2, multiple repository fetching, private organizations (#1884)Tristan Sloughter2018-09-131-288/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Merge branch '1743_specs' of https://github.com/tothlac/rebar3 into ↵Fred Hebert2018-04-201-64/+250
|\ | | | | | | tothlac-1743_specs
| * (#1743): Refactor rebar_pkg_resource, add documentationLaszlo Toth2018-04-121-81/+152
| |
| * (#1743): Add specs for dialyzerLaszlo Toth2018-04-111-3/+118
| |
* | Do not die on a pkg etag cache write failFred Hebert2018-04-201-1/+1
|/ | | | We can probably still move ahead without a cache if we must
* (#1743): store the etags in cache filesLaszlo Toth2018-04-111-10/+26
|
* (#1741): Fix quotes in etag valuestothlac2018-04-091-1/+2
|
* OTP-21 readiness, Full Unicode supportFred Hebert2017-11-161-4/+4
| | | | | | | | | | | | This replaces all deprecated function usage by alternative ones based on a version switch enacted at compile time, preventing all warnings. This will likely introduce some possible runtime errors in using a Rebar3 compiled on OTP-20 or OTP-21 back in versions 19 and earlier, but we can't really work around that. A bunch of dependencies have been updated to support OTP-21 without warnings as well.
* Unicode support in all the placesFred Hebert2017-08-061-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is done through 3 main change groups: - replacing `~s` by `~ts` in format strings, so that strings that contain unicode are properly printed rather than crashing - adding the `unicode` argument to all function of the `re` module to ensure transformations on strings containing unicode data are valid instead of crashing (see issue #1302) - replacing `ec_cnv:to_binary/1` and `ec_cnv:to_list/1` with matching functions in `rebar_utils`. The last point has been done, rather than modifying and updating erlware commons, because binary and list conversions can be a contentious subject. For example, if what is being handled is actually bytes from a given binary stream, then forcing a byte-oriented interpretation of the data can corrupt it. As such, it does not appear safe to modify erlware commons' conversion functions since it may not be safe for all its users. Instead, rebar3 reimplements a subset of them (only converting atoms and chardata, ignoring numbers) with the explicit purpose of handling unicode string data. Tests were left as unchanged as possible. This may impact the ability to run rebar3's own suites in a unicode path, but respects a principle of least change for such a large patch.
* Merge pull request #1391 from ferd/doc-and-typesFred Hebert2016-12-231-0/+6
|\ | | | | Type specifications and edocs improvements
| * Type specifications and edocs improvementsFred Hebert2016-11-271-0/+6
| | | | | | | | | | | | Includes improvments and function documentation for all modules (in alphabetical order) up to rebar_core, and may have included more in other modules as I saw fit to dig and understand more of the internals.
* | 1394: added fix for rebar_utils, moved setting of http_options into ↵Artem Pervin2016-11-301-1/+3
|/ | | | init_config, added unit tests
* Validate checksums expected vs obtainedFred Hebert2016-05-241-7/+10
|
* Support package hashes in structure and lockfileFred Hebert2016-05-241-3/+3
| | | | | | | | | - the internal representation for package locks moves from `{Name, {pkg, PkgName, Vsn}, Lvl}` to `{Name, {pkg, PkgName, Vsn, Hash}, Lvl}` - the internal representation for packages moves from `{pkg, PkgName, Vsn}` to `{pkg, PkgName, Vsn, Hash}` - the hash can be `undefined`, meaning no check will be done - no checking is done yet.
* add user-agent to http request headersTristan Sloughter2016-02-011-1/+1
|
* support temporary cdn change with HEX_CDN os varTristan Sloughter2015-12-191-3/+7
|
* Merge pull request #847 from zugolosian/disable_ssl_verify_optionTristan Sloughter2015-09-301-0/+18
|\ | | | | Add support for disabling ssl verification for hex
| * Add support for disabling ssl verification for hexDavid Leach2015-09-301-0/+18
| | | | | | | | | | Uses global rebar config to see if user wishes to disable ssl verfication. If {ssl_verify, false} is present certificates will not be verified.
* | uses erlang-certifiBenoit Chesneau2015-09-181-6/+2
| |
* | Fix parsing of version #'s of dependenciesJess Balint2015-09-171-1/+1
|/ | | | | Version #'s with patch info like "1.1.1-x" would cause an error. Now tokenize the version string with "." AND "-".
* check checksum of rebar3 download in local_upgrade providerTristan Sloughter2015-09-101-0/+1
|
* add providers 'local upgrade' and 'local install' for installing/upgradingTristan Sloughter2015-09-071-1/+2
|
* Displays package caching actionsFred Hebert2015-08-311-1/+3
| | | | | | | | | | | | | | | | | | This makes it obvious where packages are cached and when the cache is being reused. Messages are of the form: ===> Fetching recon ({pkg,<<"recon">>,<<"2.2.0">>}) ===> Downloaded package, caching as $HOME/.cache/rebar3/hex/default/packages/recon-2.2.0.tar and ===> Fetching recon ({pkg,<<"recon">>,<<"2.2.0">>}) ===> Version cached at $HOME/.cache/rebar3/hex/default/packages/recon-2.2.0.tar is up to date, reusing it
* use 'default' for default hex repo path in cache and include in info messagesTristan Sloughter2015-08-221-2/+2
|
* fix ssl_opts list in httpc request to not be doubel listTristan Sloughter2015-07-191-1/+1
|
* add ssl_opts/1 to rebar_api so rebar3 hex plugin can use itTristan Sloughter2015-07-181-0/+2
|
* add ssl cert validation, unless OTP version is too oldTristan Sloughter2015-07-181-1/+61
|
* Added rebar profile to httpc initialization and calls.CarlosEDP2015-07-031-1/+2
|
* No need to use profile hex. Proxy settings are applied globally.CarlosEDP2015-07-031-2/+1
|
* setup hex httpc profile and http opts. needed also for proxyTristan Sloughter2015-06-291-1/+2
|
* Proper custom pkg index support, some testsFred Hebert2015-05-131-18/+8
| | | | | | | | | | - The rebar package index files have been moved off the default path and will require a new `rebar3 update` - Caching of downloaded packages automatically takes place in a path relative to the CDN used - The cache path is not shared with hex as we now write and modify data in there arbitrarily - Basic tests plus the working set for more of them is included
* add bad_download errorTristan Sloughter2015-05-121-1/+1
|
* wrap fetch errors in rebar_fetch PRV_ERRORTristan Sloughter2015-05-121-6/+5
|
* Ad-hoc attempt at restructuring pkg cacheFred Hebert2015-05-121-24/+55
|
* check md5sum of package against that sent by s3Tristan Sloughter2015-05-121-4/+13
|
* store hex package downloads in shared cache dirTristan Sloughter2015-05-121-6/+64
|
* Add tests and fixes for packages upgradesFred Hebert2015-02-231-1/+1
| | | | | | | | | | - Track level of packages properly, they're not level 0 anymore (this could yield an issue where a src dep takes precedence over a pkg dep) - Proper stable sort of vertices in the digraph module - PkgDeps no longer 'see themselves' when fetching and upgrading after locking themselves - Pkg Locks are added to pkg deps rather than source deps - Updating test cases to support pkg mocking on top of src mocking
* replace package management with hex.pmTristan Sloughter2015-02-171-3/+5
|
* add make_vsn to rebar_resource for replacing app vsnsTristan Sloughter2014-11-031-1/+5
|
* add pkg resourceTristan Sloughter2014-11-021-0/+28