Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
mio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Anders Blomdell
mio
Commits
f6e13bca
Commit
f6e13bca
authored
14 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Version 2011-02-17 13:26
parent
c96afbea
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/mio.py
+8
-2
8 additions, 2 deletions
src/mio.py
src/mio/installer.py
+7
-3
7 additions, 3 deletions
src/mio/installer.py
src/mio/yum.py
+4
-2
4 additions, 2 deletions
src/mio/yum.py
with
19 additions
and
7 deletions
src/mio.py
+
8
−
2
View file @
f6e13bca
...
...
@@ -81,6 +81,10 @@ if __name__ == '__main__':
optParser
.
add_option
(
"
--dump
"
,
action
=
"
store_true
"
,
default
=
False
,
help
=
"
when listing, dump XML tree
"
)
optParser
.
add_option
(
"
--exclude-rpm
"
,
action
=
"
append
"
,
default
=
[],
metavar
=
"
RPM
"
,
help
=
"
exclude RPM
"
)
optParser
.
add_option
(
"
--install
"
,
action
=
"
append
"
,
default
=
[],
metavar
=
"
TARGET
"
,
...
...
@@ -217,7 +221,8 @@ if __name__ == '__main__':
if
not
options
.
noyum
:
log
(
NORMAL
,
"
Testing rpms
"
)
installer
.
test_rpms
(
options
.
path
)
installer
.
test_rpms
(
options
.
path
,
options
.
exclude_rpm
)
log
(
NORMAL
,
"
Testing files
"
)
installer
.
test_groups
(
options
.
prefix
)
...
...
@@ -229,7 +234,8 @@ if __name__ == '__main__':
if
not
options
.
noyum
:
log
(
NORMAL
,
"
Installing rpms
"
)
rpm_result
=
installer
.
install_rpms
(
options
.
path
)
rpm_result
=
installer
.
install_rpms
(
options
.
path
,
options
.
exclude_rpm
)
log
(
NORMAL
,
"
Installing files
"
)
installer
.
install_groups
(
options
.
prefix
,
...
...
This diff is collapsed.
Click to expand it.
src/mio/installer.py
+
7
−
3
View file @
f6e13bca
...
...
@@ -162,16 +162,19 @@ class Installer:
rpms
.
sort
()
return
rpms
def
install_rpms
(
self
,
path
):
def
install_rpms
(
self
,
path
,
exclude
):
rpm
=
[]
version_db
=
mio
.
rpmDB
.
VersionDB
()
for
r
in
self
.
rpm
:
r
.
old_version
=
version_db
[
r
.
name
]
if
r
.
old_version
==
None
:
rpm
.
append
(
r
.
name
)
pass
pass
rpm
=
filter
(
lambda
p
:
not
p
in
exclude
,
rpm
)
rpm
.
sort
()
print
rpm
mio
.
yum
.
run
(
path
+
self
.
rpmdir
,
rpm
)
mio
.
yum
.
run
(
path
+
self
.
rpmdir
,
rpm
,
exclude
)
version_db
=
mio
.
rpmDB
.
VersionDB
()
for
r
in
self
.
rpm
:
r
.
new_version
=
version_db
[
r
.
name
]
...
...
@@ -186,7 +189,8 @@ class Installer:
for
g
in
self
.
group
:
g
.
install
(
prefix
,
backup
)
def
test_rpms
(
self
,
path
):
def
test_rpms
(
self
,
path
,
exclude
):
log
(
NORMAL
,
"
Excluding rpms:
"
+
"
,
"
.
join
(
exclude
))
pass
def
test_groups
(
self
,
prefix
):
...
...
This diff is collapsed.
Click to expand it.
src/mio/yum.py
+
4
−
2
View file @
f6e13bca
...
...
@@ -71,7 +71,7 @@ def conf(path):
return
"
\n
"
.
join
(
result
)
def
run
(
path
,
rpm
):
def
run
(
path
,
rpm
,
exclude
):
c
=
conf
(
path
)
f
=
mio
.
filecache
.
createfile
()
f
.
write
(
c
)
...
...
@@ -90,7 +90,9 @@ def run(path, rpm):
# to be done before the install, because outdated packages
# need to be updated before the install, or we might get
# a conflict.
update
=
"
yum -c %s -e %s -d %s -y update
"
%
(
f
.
name
,
verb
,
verb
)
exclude_arg
=
map
(
lambda
s
:
"
-x %s
"
%
s
,
exclude
)
update
=
"
yum -c %s -e %s -d %s -y update %s
"
%
(
f
.
name
,
verb
,
verb
,
"
"
.
join
(
exclude_arg
))
mio
.
log
.
log
(
NORMAL
,
update
)
mio
.
daemon_cage
.
system
(
update
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment