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
a01eb03f
Commit
a01eb03f
authored
7 years ago
by
Lorenz Huedepohl
Browse files
Options
Downloads
Patches
Plain Diff
Support to push just one package in mpcdf_push
parent
b2be213d
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
mpcdf_push.py
+22
-18
22 additions, 18 deletions
mpcdf_push.py
with
22 additions
and
18 deletions
mpcdf_push.py
+
22
−
18
View file @
a01eb03f
...
...
@@ -53,32 +53,36 @@ def do_mpcdf_push(self, subcmd, opts, *args):
print
(
"
Setting attribute
"
,
attribute
)
mpcdf_common
.
set_attribute
(
api_url
,
(
to_project
,),
attr
)
for
package
in
from_packages
:
if
package
not
in
to_packages
:
filelist
=
osc
.
core
.
meta_get_filelist
(
api_url
,
from_project
,
package
)
for
orig_
package
in
from_packages
:
if
orig_
package
not
in
to_packages
:
filelist
=
osc
.
core
.
meta_get_filelist
(
api_url
,
from_project
,
orig_
package
)
if
"
_link
"
in
filelist
:
print
(
"
Not branching package {0}, is a link
"
.
format
(
package
))
print
(
"
Not branching package {0}, is a link
"
.
format
(
orig_
package
))
else
:
print
(
"
Branching package {0}
"
.
format
(
package
))
print
(
"
Branching package {0}
"
.
format
(
orig_
package
))
exists
,
targetprj
,
targetpkg
,
srcprj
,
srcpkg
=
\
osc
.
core
.
branch_pkg
(
api_url
,
from_project
,
package
,
target_project
=
to_project
,
nodevelproject
=
True
)
osc
.
core
.
branch_pkg
(
api_url
,
from_project
,
orig_
package
,
target_project
=
to_project
,
nodevelproject
=
True
)
else
:
print
(
"
Not branching package {0}, already present in target
"
.
format
(
package
))
print
(
"
Not branching package {0}, already present in target
"
.
format
(
orig_
package
))
for
attribute
in
package_attributes
:
try
:
attr
=
mpcdf_common
.
get_attribute
(
api_url
,
from_project
,
package
,
attribute
)
attr
=
mpcdf_common
.
get_attribute
(
api_url
,
from_project
,
orig_
package
,
attribute
)
except
Exception
:
continue
mpcdf_common
.
set_attribute
(
api_url
,
(
to_project
,
package
),
attr
)
mpcdf_common
.
set_attribute
(
api_url
,
(
to_project
,
orig_
package
),
attr
)
# Check if distribution is already set in to_project
to_prj_meta
=
mpcdf_common
.
project_meta
(
api_url
,
to_project
)
sys_repo
=
to_prj_meta
.
find
(
'
./repository[@name=
"
System
"
]
'
)
if
sys_repo
is
None
:
distribution
=
mpcdf_common
.
project_meta
(
api_url
,
from_project
).
find
(
'
./repository[@name=
"
System
"
]/path[@project=
"
distributions
"
]
'
).
get
(
"
repository
"
)
else
:
distribution
=
sys_repo
.
find
(
'
./path[@project=
"
distributions
"
]
'
).
get
(
"
repository
"
)
if
package
is
None
:
# Check if distribution is already set in to_project
to_prj_meta
=
mpcdf_common
.
project_meta
(
api_url
,
to_project
)
sys_repo
=
to_prj_meta
.
find
(
'
./repository[@name=
"
System
"
]
'
)
if
sys_repo
is
None
:
distribution
=
mpcdf_common
.
project_meta
(
api_url
,
from_project
).
find
(
'
./repository[@name=
"
System
"
]/path[@project=
"
distributions
"
]
'
).
get
(
"
repository
"
)
else
:
distribution
=
sys_repo
.
find
(
'
./path[@project=
"
distributions
"
]
'
).
get
(
"
repository
"
)
print
(
"
Creating repository configuration
"
)
mpcdf_common
.
mpcdf_setup_repos
(
api_url
,
to_project
,
distribution
,
packages
=
[
package
]
if
package
else
None
)
print
(
"
Creating repository configuration
"
)
mpcdf_common
.
mpcdf_setup_repos
(
api_url
,
to_project
,
distribution
)
else
:
if
not
mpcdf_common
.
mpcdf_enable_repositories
(
api_url
,
to_project
,
package
):
print
(
"
ATTENTION: Not changing unmanaged package {0}
"
.
format
(
package
))
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