Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
Seblu
installsystems
Commits
89ded707
Commit
89ded707
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
better display during repo cleaning
parent
12a4b4ae
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
installsystems/repository.py
+10
-0
10 additions, 0 deletions
installsystems/repository.py
with
10 additions
and
0 deletions
installsystems/repository.py
+
10
−
0
View file @
89ded707
...
@@ -193,10 +193,18 @@ class Repository(object):
...
@@ -193,10 +193,18 @@ class Repository(object):
repofiles
=
set
(
os
.
listdir
(
self
.
config
.
path
))
-
set
([
self
.
config
.
dbname
,
self
.
config
.
lastname
])
repofiles
=
set
(
os
.
listdir
(
self
.
config
.
path
))
-
set
([
self
.
config
.
dbname
,
self
.
config
.
lastname
])
dirtyfiles
=
repofiles
-
allmd5
dirtyfiles
=
repofiles
-
allmd5
if
len
(
dirtyfiles
)
>
0
:
if
len
(
dirtyfiles
)
>
0
:
# print dirty files
arrow
(
"
Dirty files:
"
)
for
f
in
dirtyfiles
:
arrow
(
f
,
1
)
# ask confirmation
if
not
confirm
(
"
Remove dirty files? (yes)
"
):
if
not
confirm
(
"
Remove dirty files? (yes)
"
):
raise
Exception
(
"
Aborted!
"
)
raise
Exception
(
"
Aborted!
"
)
# start cleaning
arrow
(
"
Cleaning
"
)
for
f
in
dirtyfiles
:
for
f
in
dirtyfiles
:
p
=
os
.
path
.
join
(
self
.
config
.
path
,
f
)
p
=
os
.
path
.
join
(
self
.
config
.
path
,
f
)
arrow
(
"
Removing %s
"
%
p
,
1
)
try
:
try
:
if
os
.
path
.
isdir
(
p
):
if
os
.
path
.
isdir
(
p
):
os
.
rmdir
(
p
)
os
.
rmdir
(
p
)
...
@@ -204,6 +212,8 @@ class Repository(object):
...
@@ -204,6 +212,8 @@ class Repository(object):
os
.
unlink
(
p
)
os
.
unlink
(
p
)
except
:
except
:
raise
Exception
(
"
Removing %s failed
"
%
p
)
raise
Exception
(
"
Removing %s failed
"
%
p
)
else
:
arrow
(
"
Nothing to clean
"
)
def
delete
(
self
,
name
,
version
):
def
delete
(
self
,
name
,
version
):
'''
'''
...
...
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