Add self.remove package section

This commit is contained in:
Ed Reel
2020-12-20 23:10:04 -06:00
parent d9621940be
commit dc89afd43c
3 changed files with 10 additions and 3 deletions

6
crew
View File

@@ -499,7 +499,7 @@ def download
Dir.chdir CREW_BREW_DIR do
unless ENV["CREW_CACHE_OPT"].to_s == ''
unless File.directory?(CREW_CACHE_DIR)
FileUtils.mkdir_p(CREW_CACHE_DIR)
FileUtils.mkdir_p(CREW_CACHE_DIR)
end
if File.file?("#{CREW_CACHE_DIR}#{filename}")
if Digest::SHA256.hexdigest( File.read("#{CREW_CACHE_DIR}#{filename}") ) == sha256sum then
@@ -973,8 +973,10 @@ def remove (pkgName)
file.write JSON.pretty_generate(out)
end
puts "#{pkgName.capitalize} removed!".lightgreen
set_package pkgName, true
@pkg.remove
puts "#{pkgName.capitalize} removed!".lightgreen
end
def build_command (args)

View File

@@ -1,6 +1,6 @@
# Defines common constants used in different parts of crew
CREW_VERSION = '1.5.2'
CREW_VERSION = '1.5.3'
ARCH_ACTUAL = `uname -m`.strip
# This helps with virtualized builds on aarch64 machines

View File

@@ -105,6 +105,11 @@ class Package
end
# Function to perform after package removal.
def self.remove
end
def self.system(*args)
# add "-j#" argument to "make" at compile-time, if necessary