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
0ac3e455
Commit
0ac3e455
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
list now use new syntax spec
parent
6fda3bf8
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/is
+10
-37
10 additions, 37 deletions
bin/is
installsystems/repository.py
+9
-0
9 additions, 0 deletions
installsystems/repository.py
with
19 additions
and
37 deletions
bin/is
+
10
−
37
View file @
0ac3e455
...
@@ -197,44 +197,17 @@ def c_list(parser, args):
...
@@ -197,44 +197,17 @@ def c_list(parser, args):
List images in repository or image content
List images in repository or image content
'''
'''
# List available repositories
# List available repositories
if
len
(
args
.
values
)
==
0
:
repoman
=
load_repositories
(
args
)
repoman
=
load_repositories
(
args
)
if
len
(
args
.
object
)
==
0
:
arrow
(
"
Repositories
"
)
arrow
(
"
Repositories
"
)
repoman
.
show
(
verbose
=
args
.
detail
)
repoman
.
show
(
verbose
=
args
.
detail
)
return
# list direct image or reposity content
elif
len
(
args
.
values
)
==
1
:
# list image file content
if
(
istools
.
isfile
(
args
.
values
[
0
])
and
os
.
path
.
isfile
(
args
.
values
[
0
])):
pkg
=
PackageImage
(
args
.
values
[
0
])
arrow
(
"
Image %s v%s
"
%
(
pkg
.
name
,
pkg
.
version
))
pkg
.
show
(
verbose
=
args
.
detail
)
# list repository content
else
:
args
.
repo_filter
=
args
.
values
[
0
]
repoman
=
load_repositories
(
args
)
for
repo
in
repoman
:
arrow
(
"
Image in %s
"
%
repo
.
config
.
name
)
repo
.
show
(
args
.
detail
)
return
# list last image version
elif
len
(
args
.
values
)
==
2
:
args
.
repo_filter
=
args
.
values
[
0
]
args
.
image
=
args
.
values
[
1
]
args
.
image_version
=
None
# list specific image version
elif
len
(
args
.
values
)
==
3
:
args
.
repo_filter
=
args
.
values
[
0
]
args
.
image
=
args
.
values
[
1
]
args
.
image_version
=
args
.
values
[
2
]
else
:
else
:
args
.
subparser
.
print_usage
()
for
o
in
args
.
object
:
exit
(
1
)
if
o
in
repoman
:
# display content of image accross a repositories
repoman
[
o
].
show
(
verbose
=
args
.
detail
)
repoman
=
load_repositories
(
args
)
else
:
pkg
=
repoman
.
get
(
args
.
image
,
args
.
image_version
)
img
,
repo
=
select_image
(
o
,
repoman
)
arrow
(
"
Image %s v%s
"
%
(
pkg
.
name
,
pkg
.
version
))
img
.
show
(
verbose
=
args
.
detail
)
pkg
.
show
(
verbose
=
args
.
detail
)
def
c_move
(
parser
,
args
):
def
c_move
(
parser
,
args
):
'''
'''
...
@@ -376,8 +349,8 @@ p_install.set_defaults(func=c_install, subparser=p_install)
...
@@ -376,8 +349,8 @@ p_install.set_defaults(func=c_install, subparser=p_install)
p_list
=
subparsers
.
add_parser
(
"
list
"
,
help
=
c_list
.
__doc__
.
lower
())
p_list
=
subparsers
.
add_parser
(
"
list
"
,
help
=
c_list
.
__doc__
.
lower
())
p_list
.
add_argument
(
"
-l
"
,
action
=
"
store_true
"
,
dest
=
"
detail
"
,
p_list
.
add_argument
(
"
-l
"
,
action
=
"
store_true
"
,
dest
=
"
detail
"
,
default
=
False
,
help
=
"
detailled list output
"
)
default
=
False
,
help
=
"
detailled list output
"
)
p_list
.
add_argument
(
"
values
"
,
nargs
=
"
*
"
,
p_list
.
add_argument
(
"
object
"
,
nargs
=
"
*
"
,
help
=
"
image or repositories
to list
"
)
help
=
"
object can be an
image or repositories
"
)
p_list
.
set_defaults
(
func
=
c_list
,
subparser
=
p_list
)
p_list
.
set_defaults
(
func
=
c_list
,
subparser
=
p_list
)
# move command parser
# move command parser
...
...
This diff is collapsed.
Click to expand it.
installsystems/repository.py
+
9
−
0
View file @
0ac3e455
...
@@ -518,6 +518,15 @@ class RepositoryManager(object):
...
@@ -518,6 +518,15 @@ class RepositoryManager(object):
else
:
else
:
raise
TypeError
raise
TypeError
def
__contains__
(
self
,
key
):
'''
Check if a key is a repository name
'''
for
r
in
self
.
repos
:
if
r
.
config
.
name
==
key
:
return
True
return
False
def
register
(
self
,
config
):
def
register
(
self
,
config
):
'''
'''
Register a repository from its config
Register a repository from its config
...
...
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