Skip to content

Commit 3283167

Browse files
rsfziFizzadar
andauthored
AptSources can now parse components with digits (#1202)
* AptSources now returns components as list instead of set to make updates possible * fixed lint errors * AptSources now recognizes components with digits in name, too --------- Co-authored-by: Nick Mills-Barrett <nick@fizzadar.com>
1 parent f4361ff commit 3283167

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

pyinfra/facts/apt.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010

1111
def parse_apt_repo(name):
12-
regex = r"^(deb(?:-src)?)(?:\s+\[([^\]]+)\])?\s+([^\s]+)\s+([^\s]+)\s+([a-z-\s]*)$"
12+
regex = r"^(deb(?:-src)?)(?:\s+\[([^\]]+)\])?\s+([^\s]+)\s+([^\s]+)\s+([a-z-\s\d]*)$"
1313

1414
matches = re.match(regex, name)
1515

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"output": [
3+
"deb http://archive.ubuntu.com/ubuntu trusty restricted pi4"
4+
],
5+
"command": "(! test -f /etc/apt/sources.list || cat /etc/apt/sources.list) && (cat /etc/apt/sources.list.d/*.list || true)",
6+
"requires_command": "apt",
7+
"fact": [
8+
{
9+
"url": "http://archive.ubuntu.com/ubuntu",
10+
"distribution": "trusty",
11+
"type": "deb",
12+
"components": [
13+
"restricted",
14+
"pi4"
15+
],
16+
"options": {}
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)