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
8aa60db9
Commit
8aa60db9
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
init image and init repo splited in new and init command
parent
3544d537
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/is
+26
-26
26 additions, 26 deletions
bin/is
with
26 additions
and
26 deletions
bin/is
+
26
−
26
View file @
8aa60db9
...
...
@@ -42,7 +42,7 @@ def load_repositories(args):
repoman
.
register
(
repoconf
)
return
repoman
def
c_
init_image
(
parser
,
args
):
def
c_
new
(
parser
,
args
):
'''
Create a new source image
'''
...
...
@@ -51,21 +51,6 @@ def c_init_image(parser, args):
except
Exception
as
e
:
error
(
"
init image failed: %s.
"
%
e
)
def
c_init_repo
(
parser
,
args
):
'''
Create a empty repository
'''
try
:
repoman
=
load_repositories
(
args
)
if
len
(
repoman
)
==
0
:
raise
Exception
(
"
No repository selected
"
)
elif
len
(
repoman
)
>
1
:
raise
Exception
(
"
Please select only one repository
"
)
Repository
.
create
(
repoman
[
0
])
debug
(
"
Repository: %s
"
%
repoman
[
0
])
except
Exception
as
e
:
raise
Exception
(
"
init repo failed: %s
"
%
e
)
def
c_build
(
parser
,
args
):
'''
Build an image source
...
...
@@ -84,6 +69,21 @@ def c_build(parser, args):
except
Exception
as
e
:
error
(
"
build failed: %s.
"
%
e
)
def
c_init
(
parser
,
args
):
'''
Create a empty repository
'''
try
:
repoman
=
load_repositories
(
args
)
if
len
(
repoman
)
==
0
:
raise
Exception
(
"
No repository selected
"
)
elif
len
(
repoman
)
>
1
:
raise
Exception
(
"
Please select only one repository
"
)
Repository
.
create
(
repoman
[
0
])
debug
(
"
Repository: %s
"
%
repoman
[
0
])
except
Exception
as
e
:
raise
Exception
(
"
init repo failed: %s
"
%
e
)
def
c_add
(
parser
,
args
):
'''
Add an image package into a repository
...
...
@@ -194,16 +194,10 @@ p_main.add_argument("-t", "--timeout", dest="timeout", type=int, default=3,
# create a subparsers for each command
subparsers
=
p_main
.
add_subparsers
()
# init command parser
p_init
=
subparsers
.
add_parser
(
"
init
"
,
help
=
"
initialize source image or repository
"
)
sp_init
=
p_init
.
add_subparsers
()
p_init_repo
=
sp_init
.
add_parser
(
"
repo
"
,
help
=
c_init_repo
.
__doc__
.
lower
())
p_init_repo
.
add_argument
(
"
repo_filter
"
,
nargs
=
"
?
"
,
default
=
argparse
.
SUPPRESS
,
help
=
"
Name or path of a repository to init
"
)
p_init_repo
.
set_defaults
(
func
=
c_init_repo
)
p_init_image
=
sp_init
.
add_parser
(
"
image
"
,
help
=
c_init_image
.
__doc__
.
lower
())
p_init_image
.
add_argument
(
"
path
"
,
help
=
"
Path of new image directory
"
)
p_init_image
.
set_defaults
(
func
=
c_init_image
)
# new command parser
p_new
=
subparsers
.
add_parser
(
"
new
"
,
help
=
c_new
.
__doc__
.
lower
())
p_new
.
add_argument
(
"
path
"
,
help
=
"
Path of new image directory
"
)
p_new
.
set_defaults
(
func
=
c_new
)
# build command parser
p_build
=
subparsers
.
add_parser
(
"
build
"
,
help
=
c_build
.
__doc__
.
lower
())
...
...
@@ -214,6 +208,12 @@ p_build.add_argument('-c', "--no-check", action="store_true", default=False,
p_build
.
add_argument
(
"
path
"
,
nargs
=
"
?
"
,
default
=
"
.
"
)
p_build
.
set_defaults
(
func
=
c_build
)
# init command parser
p_init
=
subparsers
.
add_parser
(
"
init
"
,
help
=
c_init
.
__doc__
.
lower
())
p_init
.
add_argument
(
"
repo_filter
"
,
nargs
=
"
?
"
,
default
=
argparse
.
SUPPRESS
,
help
=
"
Name or path of a repository to init
"
)
p_init
.
set_defaults
(
func
=
c_init
)
# add command parser
p_add
=
subparsers
.
add_parser
(
"
add
"
,
help
=
c_add
.
__doc__
.
lower
())
p_add
.
add_argument
(
'
-p
'
,
"
--preserve
"
,
action
=
"
store_true
"
,
default
=
False
,
...
...
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