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
Klaus Wölfel
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
Hide 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
...
@@ -2,6 +2,7 @@ import platform
import
glob
import
glob
import
re
import
re
import
os
import
os
import
subprocess
_distributor_id_file_re
=
re
.
compile
(
"(?:DISTRIB_ID
\
s*=)
\
s*(.*)"
,
re
.
I
)
_distributor_id_file_re
=
re
.
compile
(
"(?:DISTRIB_ID
\
s*=)
\
s*(.*)"
,
re
.
I
)
_release_file_re
=
re
.
compile
(
"(?:DISTRIB_RELEASE
\
s*=)
\
s*(.*)"
,
re
.
I
)
_release_file_re
=
re
.
compile
(
"(?:DISTRIB_RELEASE
\
s*=)
\
s*(.*)"
,
re
.
I
)
...
@@ -51,10 +52,10 @@ class PackageManager:
...
@@ -51,10 +52,10 @@ class PackageManager:
def
_getDistribitionHandler
(
self
):
def
_getDistribitionHandler
(
self
):
distribution_name
=
self
.
getDistributionName
()
distribution_name
=
self
.
getDistributionName
()
if
distribution_name
.
lower
()
==
'opensuse'
:
if
distribution_name
.
lower
()
.
strip
()
==
'opensuse'
:
return
Zypper
()
return
Zypper
()
elif
distribution_name
.
lower
()
in
[
'debian'
,
'ubuntu'
]:
elif
distribution_name
.
lower
()
.
strip
()
in
[
'debian'
,
'ubuntu'
]:
return
AptGet
()
return
AptGet
()
raise
NotImplemented
(
"Distribution (%s) is not Supported!"
%
distribution_name
)
raise
NotImplemented
(
"Distribution (%s) is not Supported!"
%
distribution_name
)
...
@@ -145,14 +146,18 @@ class AptGet:
...
@@ -145,14 +146,18 @@ class AptGet:
class
Zypper
:
class
Zypper
:
def
purgeRepository
(
self
,
caller
):
def
purgeRepository
(
self
,
caller
):
"""Remove all repositories"""
"""Remove all repositories"""
listing
,
err
=
caller
([
'zypper'
,
'lr'
])
listing
,
err
=
caller
([
'zypper'
,
'lr'
]
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
while
listing
.
count
(
'
\
n
'
)
>
2
:
while
listing
.
count
(
'
\
n
'
)
>
2
:
output
,
err
=
caller
([
'zypper'
,
'rr'
,
'1'
],
stdout
=
None
)
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
):
def
addRepository
(
self
,
caller
,
url
,
alias
):
""" Add a repository """
""" 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
):
def
updateRepository
(
self
,
caller
):
""" Add a repository """
""" 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