Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
settingsd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
settingsd
Commits
2e2c2fbf
Commit
2e2c2fbf
authored
Mar 13, 2019
by
Дмитрий Никулин
Committed by
Никита Ефремов
Apr 24, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Return versions for upgradable packages
parent
e837a92a
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
fmod_package_updates.py
plugins/functions/fmod_package_updates.py
+3
-3
No files found.
plugins/functions/fmod_package_updates.py
View file @
2e2c2fbf
...
@@ -19,13 +19,13 @@ APT_COMMANDS = (
...
@@ -19,13 +19,13 @@ APT_COMMANDS = (
'download'
,
'changelog'
,
'build-dep'
,
'full-upgrade'
,
'show'
,
'list'
,
'download'
,
'changelog'
,
'build-dep'
,
'full-upgrade'
,
'show'
,
'list'
,
'edit-sources'
'edit-sources'
)
)
PACKAGE_REGEX
=
re
.
compile
(
r'^(\S+)/\S+'
)
PACKAGE_REGEX
=
re
.
compile
(
r'^(\S+)/\S+
\s(\S+)
'
)
MULTIPLE_SPACES_REGEX
=
re
.
compile
(
r'\s{2,}'
)
MULTIPLE_SPACES_REGEX
=
re
.
compile
(
r'\s{2,}'
)
class
PackageUpdates
(
service
.
FunctionObject
)
:
class
PackageUpdates
(
service
.
FunctionObject
)
:
@service.functionMethod
(
INTERFACE_NAME
,
in_signature
=
""
,
out_signature
=
"as"
)
@service.functionMethod
(
INTERFACE_NAME
,
in_signature
=
""
,
out_signature
=
"a
a
s"
)
def
get_available_updates
(
self
):
def
get_available_updates
(
self
):
execProcess
([
APT_EXECUTABLE
,
'update'
])
execProcess
([
APT_EXECUTABLE
,
'update'
])
raw_output
,
=
execProcess
([
APT_EXECUTABLE
,
'list'
,
'--upgradable'
])[:
1
]
raw_output
,
=
execProcess
([
APT_EXECUTABLE
,
'list'
,
'--upgradable'
])[:
1
]
...
@@ -47,7 +47,7 @@ class PackageUpdates(service.FunctionObject) :
...
@@ -47,7 +47,7 @@ class PackageUpdates(service.FunctionObject) :
def
_extract_upgradable_packages
(
self
,
apt_output
):
def
_extract_upgradable_packages
(
self
,
apt_output
):
lines
=
apt_output
.
split
(
'
\n
'
)
lines
=
apt_output
.
split
(
'
\n
'
)
matches
=
[
PACKAGE_REGEX
.
match
(
line
)
for
line
in
lines
]
matches
=
[
PACKAGE_REGEX
.
match
(
line
)
for
line
in
lines
]
return
[
m
[
1
]
for
m
in
matches
if
m
]
return
[
[
m
[
1
],
m
[
2
]
]
for
m
in
matches
if
m
]
def
_parse_apt_block
(
self
,
block
):
def
_parse_apt_block
(
self
,
block
):
fields
=
{}
fields
=
{}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment