Commit 70ef376d authored by James Larrowe's avatar James Larrowe Committed by Ed Reel

Update xdg_base package (#3226)

parent 52adac39
...@@ -3,41 +3,44 @@ require 'package' ...@@ -3,41 +3,44 @@ require 'package'
class Xdg_base < Package class Xdg_base < Package
description 'XDG Base Directory Specification Configuration' description 'XDG Base Directory Specification Configuration'
homepage 'https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html' homepage 'https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html'
version '0.7-2' version '0.7-3'
source_url 'https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html' source_url 'file:///dev/null'
source_sha256 '342289ad33b48b8f643278f74cafa182f4471d490b82dc5e442e2e720fa4080f' source_sha256 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
def self.preinstall def self.preinstall
# Save any previous configuration, if it exists. # Save any previous configuration, if it exists.
if Dir.exists? "$HOME/.config" if Dir.exists? "#{HOME}/.config"
system "cp -a $HOME/.config #{CREW_PREFIX} && rm -rf $HOME/.config" FileUtils.cp_r("#{HOME}/.config", "#{CREW_PREFIX}/")
FileUtils.rm_rf("#{HOME}/.config")
end end
if Dir.exists? "$HOME/.local" if Dir.exists? "#{HOME}/.local"
system "mkdir -p #{CREW_PREFIX}/.config" unless Dir.exists? "#{CREW_PREFIX}/.config" FileUtils.mkdir_p("#{CREW_PREFIX}/.config") unless Dir.exists? "#{CREW_PREFIX}/.config"
system "cp -a $HOME/.local/. #{CREW_PREFIX}/.config && rm -rf $HOME/.local" FileUtils.rm_rf("#{HOME}/.local") if FileUtils.cp_r("#{HOME}/.local/.", "#{CREW_PREFIX}/.config/")
end end
end end
def self.install def self.install
# Changes the ~/.config and ~/.local directories to use symlinks instead. # Changes the ~/.config and ~/.local directories to use symlinks instead.
# This is needed in cases when executables are installed in these locations. # This is needed in cases when executables are installed in these locations.
system "mkdir -p #{CREW_DEST_HOME}" FileUtils.mkdir_p(CREW_DEST_HOME)
system "mkdir -p #{CREW_DEST_PREFIX}/.config" FileUtils.mkdir_p(CREW_DEST_PREFIX + '/.config')
system "ln -s #{CREW_PREFIX}/.config #{CREW_DEST_HOME}/.config" FileUtils.ln_s(CREW_PREFIX + '/.config', CREW_DEST_HOME + '/.config')
system "ln -s #{CREW_PREFIX}/.config #{CREW_DEST_HOME}/.local" FileUtils.ln_s(CREW_PREFIX + '/.config', CREW_DEST_HOME + '/.local')
end end
def self.postinstall def self.postinstall
puts puts
puts "The following bash environment variables should be set as shown below:".lightblue puts 'The following bash environment variables should be set as shown below:'.lightblue
puts
puts "echo '# XDG Base Directory Specification Environment Variables' >> ~/.bashrc".lightblue 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 puts "echo '# See https://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html' >> ~/.bashrc".lightblue
puts "echo 'export XDG_DATA_HOME=\$HOME/.local/share' >> ~/.bashrc".lightblue puts "echo 'export XDG_DATA_HOME=#{HOME}/.local/share' >> ~/.bashrc".lightblue
puts "echo 'export XDG_CONFIG_HOME=\$HOME/.config' >> ~/.bashrc".lightblue puts "echo 'export XDG_CONFIG_HOME=#{HOME}/.config' >> ~/.bashrc".lightblue
puts "echo 'export XDG_DATA_DIRS=#{CREW_PREFIX}/share' >> ~/.bashrc".lightblue puts "echo 'export XDG_DATA_DIRS=#{CREW_PREFIX}/share' >> ~/.bashrc".lightblue
puts "echo 'export XDG_CONFIG_DIRS=#{CREW_PREFIX}/etc/xdg' >> ~/.bashrc".lightblue puts "echo 'export XDG_CONFIG_DIRS=#{CREW_PREFIX}/etc/xdg' >> ~/.bashrc".lightblue
puts "echo 'export XDG_CACHE_HOME=\$HOME/.cache' >> ~/.bashrc".lightblue puts "echo 'export XDG_CACHE_HOME=#{HOME}/.cache' >> ~/.bashrc".lightblue
puts "source ~/.bashrc".lightblue puts "echo 'export XDG_RUNTIME_DIR=/var/run/chrome' >> ~/.bashrc".lightblue
puts 'source ~/.bashrc'.lightblue
puts puts
end end
end end
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