Commit 84db6f9a authored by lyxell's avatar lyxell

Correctly handle packages marked as 'is_fake'

parent dac2fd95
......@@ -334,28 +334,31 @@ def remove (pkgName)
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
rescue => exception #swallow exception
#if the package is marked as 'is_fake', the file/directorylists doesn't exist
if File.file?("meta/#{pkgName}.filelist")
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
rescue => exception #swallow exception
end
end
end
#remove all directories installed by the package
File.readlines("meta/#{pkgName}.directorylist").reverse.each do |line|
begin
Dir.rmdir line.chomp
rescue => exception #swallow exception
#remove all directories installed by the package
File.readlines("meta/#{pkgName}.directorylist").reverse.each do |line|
begin
Dir.rmdir line.chomp
rescue => exception #swallow exception
end
end
end
#remove the file and directory list
File.unlink "meta/#{pkgName}.filelist"
File.unlink "meta/#{pkgName}.directorylist"
#remove the file and directory list
File.unlink "meta/#{pkgName}.filelist"
File.unlink "meta/#{pkgName}.directorylist"
end
end
#remove from installed packages
......
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