From 5644914f69fe09f112a6eb9e7d962ad91c977442 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Va=C5=A1=C3=ADk?= Date: Tue, 29 Jul 2014 15:16:34 +0200 Subject: [PATCH] rename /media directory when replacing with symlink --- filesystem.spec | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/filesystem.spec b/filesystem.spec index 5fccdfb..1841d6a 100644 --- a/filesystem.spec +++ b/filesystem.spec @@ -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 - 3.2-29 +- rename /media directory when replacing with symlinks + to prevent potential data loss + * Mon Jul 28 2014 Ondrej Vasik - 3.2-28 - add ownership for /usr/share/licenses (#1121416) - have /media as symlink to /run/media (#965918)