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
dac2fd95
Commit
dac2fd95
authored
Jan 06, 2017
by
lyxell
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add comments
parent
b9642ad0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
crew
crew
+10
-0
No files found.
crew
View file @
dac2fd95
...
...
@@ -328,12 +328,15 @@ end
def
remove
(
pkgName
)
#make sure the package is actually installed
unless
@device
[
:installed_packages
].
any?
{
|
pkg
|
pkg
[
:name
]
==
pkgName
}
puts
"Package
#{
pkgName
}
isn't installed."
return
end
Dir
.
chdir
CREW_CONFIG_PATH
do
#remove all files installed by the package
File
.
open
(
"meta/
#{
pkgName
}
.filelist"
).
each_line
do
|
line
|
begin
File
.
unlink
line
.
chomp
...
...
@@ -341,6 +344,7 @@ def remove (pkgName)
end
end
#remove all directories installed by the package
File
.
readlines
(
"meta/
#{
pkgName
}
.directorylist"
).
reverse
.
each
do
|
line
|
begin
Dir
.
rmdir
line
.
chomp
...
...
@@ -348,19 +352,25 @@ def remove (pkgName)
end
end
#remove the file and directory list
File
.
unlink
"meta/
#{
pkgName
}
.filelist"
File
.
unlink
"meta/
#{
pkgName
}
.directorylist"
end
#remove from installed packages
@device
[
:installed_packages
].
each
do
|
elem
|
@device
[
:installed_packages
].
delete
elem
if
elem
[
:name
]
==
pkgName
end
#update the device manifest
File
.
open
(
CREW_CONFIG_PATH
+
'device.json'
,
'w'
)
do
|
file
|
out
=
JSON
.
parse
@device
.
to_json
file
.
write
JSON
.
pretty_generate
(
out
)
end
puts
"
#{
pkgName
.
capitalize
}
removed!"
end
case
@command
...
...
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