{"action":"created","issue":{"url":"https://api.github.com/repos/ocaml/opam/issues/2289","labels_url":"https://api.github.com/repos/ocaml/opam/issues/2289/labels{/name}","comments_url":"https://api.github.com/repos/ocaml/opam/issues/2289/comments","events_url":"https://api.github.com/repos/ocaml/opam/issues/2289/events","html_url":"https://github.com/ocaml/opam/pull/2289","id":101432051,"number":2289,"title":"Support for packages from Atlassian's Stash","user":{"login":"antoine1fr","id":1477815,"avatar_url":"https://avatars.githubusercontent.com/u/1477815?v=3","gravatar_id":"","url":"https://api.github.com/users/antoine1fr","html_url":"https://github.com/antoine1fr","followers_url":"https://api.github.com/users/antoine1fr/followers","following_url":"https://api.github.com/users/antoine1fr/following{/other_user}","gists_url":"https://api.github.com/users/antoine1fr/gists{/gist_id}","starred_url":"https://api.github.com/users/antoine1fr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoine1fr/subscriptions","organizations_url":"https://api.github.com/users/antoine1fr/orgs","repos_url":"https://api.github.com/users/antoine1fr/repos","events_url":"https://api.github.com/users/antoine1fr/events{/privacy}","received_events_url":"https://api.github.com/users/antoine1fr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-08-17T14:23:13Z","updated_at":"2015-08-18T07:38:47Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ocaml/opam/pulls/2289","html_url":"https://github.com/ocaml/opam/pull/2289","diff_url":"https://github.com/ocaml/opam/pull/2289.diff","patch_url":"https://github.com/ocaml/opam/pull/2289.patch"},"body":"**Enhance detection of Zip archives**\r\n\r\nStash doesn't put any extension to its release archives. Currently, opam detects Zip archives by checking the filename's extension. This patch uses system's file command instead.\r\n\r\n**Add support for packages with everything in the root**\r\n\r\nLet's consider the following package tree:\r\n\r\n```\r\n/tmp/opam-xxx-yyy/\r\n                 |- Makefile\r\n                 |- src\r\n                   |- toto.ml\r\n```\r\n\r\nCurrently, opam only moves `src` to `.opam/<switch>/build/<package.a.b.c>`, instead of moving the whole tree.\r\n\r\nThis patch handles this case by directly moving `opam-xxx-yyy`, if regular files are found in it.\r\n\r\n**Notes**\r\n\r\nI didn't know whether the Makefile was generated or handwritten, so I added a dependency to the `str` package without really knowing what I was doing. :s"},"comment":{"url":"https://api.github.com/repos/ocaml/opam/issues/comments/132106118","html_url":"https://github.com/ocaml/opam/pull/2289#issuecomment-132106118","issue_url":"https://api.github.com/repos/ocaml/opam/issues/2289","id":132106118,"user":{"login":"AltGr","id":807966,"avatar_url":"https://avatars.githubusercontent.com/u/807966?v=3","gravatar_id":"","url":"https://api.github.com/users/AltGr","html_url":"https://github.com/AltGr","followers_url":"https://api.github.com/users/AltGr/followers","following_url":"https://api.github.com/users/AltGr/following{/other_user}","gists_url":"https://api.github.com/users/AltGr/gists{/gist_id}","starred_url":"https://api.github.com/users/AltGr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AltGr/subscriptions","organizations_url":"https://api.github.com/users/AltGr/orgs","repos_url":"https://api.github.com/users/AltGr/repos","events_url":"https://api.github.com/users/AltGr/events{/privacy}","received_events_url":"https://api.github.com/users/AltGr/received_events","type":"User","site_admin":false},"created_at":"2015-08-18T07:38:47Z","updated_at":"2015-08-18T07:38:47Z","body":"Thanks!\r\nI have however a few reservations on your contribution as it is:\r\n- we don't want to depend on `str`. We already use `re` which subsumes it. There is a compatible `Re_str` module, although you should preferably use `Re` directly (I have pending patches that attempt to unify the style and avoid having `Re_pcre` at one point, `Re_str` at another and then `Re_perl` somewhere)\r\n- I am not sure calling the `file` program is the most portable option -- and we target OSX, and *BSD beside Linux (and we're working on Windows). If it's straight-forward enough, reading the magic number would be a better solution (a function to check magic number could be added to OpamSystem).\r\n\r\nAll this said, it would indeed be very nice to have better handling of external archive types, and your initiative and contribution are very welcome!"}}