Commit 032b2a47 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

install versions for php and kernel

parent 68f23375
# Well
# returns string - based on file
def version_update(path,file,evr):
import os.path
if not os.path.exists(path+'/'+file):
return 0
f=open(path+'/'+file)
for line in f:
line = line.strip()
if (line[0]!="#"):
break
arr = line.split('.')
try:
arr[evr]
except IndexError:
if (evr==1): res = 0
if (evr==2): res = revision_update(path,file)
else:
res = arr[evr]
f.close()
return res
def revision_update(path,file):
import subprocess
cmd = "cd "+path+"; git rev-list --count $(git log -1 --pretty=format:\"%H\" "+file+")..HEAD"
try:
res = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
res = "error_"+e.returncode
res = str(int(res))
res = res.strip(' \t\n\r')
return res
# Well
# returns string - based on file
def version_update(path,file,evr):
import os.path
if not os.path.exists(path+'/'+file):
return 0
f=open(path+'/'+file)
for line in f:
line = line.strip()
if (line[0]!="#"):
break
arr = line.split('.')
try:
arr[evr]
except IndexError:
if (evr==1): res = 0
if (evr==2): res = revision_update(path,file)
else:
res = arr[evr]
f.close()
return res
def revision_update(path,file):
import subprocess
cmd = "cd "+path+"; git rev-list --count $(git log -1 --pretty=format:\"%H\" "+file+")..HEAD"
try:
res = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
res = "error_"+e.returncode
res = str(int(res))
res = res.strip(' \t\n\r')
return res
inherit elphel-misc-functions
VFILE = "VERSION"
PE = "${@version_update('${VPATH}','${VFILE}',0)}"
......
......@@ -55,38 +55,7 @@ do_target_scp () {
ssh ${REMOTE_USER}@${REMOTE_IP} ${SSH_COMMAND}
}
# returns string - based on file
def version_update(path,file,evr):
import os.path
if not os.path.exists(path+'/'+file):
return 0
f=open(path+'/'+file)
for line in f:
line = line.strip()
if (line[0]!="#"):
break
arr = line.split('.')
try:
arr[evr]
except IndexError:
if (evr==1): res = 0
if (evr==2): res = revision_update(path,file)
else:
res = arr[evr]
f.close()
return res
def revision_update(path,file):
import subprocess
cmd = "cd "+path+"; git rev-list --count $(git log -1 --pretty=format:\"%H\" "+file+")..HEAD"
try:
res = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
res = "error_"+e.returncode
res = str(int(res))
res = res.strip(' \t\n\r')
return res
inherit elphel-misc-functions
ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}"
ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}"
......
......@@ -158,38 +158,10 @@ kernel_do_compile() {
fi
}
# returns string - based on file
def version_update(path,file,evr):
import os.path
if not os.path.exists(path+'/'+file):
return 0
f=open(path+'/'+file)
for line in f:
line = line.strip()
if (line[0]!="#"):
break
arr = line.split('.')
try:
arr[evr]
except IndexError:
if (evr==1): res = 0
if (evr==2): res = revision_update(path,file)
else:
res = arr[evr]
f.close()
return res
def revision_update(path,file):
import subprocess
cmd = "cd "+path+"; git rev-list --count $(git log -1 --pretty=format:\"%H\" "+file+")..HEAD"
try:
res = subprocess.check_output(cmd,stderr=subprocess.STDOUT,shell=True)
except subprocess.CalledProcessError as e:
res = "error_"+e.returncode
res = str(int(res))
res = res.strip(' \t\n\r')
return res
inherit elphel-misc-functions
VPATH = "${DEV_DIR}"
VFILE = "VERSION"
ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}"
ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment