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
Nicolas Wavrant
slapos.package
Commits
1dd26cbc
Commit
1dd26cbc
authored
Feb 24, 2014
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Zypper support.
parent
cd0d7240
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
slapos/package/distribution.py
slapos/package/distribution.py
+10
-5
No files found.
slapos/package/distribution.py
View file @
1dd26cbc
...
...
@@ -2,6 +2,7 @@ import platform
import
glob
import
re
import
os
import
subprocess
_distributor_id_file_re
=
re
.
compile
(
"(?:DISTRIB_ID
\
s*=)
\
s*(.*)"
,
re
.
I
)
_release_file_re
=
re
.
compile
(
"(?:DISTRIB_RELEASE
\
s*=)
\
s*(.*)"
,
re
.
I
)
...
...
@@ -51,10 +52,10 @@ class PackageManager:
def
_getDistribitionHandler
(
self
):
distribution_name
=
self
.
getDistributionName
()
if
distribution_name
.
lower
()
==
'opensuse'
:
if
distribution_name
.
lower
()
.
strip
()
==
'opensuse'
:
return
Zypper
()
elif
distribution_name
.
lower
()
in
[
'debian'
,
'ubuntu'
]:
elif
distribution_name
.
lower
()
.
strip
()
in
[
'debian'
,
'ubuntu'
]:
return
AptGet
()
raise
NotImplemented
(
"Distribution (%s) is not Supported!"
%
distribution_name
)
...
...
@@ -145,14 +146,18 @@ class AptGet:
class
Zypper
:
def
purgeRepository
(
self
,
caller
):
"""Remove all repositories"""
listing
,
err
=
caller
([
'zypper'
,
'lr'
])
listing
,
err
=
caller
([
'zypper'
,
'lr'
]
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
while
listing
.
count
(
'
\
n
'
)
>
2
:
output
,
err
=
caller
([
'zypper'
,
'rr'
,
'1'
],
stdout
=
None
)
listing
,
err
=
caller
([
'zypper'
,
'lr'
])
listing
,
err
=
caller
([
'zypper'
,
'lr'
]
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
def
addRepository
(
self
,
caller
,
url
,
alias
):
""" Add a repository """
output
,
err
=
caller
([
'zypper'
,
'ar'
,
'-fc'
,
url
,
alias
],
stdout
=
None
)
base_command
=
[
'zypper'
,
'ar'
,
'-fc'
]
if
alias
.
endswith
(
"unsafe"
):
base_command
.
append
(
'--no-gpgcheck'
)
base_command
.
extend
([
url
,
alias
])
output
,
err
=
caller
(
base_command
,
stdout
=
None
)
def
updateRepository
(
self
,
caller
):
""" Add a repository """
...
...
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