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
nexedi
chromebrew
Commits
b211e750
Commit
b211e750
authored
Jan 01, 2015
by
Dan McAulay
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add some error checking around `Kernel.system`
parent
df655fd9
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
11 deletions
+23
-11
crew
crew
+15
-11
lib/package.rb
lib/package.rb
+6
-0
lib/package_helpers.rb
lib/package_helpers.rb
+2
-0
No files found.
crew
View file @
b211e750
...
...
@@ -148,18 +148,22 @@ def download
end
def
resolveDependenciesAndInstall
origin
=
@pkg
.
name
begin
origin
=
@pkg
.
name
resolveDependencies
resolveDependencies
search
origin
install
#cleanup
unless
ARGV
[
2
]
==
'keep'
Dir
.
chdir
CREW_BREW_DIR
do
system
"rm -rf *"
system
"mkdir dest"
#this is a little ugly, feel free to find a better way
search
origin
install
rescue
InstallError
=>
e
puts
"install error:
#{
e
.
to_s
}
"
ensure
#cleanup
unless
ARGV
[
2
]
==
'keep'
Dir
.
chdir
CREW_BREW_DIR
do
system
"rm -rf *"
system
"mkdir dest"
#this is a little ugly, feel free to find a better way
end
end
end
end
...
...
@@ -183,7 +187,7 @@ def resolveDependencies
return
if
@dependencies
.
empty?
puts
"Following packages also need to be installed: "
@dependencies
.
flatten!
.
each
do
|
dep
|
@dependencies
.
flatten!
.
uniq!
.
each
do
|
dep
|
print
dep
+
" "
end
puts
""
...
...
lib/package.rb
View file @
b211e750
...
...
@@ -26,4 +26,10 @@ class Package
def
self
.
build
end
def
self
.
system
(
*
args
)
Kernel
.
system
(
*
args
)
exitstatus
=
$?
.
exitstatus
raise
InstallError
.
new
(
"`
#{
args
.
join
(
" "
)
}
` exited with
#{
exitstatus
}
"
)
unless
exitstatus
==
0
end
end
lib/package_helpers.rb
View file @
b211e750
class
InstallError
<
RuntimeError
;
end
def
property
(
*
properties
)
properties
.
each
do
|
prop
|
self
.
class_eval
(
"def self.
#{
prop
}
(
#{
prop
}
= nil); @
#{
prop
}
=
#{
prop
}
if
#{
prop
}
; @
#{
prop
}
; 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