diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-11-03 18:09:36 +0100 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-11-03 18:09:36 +0100 |
| commit | 0023fe033731180afe8bc2242c2a512b31b8c0bf (patch) | |
| tree | 74644e69836f08164c13722b70eb08ea047cad63 /lib | |
| parent | 24e62c343946e0413648f14a1d17fb2007b91a86 (diff) | |
| download | slackbuilder-0023fe033731180afe8bc2242c2a512b31b8c0bf.tar.gz | |
Remove unused tasks
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/download.rb | 17 | ||||
| -rw-r--r-- | lib/package.rb | 78 |
2 files changed, 0 insertions, 95 deletions
diff --git a/lib/download.rb b/lib/download.rb index 80ff30b..17b119b 100644 --- a/lib/download.rb +++ b/lib/download.rb @@ -37,21 +37,4 @@ module SlackBuilder private_class_method def self.upload_command(local_path, remote_path) ['scp', "slackbuilds/#{local_path}", CONFIG[:remote_path] + remote_path] end - - private_class_method def self.clone_and_archive(repo, name_version, tarball, tag_prefix = 'v') - sh './bin/slackbuilder', 'archive', repo, name_version, tarball, tag_prefix - end -end - -def write_info(package, downloads:) - File.write "slackbuilds/#{package.path}/#{package.name}.info", - info_template(package, downloads) -end - -def update_slackbuild_version(package_path, version) - sh './bin/slackbuilder', 'slackbuild', package_path, version -end - -def commit(package_path, version) - sh './bin/slackbuilder', 'commit', package_path, version end diff --git a/lib/package.rb b/lib/package.rb index fbfd444..b5c44bb 100644 --- a/lib/package.rb +++ b/lib/package.rb @@ -21,82 +21,4 @@ class Package def name_version "#{name}-#{@version}" end - - def self.parse(path, info_contents) - current_line = String.new '' - variables = {} - - info_contents.each_line(chomp: true) do |file_line| - current_line << file_line.delete_suffix('\\') - next if file_line.end_with? '\\' - - variables.store(*parse_pair(current_line)) - current_line.clear - end - from_hash path, variables - end - - private_class_method def self.parse_pair(current_line) - variable_name, variable_value = current_line.split '=' - [variable_name, variable_value[1...-1].split] - end - - private_class_method def self.from_hash(path, variables) - Package.new path, - version: variables['VERSION'].join, - homepage: variables['HOMEPAGE'].join, - requires: variables['REQUIRES'] - end -end - -class Download - attr_reader :download, :md5sum - - def initialize(download, md5sum, is64: false) - @download = download - @md5sum = md5sum - @is64 = is64 - end - - def is64? - @is64 - end -end - -def info_template(package, downloads) - downloads64, downloads32 = downloads.partition(&:is64?) - download32, md5sum32, download64, md5sum64 = download_entries downloads64, downloads32 - - <<~INFO_FILE - PRGNAM="#{package.name}" - VERSION="#{package.version}" - HOMEPAGE="#{package.homepage}" - DOWNLOAD="#{download32}" - MD5SUM="#{md5sum32}" - DOWNLOAD_x86_64="#{download64}" - MD5SUM_x86_64="#{md5sum64}" - REQUIRES="#{requires_entry package.requires}" - MAINTAINER="Eugene Wissner" - EMAIL="belka@caraus.de" - INFO_FILE -end - -private - -def requires_entry(requires) - requires * ' ' -end - -def download_entries(downloads64, downloads32) - download32 = - if downloads32.empty? && !downloads64.empty? - 'UNSUPPORTED' - else - downloads32.map(&:download) * " \\\n " - end - md5sum32 = downloads32.map(&:md5sum) * " \\\n " - download64 = downloads64.map(&:download) * " \\\n " - md5sum64 = downloads64.map(&:md5sum) * " \\\n " - - [download32, md5sum32, download64, md5sum64] end |
