Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:darix:apps
nextcloud-packaging
nextcloud_apps_deps.rb
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File nextcloud_apps_deps.rb of Package nextcloud-packaging
#!/usr/bin/ruby # vim: set sw=2 sts=2 et tw=80 : require "rexml/document" require 'optparse' def get_nextcloud_attributes(fname) doc = REXML::Document.new(File.read(fname)) elements=REXML::XPath.match(doc, '//nextcloud') if elements.empty? STDERR.puts "No information about supported Nextcloud versions" return {} else return elements.first.attributes end end options = {} OptionParser.new do |opts| opts.banner = "Usage: nextcloud_apps_deps.rb [options]" opts.on("--requires", "Generates Requires") do |v| options[:requires] = v end opts.on("--conflicts", "Generates Requires") do |v| options[:conflicts] = v end opts.on("--check=VERSION", "Check if it supports the version of nextcloud") do |v| options[:check] = v end end.parse! if options[:check] check_version=options[:check].split('.')[0].to_i max_version=0 attributes = get_nextcloud_attributes('appinfo/info.xml') if attributes['max-version'] max_version=attributes['max-version'].to_i end if check_version > max_version STDERR.puts '#'*72 STDERR.puts '#' STDERR.puts "# This extension does not support the nextcloud version #{options[:check]}." STDERR.puts '#' STDERR.puts "# Latest supported version is #{max_version}." STDERR.puts '#' STDERR.puts '#'*72 exit(0) end else lines=STDIN.read lines.each_line do |line| attributes=get_nextcloud_attributes(line.chomp) if options[:requires] min_version = attributes['min-version'] || 0 puts "nextcloud >= #{min_version}.0.0" end if options[:conflicts] if attributes['max-version'] max_version = attributes['max-version'].to_i + 1 puts "nextcloud >= #{max_version}.0.0" end end end end
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor