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: flux <flux AT sourcemage.org>
  • 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 15:10:35 +0900

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.

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

--
Justin "flux_control" Boffemmyer
Cauldron wizard and general mage
Source Mage GNU/Linux
http://www.sourcemage.org

Attachment: pgpHNLFr0DFNO.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page