]> gitweb.factorcode.org Git - factor.git/commitdiff
bootstrap.image.upload: Use pscp on Windows for uploading boot images
authorDoug Coleman <doug.coleman@gmail.com>
Thu, 5 Feb 2015 21:43:49 +0000 (13:43 -0800)
committerDoug Coleman <doug.coleman@gmail.com>
Thu, 5 Feb 2015 21:43:49 +0000 (13:43 -0800)
since c:\ paths are treated as hostnames and the command fails.

basis/bootstrap/image/upload/upload.factor

index 8d29cfb5add0e7e63fda40dedc86332cf9920550..7c48cc7162948ce58e8d1d4fe75f2bdd032a07ce 100644 (file)
@@ -1,9 +1,8 @@
 ! Copyright (C) 2008 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: checksums checksums.openssl splitting assocs
-kernel io.files bootstrap.image sequences io namespaces make
-io.launcher math io.encodings.ascii io.files.temp io.pathnames
-io.directories ;
+USING: bootstrap.image checksums checksums.openssl io
+io.directories io.encodings.ascii io.files io.files.temp
+io.launcher io.pathnames kernel make namespaces sequences system ;
 IN: bootstrap.image.upload
 
 SYMBOL: upload-images-destination
@@ -26,9 +25,18 @@ SYMBOL: upload-images-destination
         ] each
     ] with-file-writer ;
 
+! Windows scp doesn't like pathnames with colons, it treats them as hostnames.
+! Workaround for uploading checksums.txt created with temp-file.
+! e.g. C:\Users\\Doug\\AppData\\Local\\Temp/factorcode.org\\Factor/checksums.txt
+! ssh: Could not resolve hostname c: no address associated with name
+
+HOOK: scp-name os ( -- path )
+M: object scp-name "scp" ;
+M: windows scp-name "pscp" ;
+
 : upload-images ( -- )
     [
-        "scp" ,
+        \ scp-name get-global scp-name or ,
         boot-image-names %
         checksums , destination ,
     ] { } make try-process ;