Skip to content

Commit 86872c0

Browse files
committed
Merge branch 'release/0.5.0'
2 parents f755cc7 + 407a09c commit 86872c0

File tree

6 files changed

+45
-46
lines changed

6 files changed

+45
-46
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ A: Probably a disk full, or permission error.
133133
Via [clojars](http://clojars.org) and
134134
[Leiningen](http://github.com/technomancy/leiningen).
135135

136-
:dependencies [clj-ssh "0.4.4"]
136+
:dependencies [clj-ssh "0.5.0"]
137137

138138
or your favourite maven repository aware tool.
139139

ReleaseNotes.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# Release Notes
22

3-
Current release is 0.4.4
3+
Current release is 0.5.0
4+
5+
## 0.5.0
6+
7+
- Require clojure 1.4.0
8+
Drops usage of slingshot.
49

510
## 0.4.4
611

profiles.clj

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,8 @@
11
{:dev {:dependencies [[ch.qos.logback/logback-classic "1.0.0"]]}
2-
:slingshot-0.10.1 {:dependencies [[slingshot "0.10.1"]
3-
[org.clojure/clojure "1.2.1"]]}
4-
:clojure-1.2.1 {:dependencies [[slingshot "0.10.1"]
5-
[org.clojure/clojure "1.2.1"]]}
6-
:clojure-1.3.0 {:dependencies [[slingshot "0.10.1"]
7-
[org.clojure/clojure "1.3.0"]]}
8-
:clojure-1.4.0 {:dependencies [[slingshot "0.10.1"]
9-
[org.clojure/clojure "1.4.0-beta1"]]}
2+
:clojure-1.2.1 {:dependencies [[org.clojure/clojure "1.2.1"]]}
3+
:clojure-1.3.0 {:dependencies [[org.clojure/clojure "1.3.0"]]}
4+
:clojure-1.4.0 {:dependencies [[org.clojure/clojure "1.4.0"]]}
5+
:clojure-1.5.0 {:dependencies [[org.clojure/clojure "1.5.0-RC4"]]}
106
:codox {:codox {:writer codox-md.writer/write-docs
117
:version "0.4"
128
:output-dir "doc/api/0.4"

project.clj

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
(defproject clj-ssh "0.4.4"
1+
(defproject clj-ssh "0.5.0"
22
:description "Library for using SSH from clojure."
33
:url "https://github.com/hugoduncan/clj-ssh"
44
:license {:name "Eclipse Public License"
55
:url "http://www.eclipse.org/legal/epl-v10.html"}
6-
:dependencies [[org.clojure/clojure "1.2.1"]
6+
:dependencies [[org.clojure/clojure "1.4.0"]
77
[org.clojure/tools.logging "0.1.2"
88
:exclusions [org.clojure/clojure]]
99
[jsch-agent-proxy "0.0.4"]
1010
[jsch-agent-proxy/jsch-agent-proxy-jna "0.0.4"
1111
:exclusions [com.jcraft/jsch-agent-proxy]]
12-
[slingshot "0.10.2"
13-
:exclusions [org.clojure/clojure]]
1412
[com.jcraft/jsch "0.1.49"]])

release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ echo -n "commiting release notes and readme. enter to continue:" && read x \
3838
&& git add ReleaseNotes.md README.md project.clj \
3939
&& git commit -m "Updated version, release notes and readme for $version" \
4040
&& echo -n "Peform release. enter to continue:" && read x \
41-
&& lein with-profile default:clojure-1.2.1:clojure-1.3.0:clojure-1.4.0 test \
41+
&& lein with-profile default:+clojure-1.5.0 test \
4242
&& lein deploy clojars \
4343
&& git flow release finish $version \
4444
&& lein with-profile release set-version ${next_version} \

src/clj_ssh/ssh.clj

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
[clojure.java.io :as io]
3030
[clojure.string :as string]
3131
[clojure.tools.logging :as logging])
32-
(:use
33-
[slingshot.slingshot :only [throw+]])
3432
(:import
3533
[java.io
3634
File InputStream OutputStream StringReader
@@ -183,10 +181,11 @@
183181
(.add id-repo (.forSSHAgent keypair)))))
184182

185183
:else
186-
(throw+
187-
{:reason :do-not-know-how-to-add-identity
188-
:args options}
189-
"Don't know how to add identity"))))
184+
(throw
185+
(ex-info
186+
"Don't know how to add identity"
187+
{:reason :do-not-know-how-to-add-identity
188+
:args options})))))
190189

