Commit e496cddb authored by Ed Reel's avatar Ed Reel Committed by GitHub

Update composer from 1.10.1 to 1.10.5 (#4014)

parent c14180fb
......@@ -3,20 +3,20 @@ require 'package'
class Composer < Package
description 'Dependency Manager for PHP'
homepage 'https://getcomposer.org/'
version '1.10.1'
source_url 'https://github.com/composer/composer/archive/1.10.1.tar.gz'
source_sha256 '9d19d87a63a4927c20ed8e21dc2dd472eaf86deaf529917591557945464d5573'
version '1.10.5'
source_url 'https://github.com/composer/composer/archive/1.10.5.tar.gz'
source_sha256 '241dcc3a51a1c81c4e124d55824cfb2cf69bbe824549329f88dd30262812cc36'
depends_on 'php' unless File.exists? "#{CREW_PREFIX}/bin/php"
depends_on 'php74' unless File.exists? "#{CREW_PREFIX}/bin/php"
depends_on 'xdg_base'
def self.preinstall
if Dir.exists?("#{HOME}/.config") && !File.symlink?("#{HOME}/.config")
# Save any existing configuration
system "cp -r #{HOME}/.config #{CREW_PREFIX}" unless Dir.empty? "#{HOME}/.config"
FileUtils.cp_r "#{HOME}/.config", "#{CREW_PREFIX}" unless Dir.empty? "#{HOME}/.config"
else
# Remove the symlink, if it exists
system "rm -f #{HOME}/.config"
FileUtils.rm_f "#{HOME}/.config"
end
end
......@@ -24,12 +24,12 @@ class Composer < Package
system "php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\""
system 'curl -Ls -o installer.sig https://composer.github.io/installer.sig'
abort 'Checksum mismatch. :/ Try again.'.lightred unless Digest::SHA384.hexdigest( File.read('composer-setup.php') ) == File.read('installer.sig')
system "mkdir -p #{CREW_DEST_PREFIX}/bin"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
system "php composer-setup.php --install-dir=#{CREW_DEST_PREFIX}/bin --filename=composer --version=#{version}"
system "mkdir -p #{CREW_DEST_PREFIX}/.config"
system "cp -r #{HOME}/.config/composer #{CREW_DEST_PREFIX}/.config"
system "rm -rf #{HOME}/.config"
system "ln -s #{CREW_PREFIX}/.config #{HOME}/.config"
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/.config"
FileUtils.cp_r "#{HOME}/.config/composer", "#{CREW_DEST_PREFIX}/.config"
FileUtils.rm_rf "#{HOME}/.config"
FileUtils.ln_s "#{CREW_PREFIX}/.config", "#{HOME}/.config"
end
def self.postinstall
......
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