Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
LbScripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LHCb Core Software
LbScripts
Merge requests
!158
SoftConfDB import that loads project dependencies from projectConfig.json as well as CMakeLists
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
SoftConfDB import that loads project dependencies from projectConfig.json as well as CMakeLists
LBCORE-1334
into
master
Overview
0
Commits
1
Changes
1
Merged
Ben Couturier
requested to merge
LBCORE-1334
into
master
8 years ago
Overview
0
Commits
1
Changes
1
Expand
Fixes
LBCORE-1334
0
0
Merge request reports
Compare
master
master (base)
and
latest version
latest version
440017d7
1 commit,
8 years ago
1 file
+
36
−
6
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
LbRelease/python/LbRelease/SoftConfDB/AppImporter.py
+
36
−
6
Options
@@ -9,6 +9,7 @@ import re
import
sys
import
urllib2
import
LbUtils
import
json
from
LbConfiguration.Repository
import
getRepositories
from
LbRelease
import
rcs
@@ -94,24 +95,53 @@ class GitlabProject:
data
=
response
.
read
()
self
.
log
.
debug
(
"
Got: %s
"
%
self
.
cmakelistsurl
)
except
:
self
.
log
.
error
(
"
Could not find CMakeLists at: %s. Are you sure the version is valid ?
"
%
self
.
cmakelistsurl
)
self
.
log
.
warning
(
"
Could not find CMakeLists at: %s
"
%
self
.
cmakelistsurl
)
raise
return
data
def
getProjectConfig
(
self
):
"""
URL folows pattern:
https://gitlab.cern.ch/lhcb-dirac/LHCbDIRAC/raw/v8r6p3/dist-tools/projectConfig.json
"""
self
.
projconfigurl
=
self
.
getURL
(
"
dist-tools/projectConfig.json
"
)
self
.
log
.
debug
(
"
Getting: %s
"
%
self
.
projconfigurl
)
try
:
response
=
urllib2
.
urlopen
(
self
.
projconfigurl
)
data
=
response
.
read
()
self
.
log
.
debug
(
"
Got: %s
"
%
self
.
projconfigurl
)
except
:
self
.
log
.
warning
(
"
Could not find projectConfig.json at: %s
"
%
self
.
projconfigurl
)
raise
return
data
def
getDepsFromProjectConfig
(
self
,
data
):
pc
=
json
.
loads
(
data
)
used_projects
=
pc
[
"
used_projects
"
]
deps
=
[]
for
l
in
used_projects
[
"
project
"
]:
deps
.
append
((
l
[
0
],
l
[
1
]))
return
deps
def
getDependencies
(
self
):
"""
Returns the list of project dependencies
"""
if
self
.
project
.
upper
()
==
"
GAUDI
"
or
self
.
project
.
upper
()
==
"
GEANT4
"
:
pupper
=
self
.
project
.
upper
()
print
pupper
if
pupper
in
[
"
GAUDI
"
,
"
GEANT4
"
]:
# For GAUDI we take the dependency in the toolchain file
data
=
self
.
getToolchain
()
htv
=
getHeptoolsVersion
(
data
)
deplist
=
[
(
"
LCG
"
,
htv
)
]
return
deplist
if
pupper
in
[
"
DIRAC
"
,
"
LHCBGRID
"
]:
return
[]
else
:
# For all other projects use the gaudi_project macro
data
=
self
.
getCMakeLists
()
deplist
=
getGaudiUse
(
data
)
try
:
data
=
self
.
getCMakeLists
()
deplist
=
getGaudiUse
(
data
)
except
:
data
=
self
.
getProjectConfig
()
deplist
=
self
.
getDepsFromProjectConfig
(
data
)
return
deplist
return
[]
@@ -262,7 +292,7 @@ class AppImporter:
rev
=
getPathLastRev
(
tagpath
)
# Check that we actually found it in SVN
# protect all but LCG/LCGMCT
if
rev
==
None
and
proj
.
upper
()
not
in
[
"
LCG
"
,
"
LCGCMT
"
]:
if
rev
==
None
and
proj
.
upper
()
not
in
[
"
LCG
"
,
"
LCGCMT
"
,
"
DIRAC
"
,
"
LHCBGRID
"
]:
raise
Exception
(
"
Project %s %s not found in SVN. Aborting
"
%
(
proj
,
ver
))
createNode
=
False
Loading