[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/haskell-tng-mode c42b5c5 338/385: use url-copy-path instea
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/haskell-tng-mode c42b5c5 338/385: use url-copy-path instead of shelling out |
Date: |
Wed, 6 Oct 2021 00:00:00 -0400 (EDT) |
branch: elpa/haskell-tng-mode
commit c42b5c543b0f8cbe0b8156e0c68d37fc5f164029
Author: Tseen She <ts33n.sh3@gmail.com>
Commit: Tseen She <ts33n.sh3@gmail.com>
use url-copy-path instead of shelling out
---
haskell-tng-hsinspect.el | 28 ++++++++++++++++------------
1 file changed, 16 insertions(+), 12 deletions(-)
diff --git a/haskell-tng-hsinspect.el b/haskell-tng-hsinspect.el
index 89fe042..4509917 100644
--- a/haskell-tng-hsinspect.el
+++ b/haskell-tng-hsinspect.el
@@ -16,6 +16,7 @@
(require 'array)
(require 'subr-x)
+(require 'url)
;; Popups are not supported in stock Emacs so an extension is necessary:
;; https://emacs.stackexchange.com/questions/53373
@@ -66,14 +67,13 @@ TODO: support local / git packages by consulting
`plan.json'"
(mapconcat 'identity (split-string module (rx "."))
"/" )
".hs")))
(when (not (file-exists-p tarball))
- ;; NOTE we can't do this with stack because it doesn't have the
equivalent
- ;; of the "get" command. Also, it is not clear where stack puts source
- ;; code, so no point looking.
- ;;
+ ;; We can't expect stack to reveal source locations because it
+ ;; obfuscates all downloads. Cabal has "cabal get" but it is broken.
;; WORKAROUND https://github.com/haskell/cabal/issues/6443
- ;; TODO curl or a built-in emacs downloader, so cabal is not necessary
- (shell-command (format "cabal get %s -d /var/empty &" srcid))
- (error "%s was not found, attempting to download: please try again
later" tarball))
+ (message "%s was not found" tarball)
+ (url-copy-file
+ (haskell-tng--hsinspect-hackage-source srcid)
+ tarball))
(message "Loading %s from %s" sym tarball)
(find-file tarball)
@@ -100,11 +100,15 @@ TODO: support local / git packages by consulting
`plan.json'"
(defun haskell-tng--hsinspect-srcid-source (srcid)
(message "[haskell-tng] [DEBUG] tarball %s" srcid)
- (let* ((parts (haskell-tng--string-split-last srcid "-"))
- (package (car parts))
- (version (cdr parts)))
+ (pcase-let ((`(,package . ,version) (haskell-tng--string-split-last srcid
"-")))
(expand-file-name
- (concat "~/.cabal/packages/hackage.haskell.org/" package "/" version "/"
srcid ".tar.gz"))))
+ (concat
+ "~/.cabal/packages/hackage.haskell.org/"
+ package "/" version "/" srcid
+ ".tar.gz"))))
+
+(defun haskell-tng--hsinspect-hackage-source (srcid)
+ (concat "http://hackage.haskell.org/package/" srcid "/" srcid ".tar.gz"))
;; TODO haskell-tng-show-documentation
@@ -239,7 +243,7 @@ present in the index. If an unexported module exports
another
unexported module's definition, we are unable to locate it."
;; TODO probably doesn't work for 'tycon
;; TODO use seq-find instead of seq-mapcat
- ;; TODO `hsinspect index' could include unexported modules
+ ;; TODO `hsinspect index' could evaluate all re-exports to their final
destination
(when srcid
(message "[haskell-tng] [DEBUG] follow %s %s %s" srcid module name))
(or
- [nongnu] elpa/haskell-tng-mode 766480d 290/385: fast-tags should be project specific, (continued)
- [nongnu] elpa/haskell-tng-mode 766480d 290/385: fast-tags should be project specific, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode efd8093 299/385: silent formatter errors, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 26c6828 291/385: fqn imports, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 4480bb4 319/385: bump hsinspect/ghcflags versions, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 99287ef 316/385: stack projectile defaults, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode dbb2b7a 350/385: block / return-from instead of catch / throw, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode d611f0b 322/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode a717a50 331/385: allow workflow with qualified imports as default, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 70e649b 330/385: import qualified is even smarter, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 5a064fd 328/385: hypen prefix asks to qualify the import, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode c42b5c5 338/385: use url-copy-path instead of shelling out,
ELPA Syncer <=
- [nongnu] elpa/haskell-tng-mode 8405852 351/385: document bugs and ideas, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f429326 327/385: thots, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 8bb3c34 363/385: the in-memory cache doesn't have to cache nil, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5977b6 339/385: bugfix for source downloading, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 9359c7b 349/385: cl-loop, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode f5d76fc 348/385: tidy docs, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3b37524 360/385: bugfix for qualified imports when the cache was bad, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode fe2b164 372/385: fix the build, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 63225d5 374/385: use .ghc.path to find hsinspect, build tool agnostic, ELPA Syncer, 2021/10/06
- [nongnu] elpa/haskell-tng-mode 3d1122b 116/385: notes on regexps, ELPA Syncer, 2021/10/06