Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.package
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Douglas
slapos.package
Commits
cd600cda
Commit
cd600cda
authored
Jun 11, 2014
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos.package.distribute: Check existence before take action
parent
79561a0d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
slapos/package/distribution.py
slapos/package/distribution.py
+5
-2
No files found.
slapos/package/distribution.py
View file @
cd600cda
...
@@ -146,13 +146,16 @@ class AptGet:
...
@@ -146,13 +146,16 @@ class AptGet:
def
purgeRepository
(
self
,
caller
):
def
purgeRepository
(
self
,
caller
):
""" Remove all repositories """
""" Remove all repositories """
# Aggressive removal
# Aggressive removal
os
.
remove
(
self
.
source_list_path
)
if
os
.
path
.
exists
(
self
.
source_list_path
):
os
.
remove
(
self
.
source_list_path
)
open
(
self
.
source_list_path
,
"w+"
).
write
(
"# Removed all"
)
open
(
self
.
source_list_path
,
"w+"
).
write
(
"# Removed all"
)
for
file_path
in
glob
.
glob
(
"%s/*"
%
self
.
source_list_d_path
):
for
file_path
in
glob
.
glob
(
"%s/*"
%
self
.
source_list_d_path
):
os
.
remove
(
file_path
)
os
.
remove
(
file_path
)
def
addRepository
(
self
,
caller
,
url
,
alias
):
def
addRepository
(
self
,
caller
,
url
,
alias
):
""" Add a repository """
""" Add a repository """
if
not
os
.
path
.
exists
(
self
.
source_list_d_path
):
os
.
mkdir
(
self
.
source_list_d_path
)
repos_file
=
open
(
"%s/%s.list"
%
(
self
.
source_list_d_path
,
alias
),
"w"
)
repos_file
=
open
(
"%s/%s.list"
%
(
self
.
source_list_d_path
,
alias
),
"w"
)
prefix
=
"deb "
prefix
=
"deb "
if
alias
.
endswith
(
"-src"
):
if
alias
.
endswith
(
"-src"
):
...
@@ -209,7 +212,7 @@ class Zypper:
...
@@ -209,7 +212,7 @@ class Zypper:
if
alias
.
endswith
(
"unsafe"
):
if
alias
.
endswith
(
"unsafe"
):
base_command
.
append
(
'--no-gpgcheck'
)
base_command
.
append
(
'--no-gpgcheck'
)
base_command
.
extend
([
url
,
alias
])
base_command
.
extend
([
url
,
alias
])
output
,
err
=
caller
(
base_command
,
stdout
=
None
)
caller
(
base_command
,
stdout
=
None
)
def
addKey
(
self
,
caller
,
url
,
alias
):
def
addKey
(
self
,
caller
,
url
,
alias
):
""" Add gpg or key """
""" Add gpg or key """
...
...
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