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 619780 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]
Updated patch
rpm-4.9.x-python-filelists.patch (text/plain), 4.16 KB, created by
Alec Leamas
on 2012-10-01 12:51:53 UTC
(
hide
)
Description:
Updated patch
Filename:
MIME Type:
Creator:
Alec Leamas
Created:
2012-10-01 12:51:53 UTC
Size:
4.16 KB
patch
obsolete
>diff --git a/build/rpmbuild.h b/build/rpmbuild.h >index 51a735d..ecb6b42 100644 >--- a/build/rpmbuild.h >+++ b/build/rpmbuild.h >@@ -15,7 +15,8 @@ extern "C" { > #endif > > /** \ingroup rpmbuild >- * Bit(s) to control rpmSpecBuild() operation. >+ * Bit(s) to control rpmSpecBuild() operation. Also used as argument to >+ * rpmSpecGetSection and rpmSpecPkgGetSection. > */ > enum rpmBuildFlags_e { > RPMBUILD_NONE = 0, >@@ -31,6 +32,9 @@ enum rpmBuildFlags_e { > RPMBUILD_RMBUILD = (1 << 9), /*!< Remove build sub-tree. */ > RPMBUILD_STRINGBUF = (1 << 10), /*!< Internal use only */ > RPMBUILD_RMSPEC = (1 << 11), /*!< Remove spec file. */ >+ RPMBUILD_FILE_FILE = (1 << 16), /*!< rpmSpecPkgGetSection: %files -f */ >+ RPMBUILD_FILE_LIST = (1 << 17), /*!< rpmSpecPkgGetSection: %files */ >+ RPMBUILD_POLICY = (1 << 18), /*!< rpmSpecPkgGetSection: %policy */ > > RPMBUILD_NOBUILD = (1 << 31) /*!< Don't execute or package. */ > }; >diff --git a/build/rpmspec.h b/build/rpmspec.h >index 195fc72..3972cb3 100644 >--- a/build/rpmspec.h >+++ b/build/rpmspec.h >@@ -55,6 +55,13 @@ rpmSpecPkgIter rpmSpecPkgIterFree(rpmSpecPkgIter iter); > /* Getters for spec package attributes */ > Header rpmSpecPkgHeader(rpmSpecPkg pkg); > >+/* >+ * Retrieve package specific parsed spec script section (RPMBUILD_FILE_LIST, >+ * RPMBUILD_FILE_FILE, RPMBUILD_POLICY) as a malloc'ed string. >+ */ >+const char * rpmSpecPkgGetSection(rpmSpecPkg pkg, int section); >+ >+ > /* Iterator for spec sources */ > rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec); > rpmSpecSrc rpmSpecSrcIterNext(rpmSpecSrcIter iter); >diff --git a/build/spec.c b/build/spec.c >index a4a321f..37cd610 100644 >--- a/build/spec.c >+++ b/build/spec.c >@@ -349,6 +349,18 @@ Header rpmSpecPkgHeader(rpmSpecPkg pkg) > return (pkg != NULL) ? pkg->header : NULL; > } > >+const char* rpmSpecPkgGetSection(rpmSpecPkg pkg, int section) >+{ >+ if (pkg) { >+ switch (section) { >+ case RPMBUILD_FILE_FILE: return argvJoin(pkg->fileFile, ""); >+ case RPMBUILD_FILE_LIST: return argvJoin(pkg->fileList, ""); >+ case RPMBUILD_POLICY: return argvJoin(pkg->policyList, ""); >+ } >+ } >+ return NULL; >+} >+ > rpmSpecSrcIter rpmSpecSrcIterInit(rpmSpec spec) > { > SPEC_LISTITER_INIT(rpmSpecSrcIter, sources); >diff --git a/python/spec-py.c b/python/spec-py.c >index a829539..1a9bbce 100644 >--- a/python/spec-py.c >+++ b/python/spec-py.c >@@ -47,17 +47,47 @@ struct specPkgObject_s { > rpmSpecPkg pkg; > }; > >+static PyObject *pkgGetSection(rpmSpecPkg pkg, int section) >+{ >+ const char *sect = rpmSpecPkgGetSection(pkg, section); >+ if (sect != NULL) { >+ PyObject *ps = PyString_FromString(sect); >+ free(sect); >+ if (ps != NULL) >+ return ps; >+ } >+ Py_RETURN_NONE; >+} >+ > 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 pkgGetSection(s->pkg, RPMBUILD_FILE_FILE); >+} >+ >+static PyObject * specpkg_get_fileList(specPkgObject *s, void *closure) >+{ >+ return pkgGetSection(s->pkg, RPMBUILD_FILE_LIST); >+} >+ >+static PyObject * specpkg_get_policyList(specPkgObject *s, void *closure) >+{ >+ return pkgGetSection(s->pkg, RPMBUILD_POLICY); >+} >+ > static PyGetSetDef specpkg_getseters[] = { >- { "header", (getter) specpkg_get_header, NULL, NULL }, >- { NULL } /* sentinel */ >+ { "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 */ > }; > > PyTypeObject specPkg_Type = { >diff --git a/python/spec-py.h b/python/spec-py.h >index 558fbf2..34b029a 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 *pkgGetSection(rpmSpecPkg pkg, int section); > > #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