From 49f1a3832fecda518fe55ed311a3c92641037477 Mon Sep 17 00:00:00 2001
From: Joel Closier <joel.closier@cern.ch>
Date: Mon, 10 Jul 2017 15:57:52 +0200
Subject: [PATCH] use os.path.join

---
 README.md                   |  2 +-
 dist-tools/create_mw_rpm.py | 13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/README.md b/README.md
index 26a737b..e89ac0b 100644
--- a/README.md
+++ b/README.md
@@ -29,7 +29,7 @@ get LCGRPM
 - tar zxvf /afs/cern.ch/lhcb/distribution/Dirac_project/lcgBundles/LCGRPM.tar.gz
 
 -export CMTPROJECTPATH=$LCGBUNDLESTEMPDIR
-- cd  LHBGRID/LHCBGRID_dev
+- cd  LHCBGRID/LHCBGRID_dev
 - make all
 - cd - LHCBDIRAC/LHCBDIRAC_dev
 - make all
diff --git a/dist-tools/create_mw_rpm.py b/dist-tools/create_mw_rpm.py
index ead581d..2676779 100755
--- a/dist-tools/create_mw_rpm.py
+++ b/dist-tools/create_mw_rpm.py
@@ -318,14 +318,15 @@ else:
 log.info( '\n### Create the RPM for LHCbGrid ' + lbdiracVer )
 
 # check The dependencies for LHCbDirac
-if os.path.exists( dirConfig + 'LHCBDIRAC/LHCBDIRAC_' + lbdiracVer + '/dist-tools/' + specialConfig ):
-  config = loadConfig( dirConfig + 'LHCBDIRAC/LHCBDIRAC_' + lbdiracVer + '/dist-tools/', specialConfig )
-  if os.path.exists( dirConfig + 'LHCBDIRAC/LHCBDIRAC_' + lbdiracVer + '/dist-tools/heptools_' + CMTCONFIG + '.json' ):
-    configDirac = loadConfig( dirConfig + 'LHCBDIRAC/LHCBDIRAC_' + lbdiracVer + '/dist-tools/', 'heptools_' + CMTCONFIG + '.json' )
+specialConfigDir = os.path.join( dirConfig, 'LHCBDIRAC', 'LHCBDIRAC_' + lbdiracVer, 'dist-tools' )
+if os.path.exists( os.path.join( specialConfigDir, specialConfig ) ):
+  config = loadConfig( specialConfigDir, specialConfig )
+  if os.path.exists( os.path.join( specialConfigDir, 'heptools_' + CMTCONFIG + '.json' ) ):
+    configDirac = loadConfig( specialConfigDir, 'heptools_' + CMTCONFIG + '.json' )
   else:
-    configDirac = loadConfig( dirConfig + 'LHCBDIRAC/LHCBDIRAC_' + lbdiracVer + '/dist-tools/', 'heptools.json' )
+    configDirac = loadConfig( specialConfigDir, 'heptools.json' )
 else:
-  log.info( "Path does not exist :" + dirConfig + 'LHCBDIRAC/LHCBDIRAC_' + lbdiracVer + '/dist-tools/' + specialConfig )
+  log.info( "Path does not exist :" + os.path.join( specialConfigDir , specialConfig ) )
   sys.exit( 0 )
 
 # find the version of LHCbGrid used by LHCbDirac
-- 
GitLab