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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Rafael Monnerat
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:
def
purgeRepository
(
self
,
caller
):
""" Remove all repositories """
# 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"
)
for
file_path
in
glob
.
glob
(
"%s/*"
%
self
.
source_list_d_path
):
os
.
remove
(
file_path
)
def
addRepository
(
self
,
caller
,
url
,
alias
):
""" 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"
)
prefix
=
"deb "
if
alias
.
endswith
(
"-src"
):
...
...
@@ -209,7 +212,7 @@ class Zypper:
if
alias
.
endswith
(
"unsafe"
):
base_command
.
append
(
'--no-gpgcheck'
)
base_command
.
extend
([
url
,
alias
])
output
,
err
=
caller
(
base_command
,
stdout
=
None
)
caller
(
base_command
,
stdout
=
None
)
def
addKey
(
self
,
caller
,
url
,
alias
):
""" 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