FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo Alt

 
 
LinkBack Thread Tools
 
Old 09-15-2010, 02:37 PM
Florian CROUZAT
 
Default Prefix/Cygwin: Cygwins .exe magic lacking in directory listings

On 15 sept. 2010, at 14:46, Al wrote:

> I needed to fix a shell expression in python.eselect to match
> "python2.6.exe". Currently it is "ls python2.?" and would match
> "python2.6" but not the Cygwin binary with the .exe suffix.
>
> [...]
>
> Question: What is a clean fix to match both cases?
>
> I tried this
>
> "ls python2.?{,.exe}"
>
> but the result is:
>
> ls: cannot access python2.?: No such file or directory
> python2.6.exe

Works here, using bash4, of course.
It even works with "bash --norc" and every "shopt" off.
Can't see what's your issue(s) here.

Otherwise, just repeat the "?", see the second ls bellow (both work for me)
$ touch python2.6{,.exe,-config} ; ls python2.?{,.exe} ; ls python2.{?,?.exe} ; ls python2.6*

-----
Florian.
/ For security reasons, all text in this mail
is double-rot13 encrypted. /
 
Old 09-15-2010, 02:42 PM
Markus Duft
 
Default Prefix/Cygwin: Cygwins .exe magic lacking in directory listings

On 09/15/2010 04:37 PM, Florian CROUZAT wrote:


On 15 sept. 2010, at 14:46, Al wrote:


I needed to fix a shell expression in python.eselect to match
"python2.6.exe". Currently it is "ls python2.?" and would match
"python2.6" but not the Cygwin binary with the .exe suffix.

[...]

Question: What is a clean fix to match both cases?

I tried this

"ls python2.?{,.exe}"

but the result is:

ls: cannot access python2.?: No such file or directory
python2.6.exe


Works here, using bash4, of course.
It even works with "bash --norc" and every "shopt" off.
Can't see what's your issue(s) here.

Otherwise, just repeat the "?", see the second ls bellow (both work for me)
$ touch python2.6{,.exe,-config} ; ls python2.?{,.exe} ; ls python2.{?,?.exe} ; ls python2.6*


you're creating a python-2.6 file, which does _not_ exist in the cygwin
build... thats the actual problem... you'll have to try with only the
.exe and -config file, but without the file without extension for the
cygwin case. the same expression has to work for the _other_ case, where
there is a python-2.6 without .exe and the -config file...


wow... anybody understands this? slightly messy thought-flow...

markus



-----
Florian.
/ For security reasons, all text in this mail
is double-rot13 encrypted. /
 
Old 09-15-2010, 02:46 PM
Al
 
Default Prefix/Cygwin: Cygwins .exe magic lacking in directory listings

>> *"ls python2.?{,.exe}"
>>
>> but the result is:
>>
>> ls: cannot access python2.?: No such file or directory
>> python2.6.exe
>
> Works here, using bash4, of course.

Also here bash4.

> It even works with "bash --norc" and every "shopt" off.
> Can't see what's your issue(s) here.

Hmm, it,s {,.exe} which tests two variants:

python2.x and python2.x.exe

The first doesn't exist, hence the error. The second is found as python2.6.exe

What I really want to code is:

Find python2.? with or without the .exe suffix!

> Otherwise, just repeat the "?", see the second ls bellow (both work for me)
> *$ touch python2.6{,.exe,-config} ; ls python2.?{,.exe} ; ls python2.{?,?.exe} ; ls python2.6*
>

Gonna try. Thanks.

Al
 
Old 09-15-2010, 02:59 PM
Florian CROUZAT
 
Default Prefix/Cygwin: Cygwins .exe magic lacking in directory listings

On 15 sept. 2010, at 16:46, Al wrote:

> The first doesn't exist, hence the error. The second is found as python2.6.exe

Oh ok, I thought they both co-existed, nvm.

> What I really want to code is:
>
> Find python2.? with or without the .exe suffix!

Well it's easy using chained commands, but a single bash expansion will fail as some point as you seen and make the whole command fail.

Something like this maybe :

if [ -f python2.? ] ; then
echo "python2.6 stuff"
elif [ -f python2.?.exe ] ; then
echo "in python2.6.exe stuff"
else
echo "error ?"
fi

-----
Florian.
/ For security reasons, all text in this mail
is double-rot13 encrypted. /
 
Old 09-15-2010, 03:22 PM
Al
 
Default Prefix/Cygwin: Cygwins .exe magic lacking in directory listings

> Well it's easy using chained commands, but a single bash expansion will fail as some point as you seen and make the whole command fail.

possible workaroud: pipe errors to /dev/null.

>
> Something like this maybe :
>
> * * * *if [ -f python2.? ] ; then
> * * * * * * * *echo "python2.6 stuff"
> * * * *elif [ -f python2.?.exe ] ; then
> * * * * * * * *echo "in python2.6.exe stuff"
> * * * *else
> * * * * * * * *echo "error ?"
> * * * *fi
>

Ooops. That will blow up the code. There are 5 or 6 occurrances of
this in the file. How about putting the suffix itself into a variable?

For now I took the easy way by simply appending the .exe suffix. At
least the python package is merged now, but some modules are broken.

So the final solution has to wait a little. I will try to emerge
portage now. If it works the second milestone is reached.

Al
 
Old 09-15-2010, 03:25 PM
Al
 
Default Prefix/Cygwin: Cygwins .exe magic lacking in directory listings

>
> you're creating a python-2.6 file, which does _not_ exist in the cygwin
> build... thats the actual problem... you'll have to try with only the .exe
> and -config file, but without the file without extension for the cygwin
> case. the same expression has to work for the _other_ case, where there is a
> python-2.6 without .exe and the -config file...
>
> wow... anybody understands this? slightly messy thought-flow...

Matches exactly my own thought fow ... ;-)

Al
 

Thread Tools




All times are GMT. The time now is 11:52 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org