Patchwork [2/2] distro_identifier: replace slash with hyphen

login
register
mail settings
Submitter Mihai Lindner
Date Oct. 26, 2012, 2:37 p.m.
Message ID <c5cc66e7f91378f3be392b0637ed3c655c60bfff.1351261721.git.mihaix.lindner@linux.intel.com>
Download mbox | patch
Permalink /patch/38607/
State Accepted
Commit b4e48cc66c8e16aee6301258b5104d06c16c00dd
Headers show

Comments

Mihai Lindner - Oct. 26, 2012, 2:37 p.m.
Use "-" instead of "/" in "n/a" strings ("Distributor ID" and/or
"Release"), provided by `lsb_release`.
This leads to directories and subdirectories created in ./sstate-cache/
e.g. Distro-n/a/ where "Distro-n" is dir and "a" is subdir.

Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com>
---
 meta/lib/oe/lsb.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Saul Wold - Oct. 28, 2012, 1:20 a.m.
On 10/26/2012 07:37 AM, Mihai Lindner wrote:
> Use "-" instead of "/" in "n/a" strings ("Distributor ID" and/or
> "Release"), provided by `lsb_release`.
> This leads to directories and subdirectories created in ./sstate-cache/
> e.g. Distro-n/a/ where "Distro-n" is dir and "a" is subdir.
>
> Signed-off-by: Mihai Lindner <mihaix.lindner@linux.intel.com>
> ---
>   meta/lib/oe/lsb.py | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
> index c8852a2..9133356 100644
> --- a/meta/lib/oe/lsb.py
> +++ b/meta/lib/oe/lsb.py
> @@ -31,4 +31,4 @@ def distro_identifier(adjust_hook=None):
>           distro_id, release = adjust_hook(distro_id, release)
>       if not distro_id:
>           return "Unknown"
> -    return '{0}-{1}'.format(distro_id, release).replace(' ','-')
> +    return '{0}-{1}'.format(distro_id, release).replace(' ','-').replace('/','-')
>

Merged into OE-Core

Thanks
	Sau!

Patch

diff --git a/meta/lib/oe/lsb.py b/meta/lib/oe/lsb.py
index c8852a2..9133356 100644
--- a/meta/lib/oe/lsb.py
+++ b/meta/lib/oe/lsb.py
@@ -31,4 +31,4 @@  def distro_identifier(adjust_hook=None):
         distro_id, release = adjust_hook(distro_id, release)
     if not distro_id:
         return "Unknown"
-    return '{0}-{1}'.format(distro_id, release).replace(' ','-')
+    return '{0}-{1}'.format(distro_id, release).replace(' ','-').replace('/','-')