Dne 18.8.2017 v 13:43 Petr Stodulka napsal(a):
which leads to unusable system, because of missing important files,
like /etc/shadow, ....

Lets just focus on this one package. The question is why the removal of the 
package is removing
  /etc/shadow
  /etc/passwd
?

When I remove it it will:
warning: /etc/shadow saved as /etc/shadow.rpmsave
warning: /etc/passwd saved as /etc/passwd.rpmsave

That is because there is in spec file:

%verify(not md5 size mtime) %config(noreplace) /etc/passwd
%verify(not md5 size mtime) %config(noreplace) /etc/group

I would expect rather %ghost directive there.

With %ghost in place we can even omit the %posttrans:

#throw away useless and dangerous update stuff until rpm will be able to
#handle it ( http://rpm.org/ticket/6 )
%post -p <lua>
for i, name in ipairs({"passwd", "shadow", "group", "gshadow"}) do
     os.remove("/etc/"..name..".rpmnew")
end

The initial content should be IMHO populated by anaconda.

With the %ghost the removal of package will leave the important files on disk 
and the system will be operational.

Mirek
_______________________________________________
devel mailing list -- devel@lists.fedoraproject.org
To unsubscribe send an email to devel-le...@lists.fedoraproject.org

Reply via email to