Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mpcdf
obs
osc-plugins
Commits
e7b235f5
Commit
e7b235f5
authored
Feb 08, 2019
by
Lorenz Huedepohl
Browse files
Add command to remove all software: branches of a package
parent
decedc91
Pipeline
#67032
failed with stage
in 14 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mpcdf_remove.py
0 → 100644
View file @
e7b235f5
#!/usr/bin/python2
from
__future__
import
print_function
from
functools
import
reduce
import
mpcdf_common
import
os
import
osc
import
osc.conf
import
osc.core
import
osc.cmdln
def
do_mpcdf_remove
(
self
,
subcmd
,
opts
,
*
args
):
"""${cmd_name}: Removes a package from all sub-projects of software:
Usage:
osc ${cmd_name} [PACKAGE]
${cmd_option_list}
"""
if
len
(
args
)
==
0
:
if
osc
.
core
.
is_package_dir
(
os
.
curdir
):
package
=
osc
.
core
.
store_read_package
(
os
.
curdir
)
else
:
raise
osc
.
oscerr
.
WrongArgs
(
'Specify PACKAGE or run command in an osc checkout directory'
)
elif
len
(
args
)
==
1
:
package
,
=
args
else
:
raise
osc
.
oscerr
.
WrongArgs
(
"Too many arguments"
)
api_url
=
self
.
get_api_url
()
projects
=
filter
(
lambda
s
:
s
.
startswith
(
"software:"
)
and
not
(
s
==
"software:dist"
or
s
==
"software:images"
),
osc
.
core
.
meta_get_project_list
(
api_url
))
for
project
in
projects
:
print
(
"Removing from"
,
project
)
osc
.
core
.
delete_package
(
api_url
,
project
,
package
)
print
(
"
\n
The package still exists in 'software', you can undo what you did with
\n\n
"
" osc mcpdf_push
\n\n
"
"To fully delete the package remove it also from 'software', and possibly your
\n
"
"home: project, using the web-inteface or 'osc rdelete'"
)
Write
Preview
Supports
Markdown
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