Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
osc-plugins
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
mpcdf
obs
osc-plugins
Commits
e7b235f5
Commit
e7b235f5
authored
6 years ago
by
Lorenz Huedepohl
Browse files
Options
Downloads
Patches
Plain Diff
Add command to remove all software: branches of a package
parent
decedc91
No related branches found
No related tags found
No related merge requests found
Pipeline
#67032
failed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mpcdf_remove.py
+47
-0
47 additions, 0 deletions
mpcdf_remove.py
with
47 additions
and
0 deletions
mpcdf_remove.py
0 → 100644
+
47
−
0
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
'"
)
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