Migrate universal-ctags script completely

This commit is contained in:
Eugen Wissner 2021-01-10 12:12:35 +01:00
parent e8831550a2
commit c246444f8d
4 changed files with 26 additions and 51 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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 <<EOF > 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"