* [PATCH] common/{filter,quota}, xfs/1{06,52}: fix grep pattern
@ 2023-05-16 8:19 Murphy Zhou
2023-05-17 1:28 ` Zorro Lang
0 siblings, 1 reply; 4+ messages in thread
From: Murphy Zhou @ 2023-05-16 8:19 UTC (permalink / raw)
To: fstests
Newer(3.9) grep is complaining about these unnecessary
backslashes before # and -, and breaking the golden output.
Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
---
common/filter | 2 +-
common/quota | 2 +-
tests/xfs/106 | 4 ++--
tests/xfs/152 | 4 ++--
4 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/common/filter b/common/filter
index 3e3fea7e..f10ba78a 100644
--- a/common/filter
+++ b/common/filter
@@ -293,7 +293,7 @@ _filter_project_quota()
# until the GETNEXTQUOTA ioctl came into use. Filter it out.
# But if you specify a name for ID 0, that means you want to
# deal with it by yourself, this function won't filter it out.
- _filter_quota | grep -v "^\#0 \|^(null) "
+ _filter_quota | grep -v "^#0 \|^(null) "
}
# Account for different "ln" failure messages
diff --git a/common/quota b/common/quota
index 96b8d044..0a526e07 100644
--- a/common/quota
+++ b/common/quota
@@ -191,7 +191,7 @@ _scratch_enable_pquota()
_require_setquota_project()
{
setquota --help 2>&1 | \
- grep -q "\-P, \-\-project[[:space:]]*set limits for project"
+ grep -q "\-P, \--project[[:space:]]*set limits for project"
if [ "$?" -ne 0 ];then
_notrun "setquota doesn't support project quota (-P)"
fi
diff --git a/tests/xfs/106 b/tests/xfs/106
index fc2281af..388873bd 100755
--- a/tests/xfs/106
+++ b/tests/xfs/106
@@ -59,13 +59,13 @@ clean_files()
filter_quot()
{
- _filter_quota | grep -v "root \|\#0 " \
+ _filter_quota | grep -v "root \|#0 " \
| sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
}
filter_report()
{
- _filter_quota | grep -v "^root \|^\#0 " \
+ _filter_quota | grep -v "^root \|^#0 " \
| sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
}
diff --git a/tests/xfs/152 b/tests/xfs/152
index dd33801d..325a05c1 100755
--- a/tests/xfs/152
+++ b/tests/xfs/152
@@ -98,13 +98,13 @@ clean_files()
filter_quot()
{
- _filter_quota | grep -v "root \|\#0 " \
+ _filter_quota | grep -v "root \|#0 " \
| sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
}
filter_report()
{
- _filter_quota | grep -v "^root \|^\#0 " \
+ _filter_quota | grep -v "^root \|^#0 " \
| sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
}
--
2.31.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] common/{filter,quota}, xfs/1{06,52}: fix grep pattern
2023-05-16 8:19 [PATCH] common/{filter,quota}, xfs/1{06,52}: fix grep pattern Murphy Zhou
@ 2023-05-17 1:28 ` Zorro Lang
2023-05-17 6:35 ` Murphy Zhou
0 siblings, 1 reply; 4+ messages in thread
From: Zorro Lang @ 2023-05-17 1:28 UTC (permalink / raw)
To: Murphy Zhou; +Cc: fstests
On Tue, May 16, 2023 at 04:19:35PM +0800, Murphy Zhou wrote:
> Newer(3.9) grep is complaining about these unnecessary
> backslashes before # and -, and breaking the golden output.
Better to show what kind of warning output breaks the golden image
at here.
>
> Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> ---
> common/filter | 2 +-
> common/quota | 2 +-
> tests/xfs/106 | 4 ++--
> tests/xfs/152 | 4 ++--
> 4 files changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/common/filter b/common/filter
> index 3e3fea7e..f10ba78a 100644
> --- a/common/filter
> +++ b/common/filter
> @@ -293,7 +293,7 @@ _filter_project_quota()
> # until the GETNEXTQUOTA ioctl came into use. Filter it out.
> # But if you specify a name for ID 0, that means you want to
> # deal with it by yourself, this function won't filter it out.
> - _filter_quota | grep -v "^\#0 \|^(null) "
> + _filter_quota | grep -v "^#0 \|^(null) "
> }
>
> # Account for different "ln" failure messages
> diff --git a/common/quota b/common/quota
> index 96b8d044..0a526e07 100644
> --- a/common/quota
> +++ b/common/quota
> @@ -191,7 +191,7 @@ _scratch_enable_pquota()
> _require_setquota_project()
> {
> setquota --help 2>&1 | \
> - grep -q "\-P, \-\-project[[:space:]]*set limits for project"
> + grep -q "\-P, \--project[[:space:]]*set limits for project"
I think this change isn't enough, might still trigger the "grep: warning:
stray \ before -" warning. Better to change this line as:
grep -q -- "-P, --project[[:space:]]*set limits for project"
Please confirm if it helps.
Thanks,
Zorro
> if [ "$?" -ne 0 ];then
> _notrun "setquota doesn't support project quota (-P)"
> fi
> diff --git a/tests/xfs/106 b/tests/xfs/106
> index fc2281af..388873bd 100755
> --- a/tests/xfs/106
> +++ b/tests/xfs/106
> @@ -59,13 +59,13 @@ clean_files()
>
> filter_quot()
> {
> - _filter_quota | grep -v "root \|\#0 " \
> + _filter_quota | grep -v "root \|#0 " \
> | sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
> }
>
> filter_report()
> {
> - _filter_quota | grep -v "^root \|^\#0 " \
> + _filter_quota | grep -v "^root \|^#0 " \
> | sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
> }
>
> diff --git a/tests/xfs/152 b/tests/xfs/152
> index dd33801d..325a05c1 100755
> --- a/tests/xfs/152
> +++ b/tests/xfs/152
> @@ -98,13 +98,13 @@ clean_files()
>
> filter_quot()
> {
> - _filter_quota | grep -v "root \|\#0 " \
> + _filter_quota | grep -v "root \|#0 " \
> | sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
> }
>
> filter_report()
> {
> - _filter_quota | grep -v "^root \|^\#0 " \
> + _filter_quota | grep -v "^root \|^#0 " \
> | sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
> }
>
> --
> 2.31.1
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] common/{filter,quota}, xfs/1{06,52}: fix grep pattern
2023-05-17 1:28 ` Zorro Lang
@ 2023-05-17 6:35 ` Murphy Zhou
2023-05-17 8:20 ` Murphy Zhou
0 siblings, 1 reply; 4+ messages in thread
From: Murphy Zhou @ 2023-05-17 6:35 UTC (permalink / raw)
To: Zorro Lang; +Cc: Murphy Zhou, fstests
On Wed, May 17, 2023 at 9:30 AM Zorro Lang <zlang@redhat.com> wrote:
>
> On Tue, May 16, 2023 at 04:19:35PM +0800, Murphy Zhou wrote:
> > Newer(3.9) grep is complaining about these unnecessary
> > backslashes before # and -, and breaking the golden output.
>
> Better to show what kind of warning output breaks the golden image
> at here.
>
> >
> > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> > ---
> > common/filter | 2 +-
> > common/quota | 2 +-
> > tests/xfs/106 | 4 ++--
> > tests/xfs/152 | 4 ++--
> > 4 files changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/common/filter b/common/filter
> > index 3e3fea7e..f10ba78a 100644
> > --- a/common/filter
> > +++ b/common/filter
> > @@ -293,7 +293,7 @@ _filter_project_quota()
> > # until the GETNEXTQUOTA ioctl came into use. Filter it out.
> > # But if you specify a name for ID 0, that means you want to
> > # deal with it by yourself, this function won't filter it out.
> > - _filter_quota | grep -v "^\#0 \|^(null) "
> > + _filter_quota | grep -v "^#0 \|^(null) "
> > }
> >
> > # Account for different "ln" failure messages
> > diff --git a/common/quota b/common/quota
> > index 96b8d044..0a526e07 100644
> > --- a/common/quota
> > +++ b/common/quota
> > @@ -191,7 +191,7 @@ _scratch_enable_pquota()
> > _require_setquota_project()
> > {
> > setquota --help 2>&1 | \
> > - grep -q "\-P, \-\-project[[:space:]]*set limits for project"
> > + grep -q "\-P, \--project[[:space:]]*set limits for project"
>
> I think this change isn't enough, might still trigger the "grep: warning:
> stray \ before -" warning. Better to change this line as:
In my test, it works well. No more warnings.
Thanks,
>
> grep -q -- "-P, --project[[:space:]]*set limits for project"
>
> Please confirm if it helps.
>
> Thanks,
> Zorro
>
> > if [ "$?" -ne 0 ];then
> > _notrun "setquota doesn't support project quota (-P)"
> > fi
> > diff --git a/tests/xfs/106 b/tests/xfs/106
> > index fc2281af..388873bd 100755
> > --- a/tests/xfs/106
> > +++ b/tests/xfs/106
> > @@ -59,13 +59,13 @@ clean_files()
> >
> > filter_quot()
> > {
> > - _filter_quota | grep -v "root \|\#0 " \
> > + _filter_quota | grep -v "root \|#0 " \
> > | sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
> > }
> >
> > filter_report()
> > {
> > - _filter_quota | grep -v "^root \|^\#0 " \
> > + _filter_quota | grep -v "^root \|^#0 " \
> > | sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
> > }
> >
> > diff --git a/tests/xfs/152 b/tests/xfs/152
> > index dd33801d..325a05c1 100755
> > --- a/tests/xfs/152
> > +++ b/tests/xfs/152
> > @@ -98,13 +98,13 @@ clean_files()
> >
> > filter_quot()
> > {
> > - _filter_quota | grep -v "root \|\#0 " \
> > + _filter_quota | grep -v "root \|#0 " \
> > | sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
> > }
> >
> > filter_report()
> > {
> > - _filter_quota | grep -v "^root \|^\#0 " \
> > + _filter_quota | grep -v "^root \|^#0 " \
> > | sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
> > }
> >
> > --
> > 2.31.1
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] common/{filter,quota}, xfs/1{06,52}: fix grep pattern
2023-05-17 6:35 ` Murphy Zhou
@ 2023-05-17 8:20 ` Murphy Zhou
0 siblings, 0 replies; 4+ messages in thread
From: Murphy Zhou @ 2023-05-17 8:20 UTC (permalink / raw)
To: Zorro Lang; +Cc: fstests
Oops, wrong email used. Sorry for the noise.
On Wed, May 17, 2023 at 2:35 PM Murphy Zhou <xzhou@redhat.com> wrote:
>
> On Wed, May 17, 2023 at 9:30 AM Zorro Lang <zlang@redhat.com> wrote:
> >
> > On Tue, May 16, 2023 at 04:19:35PM +0800, Murphy Zhou wrote:
> > > Newer(3.9) grep is complaining about these unnecessary
> > > backslashes before # and -, and breaking the golden output.
> >
> > Better to show what kind of warning output breaks the golden image
> > at here.
> >
> > >
> > > Signed-off-by: Murphy Zhou <jencce.kernel@gmail.com>
> > > ---
> > > common/filter | 2 +-
> > > common/quota | 2 +-
> > > tests/xfs/106 | 4 ++--
> > > tests/xfs/152 | 4 ++--
> > > 4 files changed, 6 insertions(+), 6 deletions(-)
> > >
> > > diff --git a/common/filter b/common/filter
> > > index 3e3fea7e..f10ba78a 100644
> > > --- a/common/filter
> > > +++ b/common/filter
> > > @@ -293,7 +293,7 @@ _filter_project_quota()
> > > # until the GETNEXTQUOTA ioctl came into use. Filter it out.
> > > # But if you specify a name for ID 0, that means you want to
> > > # deal with it by yourself, this function won't filter it out.
> > > - _filter_quota | grep -v "^\#0 \|^(null) "
> > > + _filter_quota | grep -v "^#0 \|^(null) "
> > > }
> > >
> > > # Account for different "ln" failure messages
> > > diff --git a/common/quota b/common/quota
> > > index 96b8d044..0a526e07 100644
> > > --- a/common/quota
> > > +++ b/common/quota
> > > @@ -191,7 +191,7 @@ _scratch_enable_pquota()
> > > _require_setquota_project()
> > > {
> > > setquota --help 2>&1 | \
> > > - grep -q "\-P, \-\-project[[:space:]]*set limits for project"
> > > + grep -q "\-P, \--project[[:space:]]*set limits for project"
> >
> > I think this change isn't enough, might still trigger the "grep: warning:
> > stray \ before -" warning. Better to change this line as:
>
> In my test, it works well. No more warnings.
>
> Thanks,
> >
> > grep -q -- "-P, --project[[:space:]]*set limits for project"
> >
> > Please confirm if it helps.
> >
> > Thanks,
> > Zorro
> >
> > > if [ "$?" -ne 0 ];then
> > > _notrun "setquota doesn't support project quota (-P)"
> > > fi
> > > diff --git a/tests/xfs/106 b/tests/xfs/106
> > > index fc2281af..388873bd 100755
> > > --- a/tests/xfs/106
> > > +++ b/tests/xfs/106
> > > @@ -59,13 +59,13 @@ clean_files()
> > >
> > > filter_quot()
> > > {
> > > - _filter_quota | grep -v "root \|\#0 " \
> > > + _filter_quota | grep -v "root \|#0 " \
> > > | sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
> > > }
> > >
> > > filter_report()
> > > {
> > > - _filter_quota | grep -v "^root \|^\#0 " \
> > > + _filter_quota | grep -v "^root \|^#0 " \
> > > | sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
> > > }
> > >
> > > diff --git a/tests/xfs/152 b/tests/xfs/152
> > > index dd33801d..325a05c1 100755
> > > --- a/tests/xfs/152
> > > +++ b/tests/xfs/152
> > > @@ -98,13 +98,13 @@ clean_files()
> > >
> > > filter_quot()
> > > {
> > > - _filter_quota | grep -v "root \|\#0 " \
> > > + _filter_quota | grep -v "root \|#0 " \
> > > | sed -e '/#[0-9]*/s/#[0-9]*/#ID/g'
> > > }
> > >
> > > filter_report()
> > > {
> > > - _filter_quota | grep -v "^root \|^\#0 " \
> > > + _filter_quota | grep -v "^root \|^#0 " \
> > > | sed -e '/^#[0-9]*/s/^#[0-9]*/#ID/g'
> > > }
> > >
> > > --
> > > 2.31.1
> > >
> >
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-05-17 8:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 8:19 [PATCH] common/{filter,quota}, xfs/1{06,52}: fix grep pattern Murphy Zhou
2023-05-17 1:28 ` Zorro Lang
2023-05-17 6:35 ` Murphy Zhou
2023-05-17 8:20 ` Murphy Zhou
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox