* [PATCH] fsck.xfs: do not use 'function' keyword
@ 2018-04-30 1:15 Eric Sandeen
2018-04-30 5:30 ` Darrick J. Wong
2018-04-30 7:46 ` Jan Tulak
0 siblings, 2 replies; 5+ messages in thread
From: Eric Sandeen @ 2018-04-30 1:15 UTC (permalink / raw)
To: linux-xfs; +Cc: Jan Tulak
It was pointed out on irc that fsck.xfs uses the 'function' keyword
although it invokes /bin/sh - 'function' is a bashism. It's not needed
here, so just remove it.
Fixes: 04a2d5d ("fsck.xfs: allow forced repairs using xfs_repair")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---
This might be a 4.16.1 item, if strict-sh initscripts fail to run fsck.xfs at
boot time ...?
diff --git a/fsck/xfs_fsck.sh b/fsck/xfs_fsck.sh
index c9fc3eb..1916c07 100755
--- a/fsck/xfs_fsck.sh
+++ b/fsck/xfs_fsck.sh
@@ -6,7 +6,7 @@
NAME=$0
# get the right return code for fsck
-function repair2fsck_code() {
+repair2fsck_code() {
case $1 in
0) return 0 # everything is ok
;;
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] fsck.xfs: do not use 'function' keyword
2018-04-30 1:15 [PATCH] fsck.xfs: do not use 'function' keyword Eric Sandeen
@ 2018-04-30 5:30 ` Darrick J. Wong
2018-04-30 13:28 ` Eric Sandeen
2018-04-30 7:46 ` Jan Tulak
1 sibling, 1 reply; 5+ messages in thread
From: Darrick J. Wong @ 2018-04-30 5:30 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs, Jan Tulak
On Sun, Apr 29, 2018 at 08:15:28PM -0500, Eric Sandeen wrote:
> It was pointed out on irc that fsck.xfs uses the 'function' keyword
> although it invokes /bin/sh - 'function' is a bashism. It's not needed
> here, so just remove it.
>
> Fixes: 04a2d5d ("fsck.xfs: allow forced repairs using xfs_repair")
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Does RHEL have 'checkbashisms'?
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
--D
> ---
>
> This might be a 4.16.1 item, if strict-sh initscripts fail to run fsck.xfs at
> boot time ...?
>
> diff --git a/fsck/xfs_fsck.sh b/fsck/xfs_fsck.sh
> index c9fc3eb..1916c07 100755
> --- a/fsck/xfs_fsck.sh
> +++ b/fsck/xfs_fsck.sh
> @@ -6,7 +6,7 @@
> NAME=$0
>
> # get the right return code for fsck
> -function repair2fsck_code() {
> +repair2fsck_code() {
> case $1 in
> 0) return 0 # everything is ok
> ;;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fsck.xfs: do not use 'function' keyword
2018-04-30 1:15 [PATCH] fsck.xfs: do not use 'function' keyword Eric Sandeen
2018-04-30 5:30 ` Darrick J. Wong
@ 2018-04-30 7:46 ` Jan Tulak
1 sibling, 0 replies; 5+ messages in thread
From: Jan Tulak @ 2018-04-30 7:46 UTC (permalink / raw)
To: Eric Sandeen; +Cc: linux-xfs
On Mon, Apr 30, 2018 at 3:15 AM, Eric Sandeen <sandeen@sandeen.net> wrote:
> It was pointed out on irc that fsck.xfs uses the 'function' keyword
> although it invokes /bin/sh - 'function' is a bashism. It's not needed
> here, so just remove it.
>
Ah, thanks.
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fsck.xfs: do not use 'function' keyword
2018-04-30 5:30 ` Darrick J. Wong
@ 2018-04-30 13:28 ` Eric Sandeen
2018-04-30 13:43 ` Jan Tulak
0 siblings, 1 reply; 5+ messages in thread
From: Eric Sandeen @ 2018-04-30 13:28 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: linux-xfs, Jan Tulak
On 4/30/18 12:30 AM, Darrick J. Wong wrote:
> On Sun, Apr 29, 2018 at 08:15:28PM -0500, Eric Sandeen wrote:
>> It was pointed out on irc that fsck.xfs uses the 'function' keyword
>> although it invokes /bin/sh - 'function' is a bashism. It's not needed
>> here, so just remove it.
>>
>> Fixes: 04a2d5d ("fsck.xfs: allow forced repairs using xfs_repair")
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>
> Does RHEL have 'checkbashisms'?
Hm, yes, Fedora & RHEL have it in devscripts-minimal.
$ checkbashisms ./fsck/xfs_fsck.sh
possible bashism in ./fsck/xfs_fsck.sh line 9 ('function' is useless):
function repair2fsck_code() {
possible bashism in ./fsck/xfs_fsck.sh line 62 ('command' with option other than -p):
XFS_REPAIR=`command -v xfs_repair`
Apparently -v is only part of "User Portability Utilities?"
> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
>
> --D
>
>> ---
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] fsck.xfs: do not use 'function' keyword
2018-04-30 13:28 ` Eric Sandeen
@ 2018-04-30 13:43 ` Jan Tulak
0 siblings, 0 replies; 5+ messages in thread
From: Jan Tulak @ 2018-04-30 13:43 UTC (permalink / raw)
To: Eric Sandeen; +Cc: Darrick J. Wong, linux-xfs
On Mon, Apr 30, 2018 at 3:28 PM, Eric Sandeen <sandeen@sandeen.net> wrote:
>
> On 4/30/18 12:30 AM, Darrick J. Wong wrote:
>> On Sun, Apr 29, 2018 at 08:15:28PM -0500, Eric Sandeen wrote:
>>> It was pointed out on irc that fsck.xfs uses the 'function' keyword
>>> although it invokes /bin/sh - 'function' is a bashism. It's not needed
>>> here, so just remove it.
>>>
>>> Fixes: 04a2d5d ("fsck.xfs: allow forced repairs using xfs_repair")
>>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>>
>> Does RHEL have 'checkbashisms'?
>
> Hm, yes, Fedora & RHEL have it in devscripts-minimal.
>
> $ checkbashisms ./fsck/xfs_fsck.sh
> possible bashism in ./fsck/xfs_fsck.sh line 9 ('function' is useless):
> function repair2fsck_code() {
> possible bashism in ./fsck/xfs_fsck.sh line 62 ('command' with option other than -p):
> XFS_REPAIR=`command -v xfs_repair`
>
> Apparently -v is only part of "User Portability Utilities?"
>
I think so. Is it any problem? If so, I will try to find some other
way how to search in PATH.
Jan
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2018-04-30 13:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-30 1:15 [PATCH] fsck.xfs: do not use 'function' keyword Eric Sandeen
2018-04-30 5:30 ` Darrick J. Wong
2018-04-30 13:28 ` Eric Sandeen
2018-04-30 13:43 ` Jan Tulak
2018-04-30 7:46 ` Jan Tulak
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox