Bug 2152670 - undeterministic sepolicy failure creating man pages directory structure
Summary: undeterministic sepolicy failure creating man pages directory structure
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: policycoreutils
Version: 38
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: ---
Assignee: Petr Lautrbach
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-12 16:13 UTC by Zdenek Pytela
Modified: 2023-03-25 02:01 UTC (History)
5 users (show)

Fixed In Version: policycoreutils-3.5-1.fc37
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-02-27 11:00:13 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Zdenek Pytela 2022-12-12 16:13:58 UTC
Description of problem:
sepolicy manpage fails during policy build

Version-Release number of selected component (if applicable):
latest rawhide

How reproducible:
sometimes

Steps to Reproduce:
1. Initiate a selinux-policy build

Actual results:
+ /usr/bin/sepolicy manpage -a -p /__w/selinux-policy/selinux-policy/rpmbuild/BUILDROOT/selinux-policy-38.2-1.20221212_150123.2b2c45d.fc38.x86_64/usr/share/man/man8/ -w -r /__w/selinux-policy/selinux-policy/rpmbuild/BUILDROOT/selinux-policy-38.2-1.20221212_150123.2b2c45d.fc38.x86_64
FileExistsError: [Errno 17] File exists: '/__w/selinux-policy/selinux-policy/rpmbuild/BUILDROOT/selinux-policy-38.2-1.20221212_150123.2b2c45d.fc38.x86_64/usr/share/man/man8/'
error: Bad exit status from /var/tmp/rpm-tmp.WY9sgI (%install)
    Bad exit status from /var/tmp/rpm-tmp.WY9sgI (%install)

RPM build errors:
Error: Process completed with exit code 1.


Expected results:
no error

Additional info:
https://github.com/fedora-selinux/selinux-policy/actions/runs/3676994136/jobs/6218369540

Comment 1 Petr Lautrbach 2022-12-12 17:32:01 UTC
modified   python/sepolicy/sepolicy/manpage.py
@@ -376,8 +376,7 @@ class ManPage:
 
         self.fcdict = sepolicy.get_fcdict(self.fcpath)
 
-        if not os.path.exists(path):
-            os.makedirs(path)
+        os.makedirs(path, exist_ok=True)
 
         self.path = path

Comment 2 Ben Cotton 2023-02-07 15:13:13 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 38 development cycle.
Changing version to 38.

Comment 3 Fedora Update System 2023-02-27 18:52:11 UTC
FEDORA-2023-568a3be5b8 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2023-568a3be5b8

Comment 4 Fedora Update System 2023-02-28 02:54:15 UTC
FEDORA-2023-568a3be5b8 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2023-568a3be5b8`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2023-568a3be5b8

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 5 Fedora Update System 2023-03-25 02:01:38 UTC
FEDORA-2023-568a3be5b8 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.