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
c96afbea
Commit
c96afbea
authored
14 years ago
by
Anders Blomdell
Browse files
Options
Downloads
Patches
Plain Diff
Version 2010-12-02 14:33
parent
7537cb24
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
+16
-0
16 additions, 0 deletions
src/mio.py
src/mio/installer.py
+9
-0
9 additions, 0 deletions
src/mio/installer.py
src/mio/node.py
+4
-3
4 additions, 3 deletions
src/mio/node.py
with
29 additions
and
3 deletions
src/mio.py
+
16
−
0
View file @
c96afbea
...
...
@@ -89,6 +89,10 @@ if __name__ == '__main__':
action
=
"
append
"
,
default
=
[],
metavar
=
"
XML
"
,
help
=
"
list available targets in XML
"
)
optParser
.
add_option
(
"
--list-rpms
"
,
action
=
"
append
"
,
default
=
[],
metavar
=
"
TARGET
"
,
help
=
"
list rpms needed for TARGET
"
)
optParser
.
add_option
(
"
--noyum
"
,
action
=
"
store_true
"
,
help
=
"
don
'
t run yum (rpms will not be installed)
"
)
...
...
@@ -146,6 +150,18 @@ if __name__ == '__main__':
for
r
in
error
[
e
]:
print
"
from:
'
%s
'
in %s:%s
"
%
(
r
.
name
[
0
],
r
.
_url
,
r
.
_line
)
if
options
.
list_rpms
:
installer
=
mio
.
installer
.
Installer
(
rules
)
for
g
in
options
.
list_rpms
:
installer
.
add_group
(
g
)
pass
log
(
NORMAL
,
"
# List rpms for %s
"
%
options
.
list_rpms
)
for
r
in
installer
.
list_rpms
():
print
r
pass
pass
if
options
.
reachable_files
:
# List all files reachable from the given source files
reachable_rules
=
mio
.
repository
.
Repository
(
find_and_parse
,
...
...
This diff is collapsed.
Click to expand it.
src/mio/installer.py
+
9
−
0
View file @
c96afbea
...
...
@@ -154,6 +154,14 @@ class Installer:
self
.
symlink
[
symlink
]
=
[
symlink
]
return
self
.
symlink
[
symlink
][
0
]
def
list_rpms
(
self
):
rpms
=
[]
for
r
in
self
.
rpm
:
rpms
.
append
(
str
(
r
.
name
))
pass
rpms
.
sort
()
return
rpms
def
install_rpms
(
self
,
path
):
rpm
=
[]
version_db
=
mio
.
rpmDB
.
VersionDB
()
...
...
@@ -162,6 +170,7 @@ class Installer:
if
r
.
old_version
==
None
:
rpm
.
append
(
r
.
name
)
rpm
.
sort
()
print
rpm
mio
.
yum
.
run
(
path
+
self
.
rpmdir
,
rpm
)
version_db
=
mio
.
rpmDB
.
VersionDB
()
for
r
in
self
.
rpm
:
...
...
This diff is collapsed.
Click to expand it.
src/mio/node.py
+
4
−
3
View file @
c96afbea
...
...
@@ -293,7 +293,8 @@ class file_node(target_node):
tstat
=
os
.
stat
(
self
.
target
)
sstat
=
os
.
stat
(
self
.
source
)
if
not
self
.
touch
and
tstat
.
st_mtime
!=
sstat
.
st_mtime
:
if
(
not
self
.
touch
and
int
(
tstat
.
st_mtime
)
!=
int
(
sstat
.
st_mtime
)):
result
=
True
self
.
action
.
append
(
self
.
mtime
)
else
:
...
...
@@ -361,7 +362,7 @@ class file_node(target_node):
os
.
chmod
(
target
,
self
.
mode
)
if
not
self
.
touch
:
stat
=
os
.
stat
(
self
.
source
)
os
.
utime
(
target
,
(
stat
.
st_atime
,
stat
.
st_mtime
))
os
.
utime
(
target
,
(
stat
.
st_atime
,
int
(
stat
.
st_mtime
))
)
# Replace target with temporary file
try
:
os
.
unlink
(
self
.
target
)
...
...
@@ -381,7 +382,7 @@ class file_node(target_node):
def
mtime
(
self
,
backup
):
# Propagate mtime (and atime)
stat
=
os
.
stat
(
self
.
source
)
os
.
utime
(
self
.
target
,
(
stat
.
st_atime
,
stat
.
st_mtime
))
os
.
utime
(
self
.
target
,
(
stat
.
st_atime
,
int
(
stat
.
st_mtime
))
)
class
symlink_node
(
target_node
):
def
__init__
(
self
,
name
,
decl
=
None
,
group
=
None
):
...
...
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