rename /media directory when replacing with symlink

This commit is contained in:
Ondřej Vašík 2014-07-29 15:16:34 +02:00
parent 9595652b22
commit 5644914f69

View File

@ -1,7 +1,7 @@
Summary: The basic directory layout for a Linux system
Name: filesystem
Version: 3.2
Release: 28%{?dist}
Release: 29%{?dist}
License: Public Domain
URL: https://fedorahosted.org/filesystem
Group: System Environment/Base
@ -138,6 +138,20 @@ posix.symlink("usr/%{_lib}", "/%{_lib}")
posix.mkdir("/run")
posix.mkdir("/run/media")
posix.mkdir("/var")
--#/media magic to be on the safe side - to prevent loss of userdata until F24
path = "/media"
st = posix.stat(path)
if st and st.type == "directory" then
status = os.rename(path, path .. ".rpmmoved")
if not status then
suffix = 0
while not status do
suffix = suffix + 1
status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
end
os.rename(path, path .. ".rpmmoved")
end
end
posix.symlink("run/media", "/media")
posix.symlink("../run", "/var/run")
posix.symlink("../run/lock", "/var/lock")
@ -265,6 +279,10 @@ restorecon /run/media 2>/dev/null >/dev/null || :
/var/yp
%changelog
* Tue Jul 29 2014 Ondrej Vasik <ovasik@redhat.com> - 3.2-29
- rename /media directory when replacing with symlinks
to prevent potential data loss
* Mon Jul 28 2014 Ondrej Vasik <ovasik@redhat.com> - 3.2-28
- add ownership for /usr/share/licenses (#1121416)
- have /media as symlink to /run/media (#965918)