Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 423214 Details for
Bug 571444
Portage fails with AssertionError under MUSL when using EAPI=6.
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
C code for a python module to check locales for portage
check_locales.c (text/x-csrc), 2.38 KB, created by
Anthony Basile
on 2016-01-18 09:41:12 UTC
(
hide
)
Description:
C code for a python module to check locales for portage
Filename:
MIME Type:
Creator:
Anthony Basile
Created:
2016-01-18 09:41:12 UTC
Size:
2.38 KB
patch
obsolete
>/* > check-locales.c: this file is part of ???? > Copyright (C) 2016 Anthony G. Basile > > This program is free software: you can redistribute it and/or modify > it under the terms of the GNU General Public License as published by > the Free Software Foundation, either version 3 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program. If not, see <http://www.gnu.org/licenses/>. >*/ > >#include <Python.h> >#include <ctype.h> > >static PyObject * portage_check_locales(PyObject *, PyObject *); > >static PyMethodDef CheckLocalesMethods[] = { > {"portage_check_locales", portage_check_locales, METH_NOARGS, "Check the system locales."}, > {NULL, NULL, 0, NULL} >}; > >#if PY_MAJOR_VERSION >= 3 >static struct PyModuleDef moduledef = { > PyModuleDef_HEAD_INIT, > "check_locales", /* m_name */ > "Module for checking the system locales for portage", /* m_doc */ > -1, /* m_size */ > CheckLocalesMethods, /* m_methods */ > NULL, /* m_reload */ > NULL, /* m_traverse */ > NULL, /* m_clear */ > NULL, /* m_free */ >}; >#endif > >static PyObject *LocalesError; > >PyMODINIT_FUNC >#if PY_MAJOR_VERSION >= 3 >PyInit_check_locales(void) >#else >initcheck_locales(void) >#endif >{ > PyObject *m; > >#if PY_MAJOR_VERSION >= 3 > m = PyModule_Create(&moduledef); >#else > m = Py_InitModule("check_locales", CheckLocalesMethods); >#endif > > if (m == NULL) >#if PY_MAJOR_VERSION >= 3 > return NULL; >#else > return; >#endif > > LocalesError = PyErr_NewException("locales.LocalesError", NULL, NULL); > Py_INCREF(LocalesError); > PyModule_AddObject(m, "LocalesError", LocalesError); > >#if PY_MAJOR_VERSION >= 3 > return m; >#else > return; >#endif >} > > >static PyObject * >portage_check_locales(PyObject *self, PyObject *args) >{ > int i, pass = 1; > int lc[26], uc[26], rlc[26], ruc[26]; > > for(i = 'a'; i <= 'z'; i++) { > lc[i-'a'] = i; > ruc[i-'a'] = toupper(i); > } > for(i = 'A'; i <= 'Z'; i++) { > uc[i-'A'] = i; > rlc[i-'A'] = tolower(i); > } > > for( i = 'a'; i <= 'z'; i++) { > if(lc[i-'a'] != rlc[i-'a']) { > pass = 0; > break; > } > if(uc[i-'a'] != ruc[i-'a']) { > pass = 0; > break; > } > } > > return Py_BuildValue("i", pass); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 571444
:
422436
|
422474
| 423214 |
423218