[PATCH] tests: add compatibility layer
Tomi Ollila
tomi.ollila at iki.fi
Tue Dec 20 21:12:12 PST 2016
On Wed, Dec 21 2016, David Bremner <david at tethera.net> wrote:
> mp39590 at gmail.com writes:
>
>>
>> +# OS independent functions
>> +#
>> +# Alias native BSD utilities to usable GNU equivalents.
>> +case `uname` in
>> +FreeBSD)
>> + # allow using aliases in scripts
>> + shopt -s expand_aliases
>> +
>> + alias date=gdate
>> + alias base64=gbase64
>> + alias gdb=$BSD_GDB
>> + alias wc=gwc
>> + alias sed="gsed"
>> + alias sha256sum=gsha256sum
>> + ;;
>> +esac
>> +
>
> What about adding (most of) this to sh.config by the configure script?
> I'd like to centralize all hacky platform detection there.
configure already checks kernel name $(uname) and -s is default so
that info could be written to sh.config. (uname=$uname or something)
the alias thing cannot be done in sh.config as that is bash spesific...
... but, alias is not needed; sed () { gsed "$@"; } eg...
... but still, I'd not start messing sh.config with anything else
than variable settings... until there is need for such thing outside
test scripts...
so far gwc would not be needed is $((`... | wc -l`))'s are used there.
have to check where gsha256sum is currently used...
..
Tomi
>
> Also, why is gsed in quotes but none of the others are?
> _______________________________________________
> notmuch mailing list
> notmuch at notmuchmail.org
> https://notmuchmail.org/mailman/listinfo/notmuch
More information about the notmuch
mailing list