671f83b42b
get_rpm_nvr_list can fail to get the version of selinux-policy rpm package, which leads to error during spec file creation (attempt to invoke __getitem__ of "None" object). This patch sets the policy number to "0.0.0" in case rpm failed to get it. This change should be safe because it affects only an example of spec file. Variable "POLICYCOREUTILSVER" was removed (unused). fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1321499 Failed to retrieve rpm info for selinux-policy Traceback (most recent call last): File "/bin/selinux-polgengui", line 360, in forward self.generate_policy() File "/bin/selinux-polgengui", line 506, in generate_policy self.info(my_policy.generate(outputdir)) File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1382, in generate out += "%s # %s\n" % (self.write_spec(out_dir), _("Spec file")) File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1228, in write_spec fd.write(self.generate_spec()) File "/usr/lib64/python2.7/site-packages/sepolicy/generate.py", line 1190, in generate_spec selinux_policyver = get_rpm_nvr_list("selinux-policy")[1] TypeError: 'NoneType' object has no attribute '__getitem__' Signed-off-by: Vit Mojzis <vmojzis@redhat.com> |
||
---|---|---|
.. | ||
sepolicy | ||
.gitignore | ||
common.h | ||
info.c | ||
Makefile | ||
org.selinux.conf | ||
org.selinux.policy | ||
org.selinux.service | ||
policy.c | ||
policy.h | ||
search.c | ||
selinux_client.py | ||
selinux_server.py | ||
sepolgen.8 | ||
sepolicy-bash-completion.sh | ||
sepolicy-booleans.8 | ||
sepolicy-communicate.8 | ||
sepolicy-generate.8 | ||
sepolicy-gui.8 | ||
sepolicy-interface.8 | ||
sepolicy-manpage.8 | ||
sepolicy-network.8 | ||
sepolicy-transition.8 | ||
sepolicy.8 | ||
sepolicy.desktop | ||
sepolicy.py | ||
sepolicy_16.png | ||
sepolicy_22.png | ||
sepolicy_32.png | ||
sepolicy_48.png | ||
sepolicy_256.png | ||
setup.py | ||
test_sepolicy.py |