diff options
| author | Eugen Wissner <belka@caraus.de> | 2023-08-15 10:33:19 +0200 |
|---|---|---|
| committer | Eugen Wissner <belka@caraus.de> | 2023-08-15 10:33:19 +0200 |
| commit | 6b15ccd0f53c7ffd57820fb15664ecadee74392a (patch) | |
| tree | 20ba7c838a2be1e7bd0707ed098f505c43a4da79 /lib/download.rb | |
| parent | 5a9e87cd5f65439ef8f2717b3b3e561f42f2e24c (diff) | |
| download | slackbuilder-6b15ccd0f53c7ffd57820fb15664ecadee74392a.tar.gz | |
Support repository path in commits
Diffstat (limited to 'lib/download.rb')
| -rw-r--r-- | lib/download.rb | 19 |
1 files changed, 2 insertions, 17 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 |
