Skip to content

Commit

Permalink
Make iocReleaseCreateDb.py run from INSTALL_LOCATION and more generic.
Browse files Browse the repository at this point in the history
  • Loading branch information
bhill-slac committed Mar 14, 2023
1 parent 0b4e201 commit 628d7d3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
9 changes: 7 additions & 2 deletions configure/RULES_BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,21 @@ ifdef IOCADMIN

INSTALL_IOCRELEASE_DBS=$(IOCRELEASE_DB:%=$(INSTALL_DB)/%)

PYTHON=$(shell which python2)
ifneq ("python2","$(notdir $(PYTHON))")
PYTHON=python
endif

#--------------------------------------------------
# Rules

build : $(IOCRELEASE_DB)
buildInstall : $(INSTALL_IOCRELEASE_DBS)

# Create database for module version PVs
$(IOCRELEASE_DB) : $(TOP)/configure/RELEASE $(TOP)/RELEASE_SITE
$(IOCRELEASE_DB) : $(TOP)/configure/RELEASE
$(RM) $@
python2 $(IOCADMIN)/iocAdmin/src/iocReleaseCreateDb.py $^ >$@
$(PYTHON) $(IOCADMIN)/bin/$(EPICS_HOST_ARCH)/iocReleaseCreateDb.py $^ > $@

$(INSTALL_DB)/%: %
@echo "Installing db file $@"
Expand Down
4 changes: 4 additions & 0 deletions iocAdmin/src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ DBD += iocAdmin.dbd

#=============================

SCRIPTS_HOST += iocReleaseCreateDb.py
SCRIPTS_HOST += pkgNamesToMacroNames.py
SCRIPTS_HOST += version_utils.py

#LIBRARY = iocAdmin

#iocAdmin_LIBS = $(EPICS_BASE_IOC_LIBS)
Expand Down
8 changes: 3 additions & 5 deletions iocAdmin/src/iocReleaseCreateDb.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@ def process_options(argv):
if argv is None:
argv = sys.argv[1:]

# usage = 'Usage: %prog RELEASE_FILE [options]'
usage = 'Usage: %prog RELEASE_FILE RELEASE_SITE_FILE [options]'
usage = 'Usage: %prog RELEASE_FILE [options]'
version = '%prog 0.2'
parser = optparse.OptionParser(usage=usage, version=version)

Expand All @@ -89,19 +88,18 @@ def process_options(argv):

(options, args) = parser.parse_args(argv)

if len(args) != 2:
if len(args) != 1:
parser.error("incorrect number of arguments")

options.release_file_path = os.path.normcase(args[0])
options.release_site_file_path = os.path.normcase(args[1])

return options

def main(argv=None):
options = process_options(argv)

# get the IOC dependents
topDir = os.path.abspath( os.path.dirname(options.release_site_file_path) )
topDir = os.path.abspath( os.path.dirname( os.path.dirname(options.release_file_path) ) )
dependents = getEpicsPkgDependents( topDir )

# export the iocRelease.db file
Expand Down

0 comments on commit 628d7d3

Please sign in to comment.