apt-spy2 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +6 -0
- data/.github/workflows/codeql-analysis.yml +4 -4
- data/.github/workflows/pr.yml +2 -0
- data/.github/workflows/release.yml +2 -1
- data/Gemfile.lock +1 -1
- data/README.md +13 -12
- data/apt-spy2.gemspec +1 -1
- data/lib/apt/spy2/request.rb +3 -0
- data/lib/apt/spy2/version.rb +1 -1
- data/lib/apt/spy2.rb +5 -6
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7622e67a84b791b9ff1e03931d4b216d5a2bd879b0ac9334ee6ccc140e1c16b9
|
4
|
+
data.tar.gz: a5fc5ef8e9fc0a98e7448253d0e95dc6a55113b3586ae7fbfabb260d78f0c6ff
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f4fd668a86d485758610e2870cd7650c5875671711a027f6149a80ce63134f817b41087aa795ff40106ee39041f78f333224b5285c90d769ee4142a225f3693
|
7
|
+
data.tar.gz: d6be7ad7b4db2471f3ef28d5ae6efc4bd9e44fb09c8f3fb337330c42aed0913c784e501eab6bdc6d8f7ac252da759336d06cb2034158c4d221dce21f4fb464b9
|
data/.github/dependabot.yml
CHANGED
@@ -38,11 +38,11 @@ jobs:
|
|
38
38
|
|
39
39
|
steps:
|
40
40
|
- name: Checkout repository
|
41
|
-
uses: actions/checkout@
|
41
|
+
uses: actions/checkout@v3
|
42
42
|
|
43
43
|
# Initializes the CodeQL tools for scanning.
|
44
44
|
- name: Initialize CodeQL
|
45
|
-
uses: github/codeql-action/init@
|
45
|
+
uses: github/codeql-action/init@v2
|
46
46
|
with:
|
47
47
|
languages: ${{ matrix.language }}
|
48
48
|
# If you wish to specify custom queries, you can do so here or in a config file.
|
@@ -53,7 +53,7 @@ jobs:
|
|
53
53
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
54
54
|
# If this step fails, then you should remove it and run the build manually (see below)
|
55
55
|
- name: Autobuild
|
56
|
-
uses: github/codeql-action/autobuild@
|
56
|
+
uses: github/codeql-action/autobuild@v2
|
57
57
|
|
58
58
|
# ℹ️ Command-line programs to run using the OS shell.
|
59
59
|
# 📚 https://git.io/JvXDl
|
@@ -67,4 +67,4 @@ jobs:
|
|
67
67
|
# make release
|
68
68
|
|
69
69
|
- name: Perform CodeQL Analysis
|
70
|
-
uses: github/codeql-action/analyze@
|
70
|
+
uses: github/codeql-action/analyze@v2
|
data/.github/workflows/pr.yml
CHANGED
@@ -26,6 +26,7 @@ jobs:
|
|
26
26
|
- run: ls -lah ./pkg/apt-spy2*
|
27
27
|
- run: gem install pkg/apt-spy2*
|
28
28
|
- run: apt-spy2 check
|
29
|
+
- run: sudo env "PATH=$PATH" apt-spy2 fix --commit
|
29
30
|
- uses: coverallsapp/github-action@master
|
30
31
|
with:
|
31
32
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
@@ -43,5 +44,6 @@ jobs:
|
|
43
44
|
- run: ls -lah ./pkg/apt-spy2*
|
44
45
|
- run: gem install pkg/apt-spy2*
|
45
46
|
- run: apt-spy2 check --strict
|
47
|
+
- run: sudo env "PATH=$PATH" apt-spy2 fix --commit --strict
|
46
48
|
|
47
49
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -3,20 +3,20 @@
|
|
3
3
|
… or: "apt-spy for Ubuntu"
|
4
4
|
|
5
5
|
[![pr](https://github.com/lagged/apt-spy2/actions/workflows/pr.yml/badge.svg)](https://github.com/lagged/apt-spy2/actions/workflows/pr.yml)
|
6
|
-
|
6
|
+
![apt-spy2 (including prereleases)](https://img.shields.io/gem/v/apt-spy2?include_prereleases)
|
7
7
|
[![Code Climate](https://codeclimate.com/github/lagged/apt-spy2.png)](https://codeclimate.com/github/lagged/apt-spy2)
|
8
8
|
[![Coverage Status](https://coveralls.io/repos/lagged/apt-spy2/badge.png)](https://coveralls.io/r/lagged/apt-spy2)
|
9
9
|
|
10
10
|
|
11
11
|
## Installation
|
12
12
|
|
13
|
-
```
|
13
|
+
```sh
|
14
14
|
gem install apt-spy2
|
15
15
|
```
|
16
16
|
|
17
17
|
## Usage
|
18
18
|
|
19
|
-
```
|
19
|
+
```sh
|
20
20
|
$ apt-spy2 [21:03:52]
|
21
21
|
apt-spy2 commands:
|
22
22
|
apt-spy2 check # Evaluate mirrors
|
@@ -30,14 +30,14 @@ apt-spy2 commands:
|
|
30
30
|
Displays a list of currently available mirrors. These mirrors are automatically selected via
|
31
31
|
[ubuntu-mirrors](http://mirrors.ubuntu.com) using your IP's location.
|
32
32
|
|
33
|
-
```
|
33
|
+
```sh
|
34
34
|
$ apt-spy2 list
|
35
35
|
...
|
36
36
|
```
|
37
37
|
|
38
38
|
Since `mirrors.ubuntu.com` is frequently down, you can the list on [Launchpad](launchpad.net/ubuntu/+archivemirrors):
|
39
39
|
|
40
|
-
```
|
40
|
+
```sh
|
41
41
|
$ apt-spy2 list --launchpad --country=Germany
|
42
42
|
...
|
43
43
|
```
|
@@ -46,7 +46,7 @@ $ apt-spy2 list --launchpad --country=Germany
|
|
46
46
|
|
47
47
|
`check` works like `list`, but also determines if the servers returned are working. It supports the flag `--launchpad` as well and additionally a flag `--strict` which checks if a mirror carries a certain release and distribution.
|
48
48
|
|
49
|
-
```
|
49
|
+
```sh
|
50
50
|
$ apt-spy2 check
|
51
51
|
...
|
52
52
|
$ apt-spy2 check --launchpad --country=US
|
@@ -70,10 +70,10 @@ See `apt-spy2 help list|check|fix` for available options.
|
|
70
70
|
|
71
71
|
### exit codes
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
* 0 - all went well
|
74
|
+
* 1 - some kind of error
|
75
75
|
|
76
|
-
### output and non-
|
76
|
+
### output and non-interactive behavior
|
77
77
|
|
78
78
|
See `apt-spy2 help COMMAND` for more information.
|
79
79
|
|
@@ -85,6 +85,7 @@ Generally, `apt-spy2` plays especially nice in a non-interactive environment and
|
|
85
85
|
|
86
86
|
### Release (procedure)
|
87
87
|
|
88
|
-
|
89
|
-
|
90
|
-
|
88
|
+
* update version in `lib/apt/spy2/version.rb`
|
89
|
+
* `bundle install`
|
90
|
+
* `git commit -a 'Prep x.y.z'
|
91
|
+
* `git tag -a vVERSION && git push --tags`
|
data/apt-spy2.gemspec
CHANGED
data/lib/apt/spy2/request.rb
CHANGED
@@ -11,7 +11,10 @@ module Apt
|
|
11
11
|
def initialize(url)
|
12
12
|
uri = URI(url)
|
13
13
|
|
14
|
+
# sets hopefully sensible timeouts for read and connection
|
14
15
|
http = Net::HTTP.new(uri.host, uri.port)
|
16
|
+
http.read_timeout = 10
|
17
|
+
http.open_timeout = 10
|
15
18
|
http.use_ssl = true if uri.scheme == 'https'
|
16
19
|
|
17
20
|
@http = http
|
data/lib/apt/spy2/version.rb
CHANGED
data/lib/apt/spy2.rb
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require 'thor'
|
4
|
-
require 'open-uri'
|
5
4
|
require 'colored'
|
6
5
|
require 'fileutils'
|
7
6
|
require 'apt/spy2/writer'
|
@@ -129,10 +128,10 @@ class AptSpy2 < Thor
|
|
129
128
|
t = Time.now
|
130
129
|
r = `lsb_release -c`.split(' ')[1]
|
131
130
|
sources = "## Updated on #{t} by apt-spy2\n"
|
132
|
-
sources
|
133
|
-
sources
|
134
|
-
sources
|
135
|
-
sources
|
131
|
+
sources += "deb #{mirror} #{r} main restricted universe multiverse\n"
|
132
|
+
sources += "deb #{mirror} #{r}-updates main restricted universe multiverse\n"
|
133
|
+
sources += "deb #{mirror} #{r}-backports main restricted universe multiverse\n"
|
134
|
+
sources += "deb #{mirror} #{r}-security main restricted universe multiverse\n"
|
136
135
|
|
137
136
|
apt_sources = '/etc/apt/sources.list'
|
138
137
|
|
@@ -143,7 +142,7 @@ class AptSpy2 < Thor
|
|
143
142
|
end
|
144
143
|
rescue StandardError
|
145
144
|
msg = "Failed updating #{apt_sources}!"
|
146
|
-
msg
|
145
|
+
msg += 'You probably need sudo!'
|
147
146
|
raise msg
|
148
147
|
end
|
149
148
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: apt-spy2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- till
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colored
|