Re: [gtk-osx-users] Errors during gtk3-launcher.sh execution.



Hello John,

Le 1 févr. 2020 à 01:58, John Ralls <jralls ceridwen us> a écrit :

On Jan 31, 2020, at 9:27 AM, Pascal <p p14 orange fr> wrote:

Hello John,

I have make some changes, see:
https://github.com/Blady-Com/gtk-mac-bundler/tree/proposal01

a) "test -n" seems not equivalent to "test ! -z" on Catalina:
c=toto
d=
if test -n $c; then echo nc; fi
if test -n $d; then echo nd; fi
if test -z $c; then echo zc; fi
if test -z $d; then echo zd; fi
gives with Catalina:
nc
nd
zd
instead of:
nc
zd
I haven't found any clue on Internet.

b) test "-a" or "-o" options seems working but not every where.
Information about on Internet is confusing.

c) line 44, LC_MESSAGES is unset but used just after, is it correct ?


Pascal,

a) Use [[ -n $d ]]... works, test and [ -n $d ] don't. Interestingly the zsh man page has a warning about 
that.

Yes, it works.
if [[ -n $c ]]; then echo ncc; fi

b) I suspect the solution is the same, so all instances of test should change to [[ ... ]].

It doesn't work with direct replacements of test occurrences:
syntax error in conditional expression
syntax error near `-a'
 `if [[ -z $d -a -n $c  ]]; then'

I change for:
if [[ -z $d ]] && [[ -n $c ]]; then

c) It's perhaps redundant but it makes it clear that we're clearing all of the localization environment 
variables to set them from defaults.

Ah ok, I've mismatched the var name with the folder name.

I guess I should mention that I never found the shell-script method of setting localization to work all 
that well and in GnuCash and Gramps I wrote lower-level code to do it better. That's easiest for programs 
coded in C/C++ because you can call the NSLocale functions directly and parse the results; in Python you 
still have to shell out to `defaults` because the alternative is importing the rather heavyweight pyobjc 
into your project.

One other note on your commit: There's a bunch of odd-looking whitespace changes. Make sure that you use 
only spaces for indentation, GitHub doesn't display tabs consistently.

Good point, I've  changed for spaces.

I've sent a pull request:
https://github.com/jralls/gtk-mac-bundler/pull/11

Regards, Pascal.
https://blady.pagesperso-orange.fr




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]