Re: [OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-17 Thread Leonardo Sandoval
Ross/Raj, thanks for your comments. I will send a v2 patches, this time 
with the correct checks (invalid characters are those non-UTF8) and 
patch titles.


On 08/13/2015 02:34 PM, Burton, Ross wrote:

On 13 August 2015 at 20:21, Khem Raj  wrote:


but check it still fine isnt it.



Of course, gracefully handling encoding failures is still sensible.

Ross


--
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-13 Thread Burton, Ross
On 13 August 2015 at 20:21, Khem Raj  wrote:

> but check it still fine isnt it.
>

Of course, gracefully handling encoding failures is still sensible.

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-13 Thread Burton, Ross
On 13 August 2015 at 20:31, Mark Hatle  wrote:

> RPM isn't really utf-8.. it's more single 8-bit characters...  UTF-8 (1
> byte
> characters) work fine.. multibyte are not promised to work.
>
> If you need special encoding (more then 8-bit characters) then you should
> be
> using 'po' style files to translate the 8-bit chars to localized
> versions...
>
> So checking (and fixing) the strings for various things is a good idea for
> RPM
> at least.
>

In the common case of "maintainer's name isn't ASCII" you don't want it
translated, and assuming UTF-8 everywhere mostly works.

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-13 Thread Mark Hatle
On 8/13/15 2:21 PM, Khem Raj wrote:
> On Thu, Aug 13, 2015 at 12:05 PM, Burton, Ross  wrote:
>> Debian control files are defined to be UTF-8, so the use of an ASCII
>> encoding method is wrong
>> (https://www.debian.org/doc/debian-policy/ch-controlfields.html).
>>
>> (RPM appears to assume UTF-8 too)
> 
> but check it still fine isnt it.
> 

RPM isn't really utf-8.. it's more single 8-bit characters...  UTF-8 (1 byte
characters) work fine.. multibyte are not promised to work.

If you need special encoding (more then 8-bit characters) then you should be
using 'po' style files to translate the 8-bit chars to localized versions...

So checking (and fixing) the strings for various things is a good idea for RPM
at least.

--Mark
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-13 Thread Khem Raj
On Thu, Aug 13, 2015 at 12:05 PM, Burton, Ross  wrote:
> Debian control files are defined to be UTF-8, so the use of an ASCII
> encoding method is wrong
> (https://www.debian.org/doc/debian-policy/ch-controlfields.html).
>
> (RPM appears to assume UTF-8 too)

but check it still fine isnt it.
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-13 Thread Burton, Ross
On 13 August 2015 at 09:58, 
wrote:

> On package creation, handle exception when encoding non-ASCII characteres.
>

Debian control files are defined to be UTF-8, so the use of an ASCII
encoding method is wrong (
https://www.debian.org/doc/debian-policy/ch-controlfields.html).

(RPM appears to assume UTF-8 too)

Ross
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH 2/2] package_deb.bbclass: Handle exception when encoding non-ASCII characters

2015-08-13 Thread leonardo . sandoval . gonzalez
From: Leonardo Sandoval 

On package creation, handle exception when encoding non-ASCII characteres.

[YOCTO #6693]

Signed-off-by: Leonardo Sandoval 
---
 meta/classes/package_deb.bbclass | 4 
 1 file changed, 4 insertions(+)

diff --git a/meta/classes/package_deb.bbclass b/meta/classes/package_deb.bbclass
index 9e1ed28..374adb6 100644
--- a/meta/classes/package_deb.bbclass
+++ b/meta/classes/package_deb.bbclass
@@ -171,6 +171,10 @@ python do_package_deb () {
 bb.utils.unlockfile(lf)
 ctrlfile.close()
 raise bb.build.FuncFailed("Missing field for deb generation: %s" % 
value)
+except UnicodeDecodeError:
+bb.utils.unlockfile(lf)
+ctrlfile.close()
+raise bb.build.FuncFailed("Non-ASCII characters found in one of 
the fields")
 # more fields
 
 custom_fields_chunk = get_package_additional_metadata("deb", localdata)
-- 
1.8.4.5

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core