Skip to Content.
Sympa Menu

sm-commit - Re: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (a3e5e92d7f4d8536f0645e5fa03b2d969721237d)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Jaka Kranjc <smgl AT lynxlynx.info>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: Re: [SM-Commit] GIT changes to master sorcery by Jaka Kranjc (a3e5e92d7f4d8536f0645e5fa03b2d969721237d)
  • Date: Mon, 5 Jul 2010 09:33:35 +0200

On Monday 05 of July 2010 08:10:35 flux wrote:
> Jaka Kranjc (scm AT sourcemage.org) wrote [10.07.05 04:23]:
> > GIT changes to master sorcery by Jaka Kranjc
> > <lynxlynxlynx AT sourcemage.org>:
> >
> > ChangeLog | 3 +++
> > var/lib/sorcery/modules/libdispel | 2 +-
> > var/lib/sorcery/modules/libtrack | 2 +-
> > 3 files changed, 5 insertions(+), 2 deletions(-)
> >
> > New commits:
> > commit a3e5e92d7f4d8536f0645e5fa03b2d969721237d
> > Author: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
> > Commit: Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
> >
> > libtrack, libdispel: use the correct whole-line option for grep
> > fixes the "grep: invalid matcher blabla" errors
> >
> > thanks to PyroBor for finding the cause
> >
> > diff --git a/ChangeLog b/ChangeLog
> > index 1b65271..c078fa2 100644
> > --- a/ChangeLog
> > +++ b/ChangeLog
> > @@ -1,3 +1,6 @@
> > +2010-07-04 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
> > + * libtrack, libdispel: use the correct whole-line option for grep
> > +
> > 2009-10-16 Jaka Kranjc <lynxlynxlynx AT sourcemage.org>
> > * libtrack, libdispel: match complete lines when comparing md5s, fixes
> > part of #15192
> > diff --git a/var/lib/sorcery/modules/libdispel
> > b/var/lib/sorcery/modules/libdispel index 4eb91c9..06c09b8 100755
> > --- a/var/lib/sorcery/modules/libdispel
> > +++ b/var/lib/sorcery/modules/libdispel
> > @@ -48,7 +48,7 @@ function reap_config_files() {
> >
> > md5=$(md5sum "$FILE")
> > orig="$SCRIPT_DIRECTORY/init.d/${FILE##*/}.conf"
> > - if grep -qX "$md5" "$MD5S"; then
> > + if grep -qx "$md5" "$MD5S"; then
> > debug libdispel "$FILE is a config file that hasnt changed,
> > removing..." rm -f "$FILE"
> > # this check only handles sysconfig files, since they're the only
> > ones diff --git a/var/lib/sorcery/modules/libtrack
> > b/var/lib/sorcery/modules/libtrack index 2399d32..49b3921 100755
> > --- a/var/lib/sorcery/modules/libtrack
> > +++ b/var/lib/sorcery/modules/libtrack
> > @@ -322,7 +322,7 @@ function check_if_modified() {
> > fi
> > fi
> > local my_md5=$(md5sum "$to")
> > - if test -f "$md5_log" && grep -qX "$my_md5" "$md5_log"; then
> > + if test -f "$md5_log" && grep -qx "$my_md5" "$md5_log"; then
> > false
> > else
> > true
>
> Be careful about this, as -X seems to be a newer grep flag, so I think
> this will break for anyone who hasn't updated in a while. I just tested
> this with grep 2.5.4 and it didn't work as intended.
-X has been in grep at least since 2005, when a comment was added to the
source that it is purposefully undocumented. The function of this option
hasn't changed since then (matcher mode selection), but now there's a bit
more error checking. Anyway, the purpose of this commit was to remove the X,
not add it and 2.5 (and 2.4 and possibly even older) do support -x.
So what did you try that made you think this doesn't work?

> Couldn't the same result also be achieved by simply using proper anchors
> in the regexp, rather than relying on the flag?
Sure.

LP
--
We cannot command nature except by obeying her. --Sir Francis Bacon
Have a sourcerous day! www.sourcemage.org

Attachment: signature.asc
Description: This is a digitally signed message part.




Archive powered by MHonArc 2.6.24.

Top of Page