Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 613273 Details for
Bug 857653
[RFE, PATCH] No external access to file lists and policy
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch against 4.9, C and python access to fileFile, fileList and policyList
rpm-4.9.x-python-filelists.patch (text/plain), 3.19 KB, created by
Alec Leamas
on 2012-09-15 15:15:02 UTC
(
hide
)
Description:
Patch against 4.9, C and python access to fileFile, fileList and policyList
Filename:
MIME Type:
Creator:
Alec Leamas
Created:
2012-09-15 15:15:02 UTC
Size:
3.19 KB
patch
obsolete
>Add the three attributes fileFile, fileList and policyList >to specPackage. Also updates docstring. > >diff --git a/build/rpmspec.h b/build/rpmspec.h >index 195fc72..a18b813 100644 >--- a/build/rpmspec.h >+++ b/build/rpmspec.h >@@ -54,6 +54,9 @@ rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter); > > /* Getters for spec package attributes */ > Header rpmSpecPkgHeader(rpmSpecPkg pkg); >+ARGV_const_t rpmSpecPkgFileFile(rpmSpecPkg pkg); >+ARGV_const_t rpmSpecPkgFileList(rpmSpecPkg pkg); >+ARGV_const_t rpmSpecPkgPolicyList(rpmSpecPkg pkg); > > /* Iterator for spec sources */ > rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec); >diff --git a/build/spec.c b/build/spec.c >index d82f725..b218159 100644 >--- a/build/spec.c >+++ b/build/spec.c >@@ -349,6 +349,21 @@ Header rpmSpecPkgHeader(rpmSpecPkg pkg) > return (pkg != NULL) ? pkg->header : NULL; > } > >+ARGV_const_t rpmSpecPkgFileFile(rpmSpecPkg pkg) >+{ >+ return (pkg != NULL) ? pkg->fileFile : NULL; >+} >+ >+ARGV_const_t rpmSpecPkgFileList(rpmSpecPkg pkg) >+{ >+ return (pkg != NULL) ? pkg->fileList : NULL; >+} >+ >+ARGV_const_t rpmSpecPkgPolicyList(rpmSpecPkg pkg) >+{ >+ return (pkg != NULL) ? pkg->policyList : NULL; >+} >+ > rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec) > { > SPEC_LISTITER_INIT(rpmSpecSrcIter, sources); >diff --git a/python/spec-py.c b/python/spec-py.c >index 284f52b..bc28c65 100644 >--- a/python/spec-py.c >+++ b/python/spec-py.c >@@ -47,16 +47,51 @@ struct specPkgObject_s { > rpmSpecPkg pkg; > }; > >+static PyObject *argv2list(ARGV_const_t argv) >+{ >+ int size; >+ const char **s; >+ PyObject *py_list; >+ int ix; >+ >+ if (argv == NULL) >+ return PyList_New(0); >+ >+ size = argvCount(argv); >+ py_list = PyList_New(size); >+ for (ix = 0, s = argvData((ARGV_t)argv); ix < size; ix++, s++) >+ PyList_SetItem(py_list, ix, PyString_FromString(*s)); >+ return py_list; >+} >+ > static char specPkg_doc[] = >-""; >+ "Package data parsed from spec file."; > > static PyObject * specpkg_get_header(specPkgObject *s, void *closure) > { > return makeHeader(rpmSpecPkgHeader(s->pkg)); > } > >+static PyObject * specpkg_get_fileFile(specPkgObject *s, void *closure) >+{ >+ return argv2list(rpmSpecPkgFileFile(s->pkg)); >+} >+ >+static PyObject * specpkg_get_fileList(specPkgObject *s, void *closure) >+{ >+ return argv2list(rpmSpecPkgFileList(s->pkg)); >+} >+ >+static PyObject * specpkg_get_policyList(specPkgObject *s, void *closure) >+{ >+ return argv2list(rpmSpecPkgPolicyList(s->pkg)); >+} >+ > static PyGetSetDef specpkg_getseters[] = { >- { "header", (getter) specpkg_get_header, NULL, NULL }, >+ { "header", (getter) specpkg_get_header, NULL, NULL }, >+ { "fileFile", (getter) specpkg_get_fileFile, NULL, NULL }, >+ { "fileList", (getter) specpkg_get_fileList, NULL, NULL }, >+ { "policyList", (getter) specpkg_get_policyList, NULL, NULL }, > { NULL } /* sentinel */ > }; > >diff --git a/python/spec-py.h b/python/spec-py.h >index 558fbf2..a1ad78a 100644 >--- a/python/spec-py.h >+++ b/python/spec-py.h >@@ -14,5 +14,6 @@ extern PyTypeObject specPkg_Type; > > PyObject * spec_Wrap(PyTypeObject *subtype, rpmSpec spec); > PyObject * specPkg_Wrap(PyTypeObject *subtype, rpmSpecPkg pkg); >+static PyObject *argv2list(ARGV_const_t argv); > > #endif /* RPMPYTHON_SPEC */
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 Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 857653
:
613273
|
618989
|
619780