]> _ Git - alire.git/commit
feat: improve URI recognition (#1736)
authorSeb M'Caw <mcaw@adacore.com>
Thu, 24 Oct 2024 14:01:02 +0000 (15:01 +0100)
committerGitHub <noreply@github.com>
Thu, 24 Oct 2024 14:01:02 +0000 (16:01 +0200)
commit12458f67fefd55a5f1bcf2a274cf7b0e272fa8bd
tree6e34ad864cbd49dc6827620478ede278d83de1d7
parentf187a1306f831c9d3debb60d73cfaf2609b997d1
feat: improve URI recognition (#1736)

* Improve origin URI recognition

- Consolidate a number of separate ad hoc tests for recognising URIs into Alire.URI.URI_Kind
- Add support for origin URLs with scheme "ssh://"
- Add bitbucket.org to the list of hosts recognised as git only
- Treat ".git/" suffix the same as ".git"
- Change publish command to raise errors on URLs with "file:" scheme (sidestepping a bug where the whole URL was treated as a relative path)
- Change various error messages
- Change handling of some obscure edge cases

* Fix source archives hosted on GitHub or similar

* Fix test when ssh command is unavailable

* Workaround for GNAT 10 bug

* Further improve URI recognition

* Fix existing test

* Add test for local indexes

* Add test for 'clean --cache' command

* Fix on Windows

* Fix on MacOS

* Clean up local-index-not-found test

* Consolidate 'Host' implementations

* Fix Fragment for local URLs

* Fix test

* Improve publishing test

* Fix documentation

* Remove redundant test

* Fix tests

* Fix typos

* Switch to US English

* Use crate_dirname

* Use less fragile test for git failure

* Add clarifying comments

* Treat http with non-empty userinfo as private

* Fix typo
72 files changed:
doc/catalog-format-spec.md
src/alire/alire-index_on_disk-directory.adb
src/alire/alire-index_on_disk-directory.ads
src/alire/alire-index_on_disk-git.adb
src/alire/alire-index_on_disk-git.ads
src/alire/alire-index_on_disk.adb
src/alire/alire-index_on_disk.ads
src/alire/alire-origins-deployers-git.adb
src/alire/alire-origins-deployers-hg.adb
src/alire/alire-origins-deployers-source_archive.adb
src/alire/alire-origins-deployers-svn.adb
src/alire/alire-origins-tweaks.adb
src/alire/alire-origins.adb
src/alire/alire-origins.ads
src/alire/alire-publish-submit.adb
src/alire/alire-publish.adb
src/alire/alire-publish.ads
src/alire/alire-roots-editable.adb
src/alire/alire-selftest.adb
src/alire/alire-uri.adb
src/alire/alire-uri.ads
src/alire/alire-user_pins.adb
src/alire/alire-vcss-git.adb
src/alire/alire-vcss-git.ads
src/alire/alire-vcss-hg.adb
src/alire/alire-vcss-hg.ads
src/alire/alire-vcss-svn.adb
src/alire/alire-vcss-svn.ads
src/alire/alire-vcss.adb
src/alire/alire-vcss.ads
src/alr/alr-commands-index.adb
src/alr/alr-commands-pin.adb
src/alr/alr-commands-publish.adb
src/alr/alr-commands-withing.adb
testsuite/fixtures/ambiguous_ssh_origin_index/index.toml [new file with mode: 0644]
testsuite/fixtures/ambiguous_ssh_origin_index/li/libfoo/libfoo-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/ssh_origin_index/index.toml [new file with mode: 0644]
testsuite/fixtures/ssh_origin_index/li/libbar/libbar-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/ssh_origin_index/li/libbaz/libbaz-1.0.0.toml [new file with mode: 0644]
testsuite/fixtures/ssh_origin_index/li/libfoo/libfoo-1.0.0.toml [new file with mode: 0644]
testsuite/tests/clean/cache-files/test.py [new file with mode: 0644]
testsuite/tests/clean/cache-files/test.yaml [new file with mode: 0644]
testsuite/tests/index/git-local/my_crates/hello/hello.gpr [new file with mode: 0644]
testsuite/tests/index/git-local/my_crates/hello/src/hello.adb [new file with mode: 0644]
testsuite/tests/index/git-local/my_crates/libhello/libhello.gpr [new file with mode: 0644]
testsuite/tests/index/git-local/my_crates/libhello/src/libhello.adb [new file with mode: 0644]
testsuite/tests/index/git-local/my_crates/libhello/src/libhello.ads [new file with mode: 0644]
testsuite/tests/index/git-local/my_index/index/he/hello/hello-1.0.1.toml [new file with mode: 0644]
testsuite/tests/index/git-local/my_index/index/index.toml [new file with mode: 0644]
testsuite/tests/index/git-local/my_index/index/li/libhello/libhello-1.0.0.toml [new file with mode: 0644]
testsuite/tests/index/git-local/test.py [new file with mode: 0644]
testsuite/tests/index/git-local/test.yaml [new file with mode: 0644]
testsuite/tests/index/git-ssh-remote/test.py
testsuite/tests/index/local-index-not-found/test.py
testsuite/tests/index/local-index-not-found/test.yaml
testsuite/tests/pin/bad-path/test.py
testsuite/tests/pin/branch-remote-protocols/test.py
testsuite/tests/pin/equivalent/test.py
testsuite/tests/pin/remote/test.py
testsuite/tests/publish/bad-arguments/test.py
testsuite/tests/publish/check-trusted/test.py
testsuite/tests/publish/file-scheme/test.py [new file with mode: 0644]
testsuite/tests/publish/file-scheme/test.yaml [new file with mode: 0644]
testsuite/tests/publish/private-indexes/test.py
testsuite/tests/publish/ssh-remote-origin/test.py
testsuite/tests/with/ambiguous_ssh_origin/test.py [new file with mode: 0644]
testsuite/tests/with/ambiguous_ssh_origin/test.yaml [new file with mode: 0644]
testsuite/tests/with/equivalent/test.py
testsuite/tests/with/pin-bad-path/test.py [new file with mode: 0644]
testsuite/tests/with/pin-bad-path/test.yaml [new file with mode: 0644]
testsuite/tests/with/ssh-origins/test.py [new file with mode: 0644]
testsuite/tests/with/ssh-origins/test.yaml [new file with mode: 0644]