summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRon Olson <tachoknight@gmail.com>2019-04-02 22:03:09 -0500
committerRon Olson <tachoknight@gmail.com>2019-04-02 22:03:09 -0500
commit689b353f250d2195211e9036d422afc74b227101 (patch)
treee7fc7af46a86a7c85585886195c219deacbc70db
parentf258c99e0cb8963c5919b8e89b24e4c73d36fd6d (diff)
downloadswift-lang-689b353f250d2195211e9036d422afc74b227101.tar.gz
swift-lang-689b353f250d2195211e9036d422afc74b227101.tar.xz
swift-lang-689b353f250d2195211e9036d422afc74b227101.zip
Finally got the upgrade process working right
-rw-r--r--swift-lang.spec34
1 files changed, 17 insertions, 17 deletions
diff --git a/swift-lang.spec b/swift-lang.spec
index cf46a3c..ecbf9ce 100644
--- a/swift-lang.spec
+++ b/swift-lang.spec
@@ -70,7 +70,7 @@ Requires: %{name}-runtime = %{version}-%{release}
Provides: %{name} = %{version}-%{release}
Obsoletes: %{name} < %{version}-%{release}
-#Conflicts: %{name} < %{version}-%{release}
+Conflicts: %{name} < %{version}-%{release}
Conflicts: %{name}-runtime < %{version}-%{release}
ExclusiveArch: x86_64 aarch64
@@ -220,31 +220,29 @@ install -m 0644 %{_builddir}/usr/share/man/man1/swift.1 %{buildroot}%{_mandir}/m
# necessary when upgrading from 4.x to 5.
%pretrans -p <lua>
path = "/usr/lib/swift/clang"
-subdirs = {"include", "lib", "share"}
-st = posix.stat(path)
-if st and st.type == "directory" then
- for _, dir in ipairs(subdirs) do
- fullDir = path .. "/" .. dir
- status = os.rename(fullDir, fullDir .. ".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
+subdirs = {"include", "lib"}
+for _, dir in ipairs(subdirs) do
+ fullDir = path .. "/" .. dir
+ st = posix.stat(fullDir)
+ if st and st.type == "directory" then
+ status = os.rename(fullDir, fullDir .. ".rpmmoved")
+ if not status then
+ suffix = 0
+ while not status do
+ suffix = suffix + 1
+ status = os.rename(fullDir .. ".rpmmoved", fullDir .. ".rpmmoved." .. suffix)
+ end
+ os.rename(fullDir, fullDir .. ".rpmmoved")
end
+ end
end
-
%files
%license swift/LICENSE.txt
%{_bindir}/swift*
%{_mandir}/man1/*
%ghost /usr/lib/swift/clang/include.rpmmoved
%ghost /usr/lib/swift/clang/lib.rpmmoved
-%ghost /usr/lib/swift/clang/share.rpmmoved
/usr/lib/swift-lldb/
/usr/lib/swift/Block/
/usr/lib/swift/CoreFoundation/
@@ -260,6 +258,8 @@ end
%files runtime
+%ghost /usr/lib/swift/clang/include.rpmmoved
+%ghost /usr/lib/swift/clang/lib.rpmmoved
%dir /usr/lib/swift
/usr/lib/swift/linux/
%ifarch aarch64