#2 Only do %post chown if /var is writable
Closed 4 years ago by msuchy. Opened 4 years ago by walters.
rpms/ walters/mock chown-only-if-possible  into  master

file modified
+6 -3
@@ -17,7 +17,7 @@ 

  Summary: Builds packages inside chroots

  Name: mock

  Version: 1.4.7

- Release: 2%{?dist}

+ Release: 3.post%{?dist}

  License: GPLv2+

  # Source is created by

  # git clone https://github.com/rpm-software-management/mock.git
@@ -172,8 +172,11 @@ 

  install -d %{buildroot}/var/cache/mock



- # fix cache permissions from old installs

- chmod 2775 %{_localstatedir}/cache/%{name}

+ # fix cache permissions from old installs; test for writability in

+ # advance for compatibility with rpm-ostree: https://bugzilla.redhat.com/show_bug.cgi?id=1352154

+ if test -w %{_localstatedir}/cache/%{name}; then

+     chmod 2775 %{_localstatedir}/cache/%{name}

+ fi



  # ignore the errors for now, just print them and hopefully somebody will fix it one day

This ensures we're compatible with rpm-ostree which has a read-only
bind mount over /var during script runs.


This chmod is there for more than 4 years. I think we can safely delete it now. I will do that in upstream and I close it here.

Pull-Request has been closed by msuchy

4 years ago

Sounds good to me, thanks!