zypper-upgraderepo 1.7.0 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -13
- data/README.md +11 -4
- data/exe/{zypper-upgraderepo → upgraderepo} +0 -0
- data/lib/zypper/upgraderepo/cli.rb +11 -4
- data/lib/zypper/upgraderepo/os_release.rb +8 -4
- data/lib/zypper/upgraderepo/repository.rb +49 -6
- data/lib/zypper/upgraderepo/request.rb +14 -6
- data/lib/zypper/upgraderepo/requests/http.rb +24 -8
- data/lib/zypper/upgraderepo/requests/local.rb +2 -0
- data/lib/zypper/upgraderepo/traversable.rb +4 -2
- data/lib/zypper/upgraderepo/version.rb +1 -1
- data/lib/zypper/upgraderepo/view.rb +69 -4
- data/lib/zypper/upgraderepo.rb +6 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a50f5e64f656b77d574d69068ef2663d9387e9607b1a8f4fa54e4428caf980d
|
4
|
+
data.tar.gz: e0d52912c451b2d3fca3e230cbd601f1dde2ec8830ca2e7ebbee451b4f425844
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46fab3ffa2117323ca0fc13bf51dd6f699a7af3b949abfef30ebd57323c54659760846fd1e3ae33b711171e8fd6b8d9c2db970631c401b97031486c8c45e718f
|
7
|
+
data.tar.gz: 576992e8186033757a0b5d6fc2cba6a9ac061c0862ceac78f9a799e7a7ab0135229dfd09f55334485a2bc919dd98d83bfe91d5936571e0daff0d152385deda68
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
zypper-upgraderepo (1.7.
|
4
|
+
zypper-upgraderepo (1.7.1)
|
5
5
|
iniparse
|
6
6
|
minitar
|
7
7
|
|
@@ -12,19 +12,19 @@ GEM
|
|
12
12
|
iniparse (1.5.0)
|
13
13
|
minitar (0.9)
|
14
14
|
rake (13.0.6)
|
15
|
-
rspec (3.
|
16
|
-
rspec-core (~> 3.
|
17
|
-
rspec-expectations (~> 3.
|
18
|
-
rspec-mocks (~> 3.
|
19
|
-
rspec-core (3.
|
20
|
-
rspec-support (~> 3.
|
21
|
-
rspec-expectations (3.
|
15
|
+
rspec (3.12.0)
|
16
|
+
rspec-core (~> 3.12.0)
|
17
|
+
rspec-expectations (~> 3.12.0)
|
18
|
+
rspec-mocks (~> 3.12.0)
|
19
|
+
rspec-core (3.12.0)
|
20
|
+
rspec-support (~> 3.12.0)
|
21
|
+
rspec-expectations (3.12.2)
|
22
22
|
diff-lcs (>= 1.2.0, < 2.0)
|
23
|
-
rspec-support (~> 3.
|
24
|
-
rspec-mocks (3.
|
23
|
+
rspec-support (~> 3.12.0)
|
24
|
+
rspec-mocks (3.12.3)
|
25
25
|
diff-lcs (>= 1.2.0, < 2.0)
|
26
|
-
rspec-support (~> 3.
|
27
|
-
rspec-support (3.
|
26
|
+
rspec-support (~> 3.12.0)
|
27
|
+
rspec-support (3.12.0)
|
28
28
|
|
29
29
|
PLATFORMS
|
30
30
|
ruby
|
@@ -36,4 +36,4 @@ DEPENDENCIES
|
|
36
36
|
zypper-upgraderepo!
|
37
37
|
|
38
38
|
BUNDLED WITH
|
39
|
-
2.
|
39
|
+
2.4.3
|
data/README.md
CHANGED
@@ -29,26 +29,33 @@ in the related [project page][project_page] on my blog.
|
|
29
29
|
|
30
30
|
## Usage
|
31
31
|
|
32
|
+
***Warning!!! The executables name prior the 1.8.0 version is zypper-upgraderepo, unfortunately the
|
33
|
+
RPM package installation introduces annoying copies of the same executable having a version appended
|
34
|
+
(zypper-upgraderepo.version, zypper-upgraderepo.rubyversion, zypper-upgraderepo.rubyversion.version)
|
35
|
+
interpreted by zypper itself as different subcommands. So I considered more convenient to remove the
|
36
|
+
zypper prefix from the original executable and let the sole zypper-upgraderepo-plugin package install
|
37
|
+
it as a zypper plugin.***
|
38
|
+
|
32
39
|
To check the availability of the current repositories:
|
33
40
|
```shell
|
34
|
-
$
|
41
|
+
$ upgraderepo
|
35
42
|
```
|
36
43
|
|
37
44
|
To check the availability of the next version repositories:
|
38
45
|
```shell
|
39
|
-
$
|
46
|
+
$ upgraderepo --check-next
|
40
47
|
```
|
41
48
|
|
42
49
|
To upgrade the repositories to the next version:
|
43
50
|
```shell
|
44
|
-
$ sudo
|
51
|
+
$ sudo upgraderepo --upgrade
|
45
52
|
```
|
46
53
|
|
47
54
|
## Get help
|
48
55
|
|
49
56
|
Where to start:
|
50
57
|
```shell
|
51
|
-
$
|
58
|
+
$ upgraderepo --help
|
52
59
|
```
|
53
60
|
|
54
61
|
## More Help:
|
File without changes
|
@@ -34,7 +34,7 @@ module Zypper
|
|
34
34
|
if ENV['ZYPPER_UPGRADEREPO']
|
35
35
|
opt.banner = 'Usage: zypper upgraderepo [OPTIONS] [OPERATION]'
|
36
36
|
else
|
37
|
-
opt.banner = 'Usage:
|
37
|
+
opt.banner = 'Usage: upgraderepo [OPTIONS] [OPERATION]'
|
38
38
|
end
|
39
39
|
|
40
40
|
opt.separator ''
|
@@ -67,6 +67,10 @@ module Zypper
|
|
67
67
|
options.operation = :reset
|
68
68
|
end
|
69
69
|
|
70
|
+
opt.on('-t', '--update', 'Update the repositories to the current OS version') do |v|
|
71
|
+
options.operation = :update
|
72
|
+
end
|
73
|
+
|
70
74
|
opt.on('-u', '--upgrade', 'Upgrade to the next version available') do |o|
|
71
75
|
options.operation = :upgrade_to_next
|
72
76
|
end
|
@@ -126,8 +130,8 @@ module Zypper
|
|
126
130
|
options.only_enabled = true
|
127
131
|
end
|
128
132
|
|
129
|
-
opt.on('--only-repo <NUMBER>[,NUMBER2,...]', 'Include only the repositories specified by NUMBER') do |o|
|
130
|
-
options.only_repo = o.split(',')
|
133
|
+
opt.on('--only-repo <NUMBER|NAME|@ALIAS|#URL|&ANY>[,NUMBER2|NAME2|@ALIAS2|#URL2|&ANY2,...]', 'Include only the repositories specified by a NUMBER or a string matching the NAME, @ALIAS, #URL, or &ANY of them') do |o|
|
134
|
+
options.only_repo = o.split(',')
|
131
135
|
end
|
132
136
|
|
133
137
|
opt.on('--only-invalid', 'Show only invalid repositories') do |o|
|
@@ -153,7 +157,7 @@ module Zypper
|
|
153
157
|
options.sort_by = :priority
|
154
158
|
end
|
155
159
|
|
156
|
-
opt.on('--ini', 'Output the result
|
160
|
+
opt.on('--ini', 'Output the result as INI format') do |o|
|
157
161
|
options.view = :ini
|
158
162
|
end
|
159
163
|
|
@@ -165,6 +169,9 @@ module Zypper
|
|
165
169
|
options.view = :report
|
166
170
|
end
|
167
171
|
|
172
|
+
opt.on('--solved', 'Output as INI with the suggestions for the invalid repositories applied') do |o|
|
173
|
+
options.view = :solved
|
174
|
+
end
|
168
175
|
|
169
176
|
unless ENV['ZYPPER_UPGRADEREPO']
|
170
177
|
opt.separator ''
|
@@ -12,6 +12,10 @@ module Zypper
|
|
12
12
|
|
13
13
|
UNSTABLE_VERSION = '15.5'
|
14
14
|
|
15
|
+
OS_RELEASE_FILE = '/etc/os-release'
|
16
|
+
|
17
|
+
SUSE_RELEASE_FILE = '/etc/SuSE-release'
|
18
|
+
|
15
19
|
def initialize(options)
|
16
20
|
|
17
21
|
if options.allow_unstable
|
@@ -20,10 +24,10 @@ module Zypper
|
|
20
24
|
@unstable = true
|
21
25
|
end
|
22
26
|
|
23
|
-
fname = if File.exist?
|
24
|
-
|
25
|
-
elsif File.exist?
|
26
|
-
|
27
|
+
fname = if File.exist? self.class::OS_RELEASE_FILE
|
28
|
+
self.class::OS_RELEASE_FILE
|
29
|
+
elsif File.exist? self.class::SUSE_RELEASE_FILE
|
30
|
+
self.class::SUSE_RELEASE_FILE
|
27
31
|
else
|
28
32
|
raise ReleaseFileNotFound
|
29
33
|
end
|
@@ -22,7 +22,7 @@ module Zypper
|
|
22
22
|
@list = []
|
23
23
|
@cpu_arch, @arch = `rpm --eval "%cpu_arch;%_arch"`.tr("\n", '').split(';')
|
24
24
|
|
25
|
-
Dir.glob(File.join(REPOSITORY_PATH, '*.repo')).each do |i|
|
25
|
+
Dir.glob(File.join(self.class::REPOSITORY_PATH, '*.repo')).each do |i|
|
26
26
|
r = Request.build(Repository.new(i), options.timeout)
|
27
27
|
@list << r
|
28
28
|
end
|
@@ -32,6 +32,8 @@ module Zypper
|
|
32
32
|
|
33
33
|
@list.sort_by! { |x| x[:repo].send(options.sort_by) } if options.sort_by != :alias
|
34
34
|
|
35
|
+
@only_repo = select_repos(@only_repo) unless @only_repo.nil?
|
36
|
+
|
35
37
|
load_overrides(options.overrides_filename) if options.overrides_filename
|
36
38
|
end
|
37
39
|
|
@@ -65,12 +67,10 @@ module Zypper
|
|
65
67
|
def resolve_variables!(version)
|
66
68
|
each_with_number do |r|
|
67
69
|
if r.url =~ /\$/
|
68
|
-
r.url = r.url
|
69
|
-
.gsub(/\$releasever_minor/, version.split('.')[1])
|
70
|
-
.gsub(/\$releasever/, version)
|
71
|
-
.gsub(/\$basearch/, @arch)
|
72
|
-
.gsub(/\$arch/, @cpu_arch)
|
70
|
+
r.url = expand_variables(r.url, version)
|
73
71
|
end
|
72
|
+
r.name = expand_variables(r.name, version)
|
73
|
+
r.alias = expand_variables(r.alias, version)
|
74
74
|
end
|
75
75
|
|
76
76
|
self
|
@@ -85,6 +85,49 @@ module Zypper
|
|
85
85
|
|
86
86
|
private
|
87
87
|
|
88
|
+
def select_repos(repos)
|
89
|
+
res = []
|
90
|
+
repos.each do |r|
|
91
|
+
if r.to_i > 0
|
92
|
+
res.push r.to_i
|
93
|
+
elsif r =~ /^\ *@.*/
|
94
|
+
a = r.gsub(/@/, '').strip
|
95
|
+
@list.select { |x| x[:repo].alias.match?(Regexp.new(a, 'i')) }.each do |l|
|
96
|
+
res.push l[:num]
|
97
|
+
end
|
98
|
+
elsif r =~ /^\ *\#.*/
|
99
|
+
u = r.gsub(/\#/, '').strip
|
100
|
+
@list.select { |x| x[:repo].url.match?(Regexp.new(u, 'i')) }.each do |l|
|
101
|
+
res.push l[:num]
|
102
|
+
end
|
103
|
+
elsif r =~ /^\ *\&.*/
|
104
|
+
s = r.gsub(/\&/, '').strip
|
105
|
+
@list.select do |x|
|
106
|
+
x[:repo].alias.match?(Regexp.new(s, 'i')) ||
|
107
|
+
x[:repo].name.match?(Regexp.new(s, 'i')) ||
|
108
|
+
x[:repo].url.match?(Regexp.new(s, 'i'))
|
109
|
+
end.each do |l|
|
110
|
+
res.push l[:num]
|
111
|
+
end
|
112
|
+
else
|
113
|
+
n = r.strip
|
114
|
+
@list.select { |x| x[:repo].name.match?(Regexp.new(n, 'i')) }.each do |l|
|
115
|
+
res.push l[:num]
|
116
|
+
end
|
117
|
+
end
|
118
|
+
end
|
119
|
+
|
120
|
+
res.uniq
|
121
|
+
end
|
122
|
+
|
123
|
+
def expand_variables(str, version)
|
124
|
+
str.gsub(/\$releasever_major/, version.split('.')[0])
|
125
|
+
.gsub(/\$releasever_minor/, version.split('.')[1])
|
126
|
+
.gsub(/\$releasever/, version)
|
127
|
+
.gsub(/\$basearch/, @arch)
|
128
|
+
.gsub(/\$arch/, @cpu_arch)
|
129
|
+
end
|
130
|
+
|
88
131
|
def load_overrides(filename)
|
89
132
|
raise FileNotFound, filename unless File.exist?(filename)
|
90
133
|
ini = IniParse.parse(File.read(filename))
|
@@ -6,7 +6,6 @@ require_relative 'requests/http.rb'
|
|
6
6
|
module Zypper
|
7
7
|
module Upgraderepo
|
8
8
|
|
9
|
-
|
10
9
|
class Request
|
11
10
|
|
12
11
|
def self.build(repo, timeout)
|
@@ -14,7 +13,7 @@ module Zypper
|
|
14
13
|
|
15
14
|
raise InvalidProtocol, repo unless @@registry.include? repo.protocol
|
16
15
|
|
17
|
-
Object.const_get(
|
16
|
+
Object.const_get(self.find_class(repo)).new(repo, timeout)
|
18
17
|
end
|
19
18
|
|
20
19
|
def self.protocols
|
@@ -26,17 +25,26 @@ module Zypper
|
|
26
25
|
def self.load_requests
|
27
26
|
res = {}
|
28
27
|
Requests.constants.each do |klass|
|
29
|
-
Object.const_get("Zypper::Upgraderepo::Requests::#{klass}")
|
30
|
-
|
28
|
+
obj = Object.const_get("Zypper::Upgraderepo::Requests::#{klass}")
|
29
|
+
obj.register_protocol.each do |protocol|
|
30
|
+
res[protocol] ||= {}
|
31
|
+
res[protocol][obj.domain] = "Zypper::Upgraderepo::Requests::#{klass}"
|
31
32
|
end
|
32
33
|
end
|
33
34
|
|
34
35
|
res
|
35
36
|
end
|
36
37
|
|
37
|
-
|
38
|
-
|
38
|
+
def self.find_class(repo)
|
39
|
+
domain = URI(repo.url).hostname
|
39
40
|
|
41
|
+
if @@registry[repo.protocol].has_key? domain
|
42
|
+
return @@registry[repo.protocol][domain]
|
43
|
+
else
|
44
|
+
return @@registry[repo.protocol]['default']
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
40
48
|
|
41
49
|
end
|
42
50
|
end
|
@@ -67,17 +67,21 @@ module Zypper
|
|
67
67
|
http.request(request)
|
68
68
|
end
|
69
69
|
|
70
|
-
def ping(uri = nil, head = true)
|
70
|
+
def ping(uri = nil, head = true, cache = true)
|
71
71
|
begin
|
72
72
|
if @page.nil? || uri
|
73
|
-
|
73
|
+
if cache
|
74
|
+
@page = get_request(uri, head)
|
75
|
+
else
|
76
|
+
unpage = get_request(uri, head)
|
77
|
+
end
|
74
78
|
end
|
75
79
|
rescue SocketError
|
76
80
|
raise NoConnection
|
77
81
|
rescue Net::OpenTimeout
|
78
82
|
@page = Net::HTTPRequestTimeOut.new('1.1', '', '')
|
79
83
|
end
|
80
|
-
@page
|
84
|
+
cache ? @page : unpage
|
81
85
|
end
|
82
86
|
|
83
87
|
end
|
@@ -93,6 +97,8 @@ module Zypper
|
|
93
97
|
|
94
98
|
def self.register_protocol; ['https', 'http'] end
|
95
99
|
|
100
|
+
def self.domain; 'default' end
|
101
|
+
|
96
102
|
def evaluate_alternative(version)
|
97
103
|
if not_found?
|
98
104
|
return traverse_url(URI(url), version)
|
@@ -110,18 +116,28 @@ module Zypper
|
|
110
116
|
end
|
111
117
|
|
112
118
|
def has_repodata?(uri)
|
113
|
-
ping(repodata_uri(uri))
|
114
|
-
available?
|
119
|
+
ping(repodata_uri(uri), true, false).is_a?(Net::HTTPSuccess)
|
115
120
|
end
|
116
121
|
|
117
|
-
def subfolders
|
118
|
-
|
122
|
+
def subfolders(uri)
|
123
|
+
ping.body.to_s.scan(Regexp.new('href=[\'\"][^\/\"]+\/[\'\"]')).delete_if do |x|
|
119
124
|
x =~ /^\// || x =~ /^\.\./ || x =~ /\:\/\// || x =~ /href=[\"\'](media\.1|boot|EFI)\/[\"\']/
|
120
125
|
end.uniq.map do |d|
|
121
126
|
d.scan(/href=[\"\']([^"]+)[\'\"]/).pop.pop
|
122
127
|
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
class DownloadOpensuseOrgRequest < HttpRequest
|
132
|
+
|
133
|
+
def self.domain; 'download.opensuse.org' end
|
123
134
|
|
124
|
-
|
135
|
+
def subfolders(uri)
|
136
|
+
u = URI(uri.to_s)
|
137
|
+
u.path = "/download#{u.path}"
|
138
|
+
u.query = 'jsontable'
|
139
|
+
require 'json'
|
140
|
+
JSON.parse(ping(u, false).body.to_s)["data"].map { |x| x["name"] }
|
125
141
|
end
|
126
142
|
end
|
127
143
|
|
@@ -6,7 +6,9 @@ module Zypper
|
|
6
6
|
def traverse_url(uri, version)
|
7
7
|
ping(uri)
|
8
8
|
|
9
|
-
if
|
9
|
+
if available? && !has_repodata?(uri)
|
10
|
+
return { url: '', message: 'This repository doesn\'t seem working and should be disabled.'}
|
11
|
+
elsif forbidden?
|
10
12
|
res = { url: url, message: 'Can\'t navigate through the repository!' }
|
11
13
|
elsif available? && uri.to_s =~ /#{version}/
|
12
14
|
res = traverse_url_forward(uri, version)
|
@@ -49,7 +51,7 @@ module Zypper
|
|
49
51
|
uri.path += '/' if uri.path[-1] != '/'
|
50
52
|
ping(uri, false)
|
51
53
|
|
52
|
-
subfolders.each do |dir|
|
54
|
+
subfolders(uri).each do |dir|
|
53
55
|
u = URI(uri.to_s)
|
54
56
|
u.path += dir
|
55
57
|
|
@@ -215,7 +215,7 @@ module Zypper
|
|
215
215
|
end
|
216
216
|
|
217
217
|
def self.alternative(num, repo, max_col, alt)
|
218
|
-
self.info num, 'Not Found', repo, false
|
218
|
+
self.info num, 'Not Found', repo, false, alt[:url]
|
219
219
|
puts "hint=#{alt[:message]}"
|
220
220
|
puts "suggested_url=#{alt[:url]}" unless alt[:url].to_s.empty?
|
221
221
|
end
|
@@ -254,12 +254,12 @@ module Zypper
|
|
254
254
|
|
255
255
|
private
|
256
256
|
|
257
|
-
def self.info(num, status, repo, valid = true)
|
257
|
+
def self.info(num, status, repo, valid = true, suggested = '')
|
258
258
|
@@number = num
|
259
259
|
puts "[repository_#{num}]"
|
260
260
|
puts "name=#{repo.name}"
|
261
261
|
puts "alias=#{repo.alias}"
|
262
|
-
puts "old_url=#{repo.old_url}" if repo.upgraded?
|
262
|
+
puts "old_url=#{repo.old_url}" if repo.upgraded? || (!suggested.empty?)
|
263
263
|
if valid
|
264
264
|
if repo.unversioned? && repo.old_url
|
265
265
|
puts <<-'HEADER'.gsub(/^ +/, '')
|
@@ -273,7 +273,7 @@ module Zypper
|
|
273
273
|
elsif repo.enabled?
|
274
274
|
puts <<-'HEADER'.gsub(/^ +/, '')
|
275
275
|
# The interpolated URL is invalid, try overriding with the one suggested
|
276
|
-
# in the
|
276
|
+
# in the field below or find it manually starting from the old_url.
|
277
277
|
# The alternatives are:
|
278
278
|
# 1. Waiting for a repository upgrade;
|
279
279
|
# 2. Change the provider for the related installed packages;
|
@@ -295,6 +295,71 @@ module Zypper
|
|
295
295
|
end
|
296
296
|
end
|
297
297
|
|
298
|
+
|
299
|
+
class Solved < Ini
|
300
|
+
|
301
|
+
def self.alternative(num, repo, max_col, alt)
|
302
|
+
self.info num, 'Not Found', repo, false, alt[:url]
|
303
|
+
puts "hint=#{alt[:message]}"
|
304
|
+
puts "suggested_url=#{alt[:url]}" unless alt[:url].to_s.empty?
|
305
|
+
end
|
306
|
+
|
307
|
+
|
308
|
+
private
|
309
|
+
|
310
|
+
def self.info(num, status, repo, valid = true, suggested = '')
|
311
|
+
@@number = num
|
312
|
+
puts "[repository_#{num}]"
|
313
|
+
puts "name=#{repo.name}"
|
314
|
+
puts "alias=#{repo.alias}"
|
315
|
+
puts "old_url=#{repo.old_url}" if repo.upgraded? || (!suggested.empty?)
|
316
|
+
if valid
|
317
|
+
if repo.unversioned? && repo.old_url
|
318
|
+
puts <<-'HEADER'.gsub(/^ +/, '')
|
319
|
+
# The repository is unversioned: its packages should be perfectly
|
320
|
+
# working regardless the distribution version, that because all the
|
321
|
+
# required dependencies are included in the repository itself and
|
322
|
+
# automatically picked up.
|
323
|
+
HEADER
|
324
|
+
end
|
325
|
+
puts "url=#{repo.url}"
|
326
|
+
elsif repo.enabled?
|
327
|
+
unless suggested.empty?
|
328
|
+
puts <<-'HEADER'.gsub(/^ +/, '')
|
329
|
+
# The interpolated URL is invalid, but the script found an alternative
|
330
|
+
# URL which will be used to override the old value.
|
331
|
+
# Unfortunately the script is not able to know if the found URL is exact,
|
332
|
+
# so review the result before accepting any change, and in case want
|
333
|
+
# to disable it, just turn the "enabled" field below to "No".
|
334
|
+
#
|
335
|
+
HEADER
|
336
|
+
puts "url=#{suggested}"
|
337
|
+
puts 'enabled=Yes'
|
338
|
+
else
|
339
|
+
puts <<-'HEADER'.gsub(/^ +/, '')
|
340
|
+
# The interpolated URL is invalid, and the script has not been able to find
|
341
|
+
# an alternative. The best thing to do here is to disable the repository.
|
342
|
+
# In case a valid alternative will be discovered, just replace its URL in
|
343
|
+
# the "url" field below and make sure to re-enable the repository by switching
|
344
|
+
# the "enabled" field to "Yes" again.
|
345
|
+
#
|
346
|
+
HEADER
|
347
|
+
puts "url=#{repo.old_url}"
|
348
|
+
puts 'enabled=No'
|
349
|
+
end
|
350
|
+
else
|
351
|
+
puts <<-'HEADER'.gsub(/^ +/, '')
|
352
|
+
# The interpolated URL is invalid, but being the repository disabled you can
|
353
|
+
# keep the old_url in the field below, it will be ignored anyway during the
|
354
|
+
# system update and upgrade process until the repository is enabled again.
|
355
|
+
HEADER
|
356
|
+
puts "url=#{suggested.empty? ? repo.old_url : suggested}"
|
357
|
+
end
|
358
|
+
puts "priority=#{repo.priority}"
|
359
|
+
puts "status=#{status}"
|
360
|
+
end
|
361
|
+
end
|
362
|
+
|
298
363
|
end
|
299
364
|
end
|
300
365
|
end
|
data/lib/zypper/upgraderepo.rb
CHANGED
@@ -33,6 +33,7 @@ module Zypper
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def check_current
|
36
|
+
@repos.upgrade!(@os_release.current)
|
36
37
|
check_repos(@os_release.current)
|
37
38
|
end
|
38
39
|
|
@@ -79,6 +80,11 @@ module Zypper
|
|
79
80
|
@view_class.status(@os_release)
|
80
81
|
end
|
81
82
|
|
83
|
+
def update
|
84
|
+
@repos.upgrade!(@os_release.current)
|
85
|
+
upgrade_repos(@os_release.current)
|
86
|
+
end
|
87
|
+
|
82
88
|
private
|
83
89
|
|
84
90
|
def check_repos(version)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zypper-upgraderepo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fabio Mucciante
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,7 +85,7 @@ description: This is just a complement to zypper command which helps to upgrade
|
|
85
85
|
email:
|
86
86
|
- fabio.mucciante@gmail.com
|
87
87
|
executables:
|
88
|
-
-
|
88
|
+
- upgraderepo
|
89
89
|
extensions: []
|
90
90
|
extra_rdoc_files: []
|
91
91
|
files:
|
@@ -97,7 +97,7 @@ files:
|
|
97
97
|
- Rakefile
|
98
98
|
- bin/console
|
99
99
|
- bin/setup
|
100
|
-
- exe/
|
100
|
+
- exe/upgraderepo
|
101
101
|
- lib/zypper/upgraderepo.rb
|
102
102
|
- lib/zypper/upgraderepo/cli.rb
|
103
103
|
- lib/zypper/upgraderepo/os_release.rb
|
@@ -116,7 +116,7 @@ licenses:
|
|
116
116
|
metadata:
|
117
117
|
bug_tracker_uri: https://github.com/fabiomux/zypper-upgraderepo/issues
|
118
118
|
changelog_uri: https://freeaptitude.altervista.org/projects/zypper-upgraderepo.html#changelog
|
119
|
-
documentation_uri: https://www.rubydoc.info/gems/zypper-upgraderepo/1.
|
119
|
+
documentation_uri: https://www.rubydoc.info/gems/zypper-upgraderepo/1.8.0
|
120
120
|
homepage_uri: https://freeaptitude.altervista.org/projects/zypper-upgraderepo.html
|
121
121
|
source_code_uri: https://github.com/fabiomux/zypper-upgraderepo
|
122
122
|
wiki_uri: https://github.com/fabiomux/zypper-upgraderepo/wiki
|
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
137
|
requirements: []
|
138
|
-
rubygems_version: 3.2.
|
138
|
+
rubygems_version: 3.2.3
|
139
139
|
signing_key:
|
140
140
|
specification_version: 4
|
141
141
|
summary: Zypper addon to check and upgrade local repositories.
|