diff options
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 |
