From e41824d27a3cd1f6cbd05c05bc9063fc62e2177d Mon Sep 17 00:00:00 2001 From: Leonid Pliushch Date: Wed, 1 Jan 2020 18:03:44 +0200 Subject: [PATCH] restic: ignore chmod() failure Fixes problem with creating repositories in /sdcard/. Issue https://github.com/termux/termux-packages/issues/4728. --- packages/restic/build.sh | 1 + packages/restic/failsafe-chmod.patch | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 packages/restic/failsafe-chmod.patch diff --git a/packages/restic/build.sh b/packages/restic/build.sh index 97f06f61e..926f0f5df 100644 --- a/packages/restic/build.sh +++ b/packages/restic/build.sh @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Fast, secure, efficient backup program" TERMUX_PKG_LICENSE="BSD" TERMUX_PKG_MAINTAINER="Leonid Plyushch " TERMUX_PKG_VERSION=0.9.6 +TERMUX_PKG_REVISION=1 # Use a snapshot to fix building with go 1.13: #TERMUX_PKG_SRCURL=https://github.com/restic/restic/archive/v$TERMUX_PKG_VERSION.tar.gz TERMUX_PKG_SRCURL=https://github.com/restic/restic/archive/604b18aa7426148a55f76307ca729e829ff6b61d.zip diff --git a/packages/restic/failsafe-chmod.patch b/packages/restic/failsafe-chmod.patch new file mode 100644 index 000000000..e6f20cd3c --- /dev/null +++ b/packages/restic/failsafe-chmod.patch @@ -0,0 +1,18 @@ +diff -uNr restic/internal/fs/file_unix.go restic.mod/internal/fs/file_unix.go +--- restic/internal/fs/file_unix.go 2019-07-29 10:22:22.000000000 +0300 ++++ restic.mod/internal/fs/file_unix.go 2020-01-01 17:54:08.797875856 +0200 +@@ -47,12 +47,6 @@ + + // Chmod changes the mode of the named file to mode. + func Chmod(name string, mode os.FileMode) error { +- err := os.Chmod(fixpath(name), mode) +- +- // ignore the error if the FS does not support setting this mode (e.g. CIFS with gvfs on Linux) +- if err != nil && isNotSupported(err) { +- return nil +- } +- +- return err ++ os.Chmod(fixpath(name), mode) ++ return nil + }