summaryrefslogtreecommitdiff
path: root/src/rebar_prv_update.erl
Commit message (Collapse)AuthorAgeFilesLines
* support for hex v2, multiple repository fetching, private organizations (#1884)Tristan Sloughter2018-09-131-225/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* Work around OTP-21 deprecation of get_stacktrace()Fred Hebert2018-05-031-2/+2
| | | | Based off a macro by @okeuday at https://github.com/erlang/otp/pull/1783
* use debug level for logs about bad package versioningTristan Sloughter2018-02-271-7/+7
|
* don't attempt retry of missing packages when updating indexTristan Sloughter2018-02-271-1/+1
|
* added http option {relaxed, true} when fetching registryAndrey Kanyuka2017-11-051-1/+1
|
* fixed handling of proxy username and password when fetching registryAndrey Kanyuka2017-11-031-1/+2
|
* Unicode support in all the placesFred Hebert2017-08-061-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Fix printing path with unicode names in prv_updateFred Hebert2017-02-031-2/+2
|
* Fix rebar3 dialyzer warningsFred Hebert2016-11-191-1/+1
| | | | Some tricky changes in there but should be okay
* Track package hash in memory index, add hash testFred Hebert2016-10-041-1/+17
| | | | | | | | | | This adds tracking of package hash in the in-memory index rather than the current `undefined' values. According to the test added, this is not necessary for transitive package dep hash chcking, but does result in a more complete index search result when doing app lookups, and could yield some optimizations on hash checks by checking from the index structure before fetching a package.
* Properly support package aliasing and alt namesFred Hebert2016-09-271-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aliasing only had a bit of ad-hoc support in rebar3, and various issues have encountered problems related to the package names not mapping properly with the application name. One such issue is https://github.com/erlang/rebar3/issues/1290 The problem has been hard to find because it only impacts transitive dependencies (not top-level ones) of other packages. The root cause for this is that the application name was not being tracked by rebar3's internal index, only the package name and its version were. When a given application was a package app, the data for the application name would be reconstructed from the lock file, but only if it were a top-level app or a dependency of a source application where parsing the lock file is necessary to know what comes next. When a transitive dependency of a package dependency was fetched, we instead read its dependencies directly from the in-memory package index within rebar3. This caused us to only read the package name and version, and lost all information regarding application name. This worked fine for most cases since for the vast majority of packages, the package name matches the app name, but failed for all aliases, which would then be moved to directories that wouldn't match the app name. This in turn broke some aspects of code analysis (in Dialyzer), or other functionality relying on static paths, such as including .hrl files from dependencies. This patch reformats the internal storage format of dependencies to align with the internal one used by rebar3, so that the app name can be carried along with the package name and its version. The fix can only work once `rebar3 update` is called so the index is rebuilt internally, and will the file cached on disk will be incompatible with older rebar3 versions. Currently, the following is not covered: - Tests - Including the package hashes of dependencies so they may match what is in a lock file -- they're being `undefined` instead, which may break some lookups. The previous format did not lend itself to hashing in the same way, and it is possible transitive deps were not being tracked properly, or worked by respecting the current package hierarchy. This will require further analysis For now this commit can allow reviewing and discussion.
* filter available package versions individually by buildtoolsTristan Sloughter2016-05-221-6/+6
|
* Add more hex rules so they don't throw errorsHeinz N. Gies2016-02-221-12/+110
| | | | | | | | | | Add more version constraints Allow for any number of whitespaces after compairison opperator Improve updating and error printing Fix failing tests
* add user-agent to http request headersTristan Sloughter2016-02-011-1/+1
|
* support temporary cdn change with HEX_CDN os varTristan Sloughter2015-12-191-20/+32
|
* only add package list of versions to registry if it has the right buildtool ↵Tristan Sloughter2015-11-171-2/+14
| | | | support
* return more useful error message (failed to download) when pkg http req failsTristan Sloughter2015-10-261-12/+16
|
* remove replacement of home dir with ~ in update outputTristan Sloughter2015-08-261-2/+2
|
* Merge pull request #742 from tsloughter/pkg_checkTristan Sloughter2015-08-231-0/+1
|\ | | | | improve error messages for packages by checking its existance before fetch
| * improve error messages for packages by checking its existance before fetchingTristan Sloughter2015-08-231-0/+1
| |
* | use 'default' for default hex repo path in cache and include in info messagesTristan Sloughter2015-08-221-5/+8
|/
* replace use of dict of packages and registry with single ets tableTristan Sloughter2015-08-211-51/+44
|
* include rebar3 in supported packages buildtoolTristan Sloughter2015-08-211-0/+1
|
* fix leaking ets tables caused by digraphspvmart2015-08-171-0/+1
|
* fix no_return warningsTristan Sloughter2015-08-081-1/+6
|
* fix dialyzer warnings, except 'no local return' warningsTristan Sloughter2015-08-081-0/+5
|
* Added rebar profile to httpc initialization and calls.CarlosEDP2015-07-031-1/+2
|
* fix bareness issuesFred Hebert2015-05-311-1/+1
| | | | | | - Crashes in providers lib when no providers in a namespace are bare - Making sure bareness matches semantics; i.e. a bare provider is visible, a non-bare provider is hidden.
* Proper custom pkg index support, some testsFred Hebert2015-05-131-4/+2
| | | | | | | | | | - 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
* ignore pkgs that can't build with rebar or makeTristan Sloughter2015-05-081-3/+12
|
* handle missing package in registry by skippingTristan Sloughter2015-05-041-4/+9
|
* ignore optional deps for nowTristan Sloughter2015-04-181-2/+4
|
* support single atoms for pkg deps, fetch highest version availableTristan Sloughter2015-04-111-41/+7
|
* Provide descriptions for all tasksFred Hebert2015-04-041-1/+1
|
* add back throw on package index writeTristan Sloughter2015-03-161-1/+1
|
* use PRV_ERROR for formattable errorsFred Hebert2015-03-161-1/+2
| | | | Also expose it in rebar_api
* update all examples in providers to use rebar3Tristan Sloughter2015-03-071-1/+1
|
* Revert accidental commited debug codeFred Hebert2015-02-241-2/+1
|
* Reuse test code and drop duplicated stuffFred Hebert2015-02-231-1/+1
|
* follow xdg standard. fixes #122Tristan Sloughter2015-02-191-1/+1
|
* parse version constraints in hex registry for digraphTristan Sloughter2015-02-171-10/+52
|
* replace package management with hex.pmTristan Sloughter2015-02-171-15/+49
|
* move dir functions from utils to new module rebar_dirTristan Sloughter2014-12-011-1/+1
|
* new dep graph workingTristan Sloughter2014-11-221-2/+2
|
* update package index fetchingTristan Sloughter2014-11-151-7/+2
|
* write packages file to tmp so a lost connection doesn't mean corruptionTristan Sloughter2014-11-151-2/+5
|
* use CONFIG_DIR of rebar3 for config directoriesTristan Sloughter2014-11-101-2/+2
|
* move back to using format_error/1Tristan Sloughter2014-11-091-4/+4
|
* update package update providerTristan Sloughter2014-11-081-7/+8
|
* add format_error/2 provider callback to providersTristan Sloughter2014-10-221-1/+6
|