Commit 5e84a6f3 authored by James Larrowe's avatar James Larrowe Committed by Ed Reel

Fix xdg_base upgrade logic (#3227)

parent b7727b53
......@@ -3,19 +3,31 @@ require 'package'
class Xdg_base < Package
description 'XDG Base Directory Specification Configuration'
homepage 'https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html'
version '0.7-3'
version '0.7-4'
source_url 'file:///dev/null'
source_sha256 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
def self.preinstall
# Save any previous configuration, if it exists.
if Dir.exists? "#{HOME}/.config"
FileUtils.cp_r("#{HOME}/.config", "#{CREW_PREFIX}/")
FileUtils.rm_rf("#{HOME}/.config")
if File.readlink("#{HOME}/.config") != "#{CREW_PREFIX}/.config"
puts('File.readlink("#{HOME}/.config") != "#{CREW_PREFIX}/.config"') # Debug message
if !FileUtils.cp_r("#{HOME}/.config", "#{CREW_PREFIX}/")
puts('FileUtils.cp_r("#{HOME}/.config", "#{CREW_PREFIX}/")') # Debug
FileUtils.rm_rf("#{HOME}/.config")
end
end
end
if Dir.exists? "#{HOME}/.local"
puts('Dir.exists? "#{HOME}/.local"') # Debug
FileUtils.mkdir_p("#{CREW_PREFIX}/.config") unless Dir.exists? "#{CREW_PREFIX}/.config"
FileUtils.rm_rf("#{HOME}/.local") if FileUtils.cp_r("#{HOME}/.local/.", "#{CREW_PREFIX}/.config/")
if File.readlink("#{HOME}/.local") != "#{CREW_PREFIX}/.config"
puts('File.readlink("#{HOME}/.local") != "#{CREW_PREFIX}/.config"') # Debug
if !FileUtils.cp_r("#{HOME}/.local/.", "#{CREW_PREFIX}/.config/")
puts('FileUtils.cp_r("#{HOME}/.local/.", "#{CREW_PREFIX}/.config/")') # Debug
FileUtils.rm_rf("#{HOME}/.local")
end
end
end
end
......@@ -30,7 +42,7 @@ class Xdg_base < Package
def self.postinstall
puts
puts 'The following bash environment variables should be set as shown below:'.lightblue
puts 'The following environment variables should be set as shown below:'.lightblue
puts
puts "echo '# XDG Base Directory Specification Environment Variables' >> ~/.bashrc".lightblue
puts "echo '# See https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html' >> ~/.bashrc".lightblue
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment