* [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment
@ 2014-07-08 15:09 Vitaliy Kharin
2014-07-08 18:54 ` Christopher Larson
0 siblings, 1 reply; 5+ messages in thread
From: Vitaliy Kharin @ 2014-07-08 15:09 UTC (permalink / raw)
To: bitbake-devel; +Cc: Vitaliy Kharin
Signed-off-by: Vitaliy Kharin <vitaliy.kharin@lge.com>
---
bitbake/lib/bb/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 0be45e1..c48b237 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -809,7 +809,7 @@ def which(path, item, direction = 0, history = False):
for p in paths:
next = os.path.join(p, item)
hist.append(next)
- if os.path.exists(next):
+ if os.path.isfile(next):
if not os.path.isabs(next):
next = os.path.abspath(next)
if history:
--
2.0.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment
2014-07-08 15:09 [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment Vitaliy Kharin
@ 2014-07-08 18:54 ` Christopher Larson
2014-07-09 10:43 ` Vitaliy Kharin
0 siblings, 1 reply; 5+ messages in thread
From: Christopher Larson @ 2014-07-08 18:54 UTC (permalink / raw)
To: Vitaliy Kharin; +Cc: Vitaliy Kharin, bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 1002 bytes --]
On Tue, Jul 8, 2014 at 8:09 AM, Vitaliy Kharin <kvserr@gmail.com> wrote:
> Signed-off-by: Vitaliy Kharin <vitaliy.kharin@lge.com>
> ---
> bitbake/lib/bb/utils.py | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
> index 0be45e1..c48b237 100644
> --- a/bitbake/lib/bb/utils.py
> +++ b/bitbake/lib/bb/utils.py
> @@ -809,7 +809,7 @@ def which(path, item, direction = 0, history = False):
> for p in paths:
> next = os.path.join(p, item)
> hist.append(next)
> - if os.path.exists(next):
> + if os.path.isfile(next):
> if not os.path.isabs(next):
> next = os.path.abspath(next)
> if history:
>
This seems questionable to me. With this, it wouldn't find symlinks, no?
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 1651 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment
2014-07-08 18:54 ` Christopher Larson
@ 2014-07-09 10:43 ` Vitaliy Kharin
2014-07-09 14:59 ` Christopher Larson
0 siblings, 1 reply; 5+ messages in thread
From: Vitaliy Kharin @ 2014-07-09 10:43 UTC (permalink / raw)
To: Christopher Larson; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]
Actually it would return true if path will be a symlink. I checked it.
Also please look at
https://docs.python.org/2/library/os.path.html#os.path.isfile
"...This follows symbolic links, so both islink()
<https://docs.python.org/2/library/os.path.html#os.path.islink> and isfile()
<https://docs.python.org/2/library/os.path.html#os.path.isfile> can be true
for the same path."
2014-07-08 22:54 GMT+04:00 Christopher Larson <clarson@kergoth.com>:
>
> On Tue, Jul 8, 2014 at 8:09 AM, Vitaliy Kharin <kvserr@gmail.com> wrote:
>
>> Signed-off-by: Vitaliy Kharin <vitaliy.kharin@lge.com>
>> ---
>> bitbake/lib/bb/utils.py | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
>> index 0be45e1..c48b237 100644
>> --- a/bitbake/lib/bb/utils.py
>> +++ b/bitbake/lib/bb/utils.py
>> @@ -809,7 +809,7 @@ def which(path, item, direction = 0, history = False):
>> for p in paths:
>> next = os.path.join(p, item)
>> hist.append(next)
>> - if os.path.exists(next):
>> + if os.path.isfile(next):
>> if not os.path.isabs(next):
>> next = os.path.abspath(next)
>> if history:
>>
>
> This seems questionable to me. With this, it wouldn't find symlinks, no?
> --
> Christopher Larson
> clarson at kergoth dot com
> Founder - BitBake, OpenEmbedded, OpenZaurus
> Maintainer - Tslib
> Senior Software Engineer, Mentor Graphics
>
--
-----------------------
Best regards,
Vitaliy Kharin
[-- Attachment #2: Type: text/html, Size: 3906 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment
2014-07-09 10:43 ` Vitaliy Kharin
@ 2014-07-09 14:59 ` Christopher Larson
0 siblings, 0 replies; 5+ messages in thread
From: Christopher Larson @ 2014-07-09 14:59 UTC (permalink / raw)
To: Vitaliy Kharin; +Cc: bitbake-devel
[-- Attachment #1: Type: text/plain, Size: 699 bytes --]
On Wed, Jul 9, 2014 at 3:43 AM, Vitaliy Kharin <kvserr@gmail.com> wrote:
> Actually it would return true if path will be a symlink. I checked it.
> Also please look at
> https://docs.python.org/2/library/os.path.html#os.path.isfile
> "...This follows symbolic links, so both islink()
> <https://docs.python.org/2/library/os.path.html#os.path.islink> and
> isfile() <https://docs.python.org/2/library/os.path.html#os.path.isfile> can
> be true for the same path."
>
Ah, good, I stand corrected. Thanks for the clarification.
--
Christopher Larson
clarson at kergoth dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Maintainer - Tslib
Senior Software Engineer, Mentor Graphics
[-- Attachment #2: Type: text/html, Size: 2365 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment
@ 2014-07-08 15:21 Vitaliy Kharin
0 siblings, 0 replies; 5+ messages in thread
From: Vitaliy Kharin @ 2014-07-08 15:21 UTC (permalink / raw)
To: bitbake-devel; +Cc: Vitaliy Kharin
Signed-off-by: Vitaliy Kharin <vitaliy.kharin@lge.com>
---
bitbake/lib/bb/utils.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bitbake/lib/bb/utils.py b/bitbake/lib/bb/utils.py
index 0be45e1..c48b237 100644
--- a/bitbake/lib/bb/utils.py
+++ b/bitbake/lib/bb/utils.py
@@ -809,7 +809,7 @@ def which(path, item, direction = 0, history = False):
for p in paths:
next = os.path.join(p, item)
hist.append(next)
- if os.path.exists(next):
+ if os.path.isfile(next):
if not os.path.isabs(next):
next = os.path.abspath(next)
if history:
--
2.0.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-07-09 15:00 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08 15:09 [PATCH] bb.utils.which is intend to locate regular file only as it is written in comment Vitaliy Kharin
2014-07-08 18:54 ` Christopher Larson
2014-07-09 10:43 ` Vitaliy Kharin
2014-07-09 14:59 ` Christopher Larson
2014-07-08 15:21 Vitaliy Kharin
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.