avoid uname -o on !linux and catch any exception from it

Fix bug in last release that prevented the webapp opening on non-Linux systems.

This commit was sponsored by Jake Vosloo on Patreon.
This commit is contained in:
Joey Hess 2018-05-08 14:06:19 -04:00
parent b2e03bb428
commit 2948f6d916
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38
4 changed files with 24 additions and 2 deletions

View file

@ -1,12 +1,14 @@
git-annex (6.20180428) UNRELEASED; urgency=medium
* Fix regression in last release that crashes when using
* Fix bug in last release that crashes when using
--all or running git-annex in a bare repository. May have also
affected git-annex unused and git-annex info.
* runshell: Use proot when running on Android, to work around
Android 8's ill-advised seccomp filtering of system calls,
including ones crucial for reliable thread locking.
(This will only work with termux's version of proot.)
* Fix bug in last release that prevented the webapp opening on
non-Linux systems.
-- Joey Hess <id@joeyh.name> Tue, 08 May 2018 13:51:37 -0400

View file

@ -1,3 +1,5 @@
{-# LANGUAGE CPP #-}
{- Android stuff
-
- Copyright 2018 Joey Hess <id@joeyh.name>
@ -14,4 +16,9 @@ import Common
-- Note that this relies on termux's uname having been built with "Android"
-- as the os name. Often on Android, uname will report "Linux".
osAndroid :: IO Bool
osAndroid = ("Android" `isPrefixOf` ) <$> readProcess "uname" ["-o"]
#ifdef linux_HOST_OS
osAndroid = catchDefaultIO False $
("Android" `isPrefixOf` ) <$> readProcess "uname" ["-o"]
#else
osAndroid = return False
#endif

View file

@ -55,3 +55,5 @@ WebApp crashed: user error (uname ["-o"] exited 1)
Yup! git-annex is great! Thanks for all your hard work on this project Joey!!
—Andrew
> [[fixed|done]] --[[Joey]]

View file

@ -0,0 +1,11 @@
[[!comment format=mdwn
username="joey"
subject="""comment 23"""
date="2018-05-08T18:03:05Z"
content="""
Guys talking about uname -o and stuff, this is not the place to do that.
File a [[bug]] report if you have a bug like that. You're making it harder
for every person who opens this page to install git-annex and ends up
wwading through discussion of fixed bugs like that one. Also, I respond
*much* faster to bug reports than to random misplaced comments about bugs.
"""]]