You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When parsing installed alpine linux packages, the parser is skipping some packages due to the incomplete regex which results in pyinfra constantly trying to install a package that is already installed on the system
To Reproduce
Attached is the list of all the weird versions I quickly found on my system, note the openssh-server-9.3_p2-r0 x86_64 or syslinux-6.04_pre1-r13 x86_64 and less-633-r0
Expected behavior
Returned list of packages in the APK Fact class should return the same number of packages as apk list -I
This is the best I could do, I don't think its even humanly possible to write a correct regex for this, that is why I split it into parts and searched for part which begins with a number in order to find where name and version were split
import re
with open("list.txt") as fh:
lines = fh.readlines()
packages = dict()
for line in lines:
line = line.strip()
columns = line.split(" ")
name_and_version = columns[0]
parts = name_and_version.split("-")
idx = 1
while idx < len(parts):
if re.match(r"^\d", parts[idx]):
name = "-".join(parts[0:idx])
version = "-".join(parts[idx:])
packages[name] = version
idx += 1
print(packages)
The text was updated successfully, but these errors were encountered:
Describe the bug
When parsing installed alpine linux packages, the parser is skipping some packages due to the incomplete regex which results in pyinfra constantly trying to install a package that is already installed on the system
To Reproduce
Attached is the list of all the weird versions I quickly found on my system, note the
openssh-server-9.3_p2-r0 x86_64
orsyslinux-6.04_pre1-r13 x86_64
andless-633-r0
Expected behavior
Returned list of packages in the APK Fact class should return the same number of packages as
apk list -I
Meta
Some weird examples
This is the best I could do, I don't think its even humanly possible to write a correct regex for this, that is why I split it into parts and searched for part which begins with a number in order to find where name and version were split
The text was updated successfully, but these errors were encountered: