A more developer related question from the help list.
---------- Forwarded message ---------
From: Stefan Skoglund <[email protected]>
Date: Sun, Aug 26, 2018 at 7:16 PM
Subject: Re: [help-cfengine] checking contents in files
To: <[email protected]>
sön 2018-08-26 klockan 23:05 +0100 skrev Tina Friedrich:
> It depends a little bit on what you really want, I guess? If this is
> really
> just about setting a class case 'apt-listbugs' isn't ASCII, I'd use
> 'returnszero' - something like
>
> classes:
> ascii => returnszero("/usr/bin/file /etc/apt/listbugs/ignore_bugs |
> /bin/grep
> -q ASCII","useshell");
>
> If I want a list of files that aren't ASCII, I'd probably go for a
> module, as
> well.
>
> However, I'd actually be tempted to simply run 'iconv' or 'uni2ascii'
> over it
> from time to time - probably not every CFEngine run (depending how
> often you
> run the agent)? Sort of thinking that you'd be calling to file to
> determine
> whether it's okay, and then probably to iconv/uni2ascii or so anyway,
> might as
> well not bother with the call to 'file'...
iconv is good enough i think.
The reason is that the apt_get package module hardcodes LC_ALL to 'C'
which give ruby in apt-listbugs the fits
if something inside an comment in apt/listbugs/ignore_bugs isn't ASCII
(and i seems to like to drop non-ascii characters inside that file.)
--
You received this message because you are subscribed to the Google Groups
"help-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/help-cfengine.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"dev-cfengine" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/dev-cfengine/CAE46pPun3nUjzzZU51tu27zzpBZtJs-f0MDNVCrd9w4PxObUxQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.