Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
chromebrew
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Łukasz Nowak
chromebrew
Commits
e842547a
Commit
e842547a
authored
Apr 27, 2019
by
Ed Reel
Committed by
Chris Thurber
Apr 27, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix and simplify the self.preinstall section (#3258)
parent
0f7d79e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
18 deletions
+5
-18
packages/xdg_base.rb
packages/xdg_base.rb
+5
-18
No files found.
packages/xdg_base.rb
View file @
e842547a
...
...
@@ -3,31 +3,18 @@ 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-
4
'
version
'0.7-
5
'
source_url
'file:///dev/null'
source_sha256
'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
def
self
.
preinstall
# Save any previous configuration, if it exists.
if
Dir
.
exists?
"
#{
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
if
File
.
directory?
(
"
#{
HOME
}
/.config"
)
&&
!
File
.
symlink?
(
"
#{
HOME
}
/.config"
)
FileUtils
.
rm_rf
(
"
#{
HOME
}
/.config"
)
unless
FileUtils
.
cp_r
(
"
#{
HOME
}
/.config"
,
"
#{
CREW_PREFIX
}
/"
)
end
if
Dir
.
exists?
"
#{
HOME
}
/.local"
puts
(
'Dir.exists? "#{HOME}/.local"'
)
# Debug
if
File
.
directory?
(
"
#{
HOME
}
/.local"
)
&&
!
File
.
symlink?
(
"
#{
HOME
}
/.local"
)
FileUtils
.
mkdir_p
(
"
#{
CREW_PREFIX
}
/.config"
)
unless
Dir
.
exists?
"
#{
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
FileUtils
.
rm_rf
(
"
#{
HOME
}
/.local"
)
unless
FileUtils
.
cp_r
(
"
#{
HOME
}
/.local/."
,
"
#{
CREW_PREFIX
}
/.config/"
)
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment