sysutils/yadm: Backport files perms check patch

Adds a patch to sysutils/yadm to correct file permission checks on FreeBSD

See https://github.com/TheLocehiliosan/yadm/pull/246 for reference.

While here, pet linters.

PR:	248781
Submitted by:	vendion@gmail.com (maintainer)
This commit is contained in:
Fernando Apesteguía 2020-08-20 18:16:24 +00:00
parent 43d3cd1741
commit e96cd4d288
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=545545
2 changed files with 17 additions and 4 deletions

View File

@ -2,6 +2,7 @@
PORTNAME= yadm
PORTVERSION= 2.5.0
PORTREVISION= 1
CATEGORIES= sysutils
MAINTAINER= vendion@gmail.com
@ -10,8 +11,8 @@ COMMENT= Yet Another Dotfiles Manager
LICENSE= GPLv3+
LICENSE_FILE= ${WRKSRC}/LICENSE
RUN_DEPENDS= git:devel/git \
bash:shells/bash
RUN_DEPENDS= bash:shells/bash \
git:devel/git
USE_GITHUB= yes
GH_ACCOUNT= TheLocehiliosan
@ -21,9 +22,9 @@ PLIST_FILES= bin/yadm \
OPTIONS_DEFINE= J2CTL
J2CTL_DESC= Enable Jinja2 powered template files
J2CTL_DESC= Enable Jinja2 powered template files
J2CTL_RUN_DEPENDS= j2:textproc/py-j2cli@${PY_FLAVOR}
J2CTL_USES= python
J2CTL_USES= python
.include <bsd.port.options.mk>

View File

@ -0,0 +1,12 @@
--- yadm.orig 2020-08-20 01:05:25 UTC
+++ yadm
@@ -1944,7 +1944,8 @@ function get_mode {
mode=$(stat -c '%a' "$filename" 2>/dev/null)
if [ -z "$mode" ] ; then
# BSD-style
- mode=$(stat -f '%A' "$filename" 2>/dev/null)
+ # Using the `cut` command to match the output of GNU stat output
+ mode=$(stat -f '%p' "$filename" | cut -c4-6 2>/dev/null)
fi
# only accept results if they are octal