summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEugen Wissner <belka@caraus.de>2023-08-15 10:33:19 +0200
committerEugen Wissner <belka@caraus.de>2023-08-15 10:33:19 +0200
commit6b15ccd0f53c7ffd57820fb15664ecadee74392a (patch)
tree20ba7c838a2be1e7bd0707ed098f505c43a4da79 /lib
parent5a9e87cd5f65439ef8f2717b3b3e561f42f2e24c (diff)
downloadslackbuilder-6b15ccd0f53c7ffd57820fb15664ecadee74392a.tar.gz
Support repository path in commits
Diffstat (limited to 'lib')
-rw-r--r--lib/download.rb19
-rw-r--r--lib/up2date.rb14
2 files changed, 2 insertions, 31 deletions
diff --git a/lib/download.rb b/lib/download.rb
index 913fd86..6d4a307 100644
--- a/lib/download.rb
+++ b/lib/download.rb
@@ -134,24 +134,9 @@ def write_info(package, downloads:)
end
def update_slackbuild_version(package_path, version)
- raise TypeError, %(expected a version string, got "#{version}") unless version.is_a?(String)
-
- name = package_path.split('/').last
- slackbuild_filename = "slackbuilds/#{package_path}/#{name}.SlackBuild"
- slackbuild_contents = File.read(slackbuild_filename)
- .gsub(/^VERSION=\${VERSION:-.+/, "VERSION=${VERSION:-#{version}}")
-
- File.open(slackbuild_filename, 'w') { |file| file.puts slackbuild_contents }
+ sh './bin/slackbuilder', 'slackbuild', package_path, version
end
def commit(package_path, version)
- message = "#{package_path}: Updated for version #{version}"
-
- unless system('git', '-C', 'slackbuilds', 'checkout', CONFIG[:branch],
- err: '/dev/null')
- sh 'git', '-C', 'slackbuilds', 'checkout', '-b', CONFIG[:branch], 'master'
- end
- sh 'git', '-C', 'slackbuilds', 'add', package_path
- sh 'git', '-C', 'slackbuilds', 'commit', '-S', '-m', message
- # sh 'git', '-C', 'slackbuilds', 'push', 'origin', CONFIG[:branch]
+ sh './bin/slackbuilder', 'commit', package_path, version
end
diff --git a/lib/up2date.rb b/lib/up2date.rb
index 124784b..d9eab15 100644
--- a/lib/up2date.rb
+++ b/lib/up2date.rb
@@ -22,20 +22,6 @@ module SlackBuilder
# Reads the list fo tags from the GitHub API.
class GitHub < Repository
- GITHUB_QUERY = <<~GQL
- query ($name: String!, $owner: String!) {
- repository(name: $name, owner: $owner) {
- refs(last: 10, refPrefix: "refs/tags/", orderBy: { field: TAG_COMMIT_DATE, direction: ASC }) {
- nodes {
- id,
- name
- }
- }
- }
- }
- GQL
- private_constant :GITHUB_QUERY
-
def initialize(owner, name, version_transform = nil)
super()