summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Joey Hess <joeyh@joeyh.name>2015-09-10 18:43:31 -0400
committerGravatar Joey Hess <joeyh@joeyh.name>2015-09-10 19:16:30 -0400
commit624e2ec84e537a20301a0fda6ceb4151a5ec61e4 (patch)
treec456d3d259b037987b4689a71eb0044a17e0f28c
parent09fbe113717531a7bb5806dcf42bb833f14a0e59 (diff)
Switched to using git for Windows, rather than msysgit.
Using msysgit with git-annex is no longer supported. At the same time, I'm updating the rsync.exe in my downloads repository with the one from msys2. Note that rsync is currently still being ldded and installed in Git/cmd/ like the other cygwin programs. The ldd fails and this failure is ignored. It would be better to special case it to go in Git/usr/bin/, so that the user can't run rsync in a dos prompt window, which doesn't work, as it needs additional libs. However, as far as git-annex running rsync running ssh, it works ok in this location. Removed the ssh.cmd and ssh-keygen.cmd; these are not needed with git for windows. Keeping them would let ssh be run manually from a dos prompt window, but that's not really a goal.
-rw-r--r--Build/BundledPrograms.hs11
-rw-r--r--Build/NullSoftInstaller.hs27
-rw-r--r--Git/Hook.hs2
-rw-r--r--debian/changelog2
-rw-r--r--doc/install/Windows.mdwn6
-rwxr-xr-xstandalone/windows/build.sh7
-rw-r--r--standalone/windows/ssh-keygen.cmd31
-rw-r--r--standalone/windows/ssh.cmd31
8 files changed, 30 insertions, 87 deletions
diff --git a/Build/BundledPrograms.hs b/Build/BundledPrograms.hs
index 2f38b11c9..dea93c18e 100644
--- a/Build/BundledPrograms.hs
+++ b/Build/BundledPrograms.hs
@@ -20,7 +20,7 @@ bundledPrograms :: [FilePath]
bundledPrograms = catMaybes
[ Nothing
#ifndef mingw32_HOST_OS
- -- git is not included in the windows bundle; msysgit is used
+ -- git is not included in the windows bundle; git for windows is used
, Just "git"
-- Not strictly needed in PATH by git-annex, but called
-- by git when it sshes to a remote.
@@ -28,7 +28,6 @@ bundledPrograms = catMaybes
, Just "git-receive-pack"
, Just "git-shell"
#endif
- , Just "cp"
#ifndef mingw32_HOST_OS
-- using xargs on windows led to problems, so it's not used there
, Just "xargs"
@@ -38,7 +37,7 @@ bundledPrograms = catMaybes
#ifndef mingw32_HOST_OS
-- OS X has ssh installed by default.
-- Linux probably has ssh, but not guaranteed.
- -- On Windows, msysgit provides ssh.
+ -- On Windows, git provides ssh.
, Just "ssh"
, Just "ssh-keygen"
#endif
@@ -46,7 +45,6 @@ bundledPrograms = catMaybes
#ifndef mingw32_HOST_OS
, Just "sh"
#endif
- , SysConfig.gpg
, ifset SysConfig.curl "curl"
#ifndef darwin_HOST_OS
-- wget on OSX has been problimatic, looking for certs in the wrong
@@ -56,11 +54,16 @@ bundledPrograms = catMaybes
#endif
, SysConfig.lsof
, SysConfig.gcrypt
+#ifndef mingw32_HOST_OS
+ -- All these utilities are included in git for Windows
+ , SysConfig.gpg
, SysConfig.sha1
, SysConfig.sha256
, SysConfig.sha512
, SysConfig.sha224
, SysConfig.sha384
+ , Just "cp"
+#endif
#ifdef linux_HOST_OS
-- used to unpack the tarball when upgrading
, Just "gunzip"
diff --git a/Build/NullSoftInstaller.hs b/Build/NullSoftInstaller.hs
index e300036e4..7726fdcbc 100644
--- a/Build/NullSoftInstaller.hs
+++ b/Build/NullSoftInstaller.hs
@@ -1,7 +1,7 @@
{- Generates a NullSoft installer program for git-annex on Windows.
-
- To build the installer, git-annex should already be built by cabal,
- - and ssh and rsync etc, as well as cygwin libraries, already installed
+ - and the necessary utility programs already installed
- from cygwin.
-
- This uses the Haskell nsis package (cabal install nsis)
@@ -9,8 +9,9 @@
- git-annex-installer.exe
-
- The installer includes git-annex, and utilities it uses, with the
- - exception of git. The user needs to install git separately,
- - and the installer checks for that.
+ - exception of git and some utilities that are bundled with git.
+ - The user needs to install git separately, and the installer checks
+ - for that.
-
- Copyright 2013-2015 Joey Hess <id@joeyh.name>
-
@@ -34,6 +35,7 @@ import Utility.Path
import Utility.CopyFile
import Utility.SafeCommand
import Utility.Process
+import Utility.Exception
import Build.BundledPrograms
main = do
@@ -42,7 +44,7 @@ main = do
mustSucceed "ln" [File "dist/build/git-annex/git-annex.exe", File gitannex]
let license = tmpdir </> licensefile
mustSucceed "sh" [Param "-c", Param $ "zcat standalone/licences.gz > '" ++ license ++ "'"]
- extrabins <- forM (cygwinPrograms) $ \f -> do
+ extrabins <- forM (winPrograms) $ \f -> do
p <- searchPath f
when (isNothing p) $
print ("unable to find in PATH", f)
@@ -54,7 +56,7 @@ main = do
let htmlhelp = tmpdir </> "git-annex.html"
writeFile htmlhelp htmlHelpText
writeFile nsifile $ makeInstaller gitannex license htmlhelp
- (wrappers ++ catMaybes (extrabins ++ dllpaths))
+ (catMaybes (extrabins ++ dllpaths))
[ webappscript, autostartscript ]
mustSucceed "makensis" [File nsifile]
removeFile nsifile -- left behind if makensis fails
@@ -173,10 +175,10 @@ makeInstaller gitannex license htmlhelp extrabins launchers = nsis $ do
addfile f = file [] (str f)
removefilesFrom d = mapM_ (\f -> delete [RebootOK] $ fromString $ d ++ "/" ++ takeFileName f)
-cygwinPrograms :: [FilePath]
-cygwinPrograms = map (\p -> p ++ ".exe") bundledPrograms
+winPrograms :: [FilePath]
+winPrograms = map (\p -> p ++ ".exe") bundledPrograms
--- msysgit opens Program Files/Git/doc/git/html/git-annex.html
+-- git opens Program Files/Git/doc/git/html/git-annex.html
-- when git annex --help is run.
htmlHelpText :: String
htmlHelpText = unlines
@@ -191,15 +193,10 @@ htmlHelpText = unlines
-- Find cygwin libraries used by the specified executable.
findCygLibs :: FilePath -> IO [FilePath]
-findCygLibs p = filter iscyg . mapMaybe parse . lines <$> readProcess "ldd" [p]
+findCygLibs p = filter iscyg . mapMaybe parse . lines
+ <$> catchDefaultIO "" (readProcess "ldd" [p])
where
parse l = case words (dropWhile isSpace l) of
(dll:"=>":_dllpath:_offset:[]) -> Just dll
_ -> Nothing
iscyg f = "cyg" `isPrefixOf` f || "lib" `isPrefixOf` f
-
-wrappers :: [FilePath]
-wrappers =
- [ "standalone\\windows\\ssh.cmd"
- , "standalone\\windows\\ssh-keygen.cmd"
- ]
diff --git a/Git/Hook.hs b/Git/Hook.hs
index aec2563f4..f4424c60e 100644
--- a/Git/Hook.hs
+++ b/Git/Hook.hs
@@ -81,7 +81,7 @@ runHook h r = do
#ifndef mingw32_HOST_OS
findcmd = defcmd
#else
- {- Like msysgit, parse the first line of the hook file,
+ {- Like git for windows, parse the first line of the hook file,
- look for "#!", and dispatch the interpreter on the file. -}
findcmd f = do
l <- headMaybe . lines <$> catchDefaultIO "" (readFile f)
diff --git a/debian/changelog b/debian/changelog
index 95a3ff9f7..2cb63ed97 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -12,6 +12,8 @@ git-annex (5.20150825) UNRELEASED; urgency=medium
* When gpg.program is configured, it's used to get the command to run
for gpg. Useful on systems that have only a gpg2 command or want to
use it instead of the gpg command.
+ * Windows: Switched to using git for Windows, rather than msysgit.
+ Using msysgit with git-annex is no longer supported.
-- Joey Hess <id@joeyh.name> Tue, 01 Sep 2015 14:46:18 -0700
diff --git a/doc/install/Windows.mdwn b/doc/install/Windows.mdwn
index 37fbc85c2..bf9582913 100644
--- a/doc/install/Windows.mdwn
+++ b/doc/install/Windows.mdwn
@@ -1,7 +1,7 @@
git-annex now does Windows!
-* First, [install msysgit](http://git-scm.com/downloads) (msysgit 1.9 is needed; the new "git for windows" does not currently work)
- _Be sure to tell the msysgit installer to add git to the PATH._
+* First, [install git for Windows](http://git-scm.com/downloads) (msysgit is no longer supported)
+ _Be sure to tell the installer to add git to the PATH._
That is, select "Use Git from the Windows Command Prompt"
* Then, [install git-annex](https://downloads.kitenet.net/git-annex/windows/current/)
@@ -36,7 +36,7 @@ Once the prerequisites are installed, run:
build
Note that git from Cygwin is able to clone git-annex's git repository;
-Msysgit cannot due to some characters in filenames.
+Regular git for Windows cannot due to some characters in filenames.
(To build the git-annex installer, you also need to install the NullSoft
installer system.)
diff --git a/standalone/windows/build.sh b/standalone/windows/build.sh
index 8c26874b2..86b28847c 100755
--- a/standalone/windows/build.sh
+++ b/standalone/windows/build.sh
@@ -63,8 +63,11 @@ cabal install nsis
ghc -fforce-recomp --make Build/NullSoftInstaller.hs -fno-warn-tabs
# Want to include cygwin programs in bundle, not others, since
# it includes the cygwin libs that go with them.
-# Currently need an older version of rsync than the one from cygwin.
-if [ ! -e rsync.exe ]; then
+# Currently need an different version of rsync than the one from cygwin.
+# This rsync build originally comes from https://msys2.github.io/,
+# and it works with the ssh bundled with git for windows.
+if [ ! -e rsync.exe ] || [ "$(sha1sum rsync.exe)" != "85cb7a4d16d274fcf8069b39042965ad26abd6aa" ]; then
+ rm -f rsync.exe || true
withcyg wget https://downloads.kitenet.net/git-annex/windows/assets/rsync.exe
withcyg chmod +x rsync.exe
fi
diff --git a/standalone/windows/ssh-keygen.cmd b/standalone/windows/ssh-keygen.cmd
deleted file mode 100644
index 3afd28f47..000000000
--- a/standalone/windows/ssh-keygen.cmd
+++ /dev/null
@@ -1,31 +0,0 @@
-@rem Do not use "echo off" to not affect any child calls.
-
-@rem Enable extensions, the `verify other 2>nul` is a trick from the setlocal help
-@verify other 2>nul
-@setlocal enableDelayedExpansion
-@if errorlevel 1 (
- @echo Unable to enable delayed expansion. Immediate expansion will be used.
- @goto fallback
-)
-
-@rem Get the absolute path to the parent directory, which is assumed to be the
-@rem Git installation root.
-@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
-@set PATH=!git_install_root!\bin;!git_install_root!\usr\bin;!git_install_root!\mingw\bin;!PATH!
-
-ssh-keygen %*
-@goto end
-
-:fallback
-@rem The above script again with immediate expansion, in case delayed expansion
-@rem is unavailable.
-@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
-@set PATH=%git_install_root%\bin;%git_install_root%\usr\bin;%git_install_root%\mingw\bin;%PATH%
-
-@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
-@if not exist "%HOME%" @set HOME=%USERPROFILE%
-
-ssh-keygen %*
-
-:end
-@rem End of script
diff --git a/standalone/windows/ssh.cmd b/standalone/windows/ssh.cmd
deleted file mode 100644
index ad9b5c300..000000000
--- a/standalone/windows/ssh.cmd
+++ /dev/null
@@ -1,31 +0,0 @@
-@rem Do not use "echo off" to not affect any child calls.
-
-@rem Enable extensions, the `verify other 2>nul` is a trick from the setlocal help
-@verify other 2>nul
-@setlocal enableDelayedExpansion
-@if errorlevel 1 (
- @echo Unable to enable delayed expansion. Immediate expansion will be used.
- @goto fallback
-)
-
-@rem Get the absolute path to the parent directory, which is assumed to be the
-@rem Git installation root.
-@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
-@set PATH=!git_install_root!\bin;!git_install_root!\usr\bin;!git_install_root!\mingw\bin;!PATH!
-
-ssh %*
-@goto end
-
-:fallback
-@rem The above script again with immediate expansion, in case delayed expansion
-@rem is unavailable.
-@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
-@set PATH=%git_install_root%\bin;%git_install_root%\usr\bin;%git_install_root%\mingw\bin;%PATH%
-
-@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
-@if not exist "%HOME%" @set HOME=%USERPROFILE%
-
-ssh %*
-
-:end
-@rem End of script