191190
(defn add-identity-with-keychain
192191
"Add a private key, only if not already known, using the keychain to obtain
@@ -214,10 +213,11 @@
214213
(add-identity agent (assoc options :passphrase passphrase))
215214
(do
216215
(logging/error "Passphrase required, but none findable.")
217-
(throw+
218-
{:reason :passphrase-not-found
219-
:key-name name}
220-
"Passphrase required for key %s, but none findable." name)))
216+
(throw
217+
(ex-info
218+
(str "Passphrase required for key " name ", but none findable.")
219+
{:reason :passphrase-not-found
220+
:key-name name}) name)))
221221
(add-identity agent options)))))
222222

223223
;;; Sessions
@@ -518,7 +518,7 @@ sh returns a map of
518518
5 (. target#
519519
(~name (first args#) (second args#) (nth args# 2) (nth args# 3)
520520
(nth args# 4)))
521-
(throw+
521+
(throw
522522
(java.lang.IllegalArgumentException.
523523
(str "Too many arguments passed. Limit 5, passed " (count args#)))))))
524524

@@ -564,7 +564,7 @@ sh returns a map of
564564
(conj args (sftp-modemap (options :mode)))
565565
args)]
566566
((memfn-varargs put ChannelSftp) channel args))
567-
(throw+
567+
(throw
568568
(java.lang.IllegalArgumentException. (str "Unknown SFTP command " cmd)))))
569569

570570
(defn sftp
@@ -616,15 +616,16 @@ cmd specifies a command to exec. Valid commands are:
616616
[^InputStream in]
617617
(let [code (.read in)]
618618
(when-not (zero? code)
619-
(throw+
620-
{:type :clj-ssh/scp-failure
621-
:message (format
622-
"clj-ssh scp failure: %s"
623-
(case code
624-
1 "scp error"
625-
2 "scp fatal error"
626-
-1 "disconnect error"
627-
"unknown error"))}))))
619+
(throw
620+
(ex-info
621+
(format
622+
"clj-ssh scp failure: %s"
623+
(case code
624+
1 "scp error"
625+
2 "scp fatal error"
626+
-1 "disconnect error"
627+
"unknown error"))
628+
{:type :clj-ssh/scp-failure})))))
628629

629630
(defn- scp-send-command
630631
"Send command to the specified output stream"
@@ -695,11 +696,11 @@ cmd specifies a command to exec. Valid commands are:
695696
(fn [^String path]
696697
(let [file (File. path)]
697698
(when (.isDirectory file)
698-
(throw+
699-
{:type :clj-ssh/scp-directory-copy-requested
700-
:message (format
701-
"Copy of dir %s requested without recursive flag"
702-
path)}))
699+
(throw
700+
(ex-info
701+
(format
702+
"Copy of dir %s requested without recursive flag" path)
703+
{:type :clj-ssh/scp-directory-copy-requested})))
703704
file)))]
704705
(map f paths)))
705706

@@ -838,11 +839,10 @@ cmd specifies a command to exec. Valid commands are:
838839
_ (when (and (.exists file)
839840
(not (.isDirectory file))
840841
(> (count remote-paths) 1))
841-
(throw+
842-
{:type :clj-ssh/scp-copy-multiple-files-to-file-requested
843-
:message (format
844-
"Copy of multiple files to file %s requested"
845-
local-path)}))]
842+
(throw
843+
(ex-info
844+
(format "Copy of multiple files to file %s requested" local-path)
845+
{:type :clj-ssh/scp-copy-multiple-files-to-file-requested})))]
846846
(when (and session (not (connected? session)))
847847
(connect session))
848848
(let [[^PipedInputStream in

0 commit comments

Comments
 (0)