From c246444f8d1a93b1c055159ad32911e8240cda80 Mon Sep 17 00:00:00 2001 From: Eugen Wissner Date: Sun, 10 Jan 2021 12:12:35 +0100 Subject: [PATCH] Migrate universal-ctags script completely --- Gemfile.lock | 8 ++++---- Rakefile | 30 +++++++++++++++++++++--------- lib/package.rb | 2 +- scripts/universal-ctags.sh | 37 ------------------------------------- 4 files changed, 26 insertions(+), 51 deletions(-) delete mode 100755 scripts/universal-ctags.sh diff --git a/Gemfile.lock b/Gemfile.lock index 9d1e531..d381be1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,19 +8,19 @@ GEM rainbow (3.0.0) regexp_parser (2.0.3) rexml (3.2.4) - rubocop (1.7.0) + rubocop (1.8.0) parallel (~> 1.10) - parser (>= 2.7.1.5) + parser (>= 3.0.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml rubocop-ast (>= 1.2.0, < 2.0) ruby-progressbar (~> 1.7) - unicode-display_width (>= 1.4.0, < 2.0) + unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.4.0) parser (>= 2.7.1.5) ruby-progressbar (1.11.0) - unicode-display_width (1.7.0) + unicode-display_width (2.0.0) PLATFORMS ruby diff --git a/Rakefile b/Rakefile index 66f6cc0..8036c4b 100644 --- a/Rakefile +++ b/Rakefile @@ -4,7 +4,6 @@ # frozen_string_literal: true -require 'infra/rake/ruby' require 'digest/md5' require 'net/http' require_relative 'config/config' @@ -12,8 +11,8 @@ require_relative 'lib/package' require_relative 'lib/download' task :dmd do - version = '2.094.2' - dub_version = '1.23.0' + version = '2.095.0' + dub_version = '1.24.0' dscanner_version = '0.11.0' dcd_version = '0.13.1' tarball_name = "dmd.#{version}.linux.tar.xz" @@ -101,18 +100,31 @@ task 'universal-ctags' do ENV['COMMIT'] = `git ls-remote https://github.com/universal-ctags/ctags.git master` .split .first - ENV['HASH'] = ENV['COMMIT'][0...7] + version = ENV['COMMIT'][0...7] sh 'git', 'clone', '--recurse-submodules', 'https://github.com/universal-ctags/ctags.git', "ctags-#{ENV['COMMIT']}" rm_rf ["ctags-#{ENV['COMMIT']}/.git", "ctags-#{ENV['COMMIT']}/.gitignore"], secure: true - sh 'tar', 'Jcvf', "ctags-#{ENV['COMMIT']}.tar.xz", "ctags-#{ENV['COMMIT']}" + tarball = "slackbuilds/development/universal-ctags/ctags-#{ENV['COMMIT']}.tar.xz" + sh 'tar', 'Jcvf', tarball, "ctags-#{ENV['COMMIT']}" rm_rf "ctags-#{ENV['COMMIT']}", secure: true - checksum = Digest::MD5.file "ctags-#{ENV['COMMIT']}.tar.xz" - ENV['CHECKSUM'] = checksum.hexdigest + checksum = Digest::MD5.file tarball - sh 'scp', "ctags-#{ENV['COMMIT']}.tar.xz", "#{CONFIG[:remote_path]}/universal-ctags" + sh 'scp', tarball, "#{CONFIG[:remote_path]}/universal-ctags" - sh 'bash', 'scripts/universal-ctags.sh' + package = Package.new 'development/universal-ctags', + version: version, + homepage: 'https://ctags.io/' + + write_info package, + download: ["https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{ENV['COMMIT']}.tar.xz"], + md5sum: [checksum.hexdigest] + update_slackbuild_version 'development/universal-ctags', version + sh 'sed', + '-i', + "s#^GITVERSION=${GITVERSION:-.\\+#GITVERSION=${GITVERSION:-#{ENV['COMMIT']}}#", + 'slackbuilds/development/universal-ctags/universal-ctags.SlackBuild' + + commit 'development/universal-ctags', version end diff --git a/lib/package.rb b/lib/package.rb index 7bc81ec..90d3c8f 100644 --- a/lib/package.rb +++ b/lib/package.rb @@ -31,7 +31,7 @@ def info_template(package, download, md5sum) MD5SUM="#{md5sum * " \\\n "}" DOWNLOAD_x86_64="" MD5SUM_x86_64="" - REQUIRES="#{package.requires * ' '}" + REQUIRES="#{package.requires.empty? ? '%README%' : package.requires * ' '}" MAINTAINER="Eugene Wissner" EMAIL="belka@caraus.de" INFO_FILE diff --git a/scripts/universal-ctags.sh b/scripts/universal-ctags.sh deleted file mode 100755 index 234d5c9..0000000 --- a/scripts/universal-ctags.sh +++ /dev/null @@ -1,37 +0,0 @@ -#!/bin/bash - -# This Source Code Form is subject to the terms of the Mozilla Public -# License, v. 2.0. If a copy of the MPL was not distributed with this -# file, You can obtain one at https://mozilla.org/MPL/2.0/. - -set -e - -cat < universal-ctags.info -PRGNAM="universal-ctags" -VERSION="$HASH" -HOMEPAGE="https://ctags.io/" -DOWNLOAD="https://download.dlackware.com/hosted-sources/universal-ctags/ctags-$COMMIT.tar.xz" -MD5SUM="$CHECKSUM" -DOWNLOAD_x86_64="" -MD5SUM_x86_64="" -REQUIRES="%README%" -MAINTAINER="Eugene Wissner" -EMAIL="belka@caraus.de" -EOF - -rm -f slackbuilds/development/universal-ctags/*.tar.xz -mv \ - universal-ctags.info \ - ctags-$COMMIT.tar.xz \ - slackbuilds/development/universal-ctags/ -cd slackbuilds/development/universal-ctags - -# Update version in the SlackBuild. -sed -i "s#^\(VERSION=\)\${VERSION:-.\+#\1\${VERSION:-$HASH}#" universal-ctags.SlackBuild -sed -i "s#^\(GITVERSION=\)\${GITVERSION:-.\+#\1\${GITVERSION:-$COMMIT}#" universal-ctags.SlackBuild - -# Commit. -git checkout master -#git checkout -b ctags$HASH -git add . -git commit -m "development/universal-ctags: Updated for version $HASH"