rdiff-backup: Fix version detection

This commit is contained in:
Eugen Wissner 2023-07-13 18:03:02 +02:00
parent a0788d2f3a
commit bed90e3e02
Signed by: belka
GPG Key ID: A27FDC1E8EE902C0

View File

@ -23,42 +23,6 @@ task :dmd, [:version] do |_, arguments|
SlackBuilder::DmdTools.update_tools arguments[:version], dub_version, dscanner_version, dcd_version
end
task :composer, [:version] do |_, arguments|
raise 'Version is not specified.' unless arguments.key? :version
package = Package.new 'development/composer',
version: arguments[:version],
homepage: 'https://getcomposer.org/'
uri = "https://getcomposer.org/download/#{arguments[:version]}/composer.phar"
checksum = SlackBuilder.download URI(uri), 'slackbuilds/development/composer/composer.phar'
write_info package, downloads: [Download.new(uri, checksum.hexdigest)]
update_slackbuild_version 'development/composer', arguments[:version]
commit 'development/composer', arguments[:version]
end
task 'universal-ctags', [:version] do |_, arguments|
raise 'Version is not specified.' unless arguments.key? :version
package = Package.new 'development/universal-ctags',
version: arguments[:version],
homepage: 'https://ctags.io/',
requires: ['%README%']
uri = "https://github.com/universal-ctags/ctags/archive/#{arguments[:version]}/ctags-#{arguments[:version]}.tar.gz"
tarball = "slackbuilds/development/universal-ctags/ctags-#{arguments[:version]}.tar.gz"
checksum = SlackBuilder.download URI(uri), tarball
download = "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{arguments[:version]}.tar.gz"
write_info package,
downloads: [Download.new(download, checksum.hexdigest)]
update_slackbuild_version 'development/universal-ctags', arguments[:version]
sh 'scp', tarball, "#{CONFIG[:remote_path]}/universal-ctags"
commit 'development/universal-ctags', arguments[:version]
end
task :hhvm, [:version] do |_, arguments|
raise 'Version is not specified.' unless arguments.key? :version
@ -171,17 +135,36 @@ module SlackBuilder
requires: ['%README%']
end
end
class Composer < Updater
def update(version)
package = Package.new 'development/composer',
version: version,
homepage: 'https://getcomposer.org/'
uri = "https://getcomposer.org/download/#{version}/composer.phar"
checksum = SlackBuilder.download URI(uri), 'slackbuilds/development/composer/composer.phar'
write_info package, downloads: [Download.new(uri, checksum.hexdigest)]
update_slackbuild_version 'development/composer', version
commit 'development/composer', version
end
end
end
php_transform = proc do |version|
version.delete_prefix 'php-' if version.match?(/^php-8\.2\.[[:digit:]+]$/)
end
rdiff_backup_transform = proc do |version|
version.delete_prefix 'v' if version.match?(/^v\d+\.\d+\.\d+/)
end
AUTO_UPDATABLE = {
'universal-ctags' => [SlackBuilder::GitHub.new('universal-ctags', 'ctags'), SlackBuilder::UniversalCtags.new],
'composer' => [SlackBuilder::Packagist.new('composer', 'composer')],
'composer' => [SlackBuilder::Packagist.new('composer', 'composer'), SlackBuilder::Composer.new],
'php82' => [SlackBuilder::GitHub.new('php', 'php-src', php_transform)],
'rdiff-backup' => [SlackBuilder::GitHub.new('rdiff-backup', 'rdiff-backup')],
'rdiff-backup' => [SlackBuilder::GitHub.new('rdiff-backup', 'rdiff-backup', rdiff_backup_transform)],
'librsync' => [SlackBuilder::GitHub.new('librsync', 'librsync')],
'jitsi-meet-desktop' => [SlackBuilder::GitHub.new('jitsi', 'jitsi-meet-electron')],
'dmd' => [SlackBuilder::LatestText.new('https://downloads.dlang.org/releases/LATEST')]