Loading classes/elphel-misc-functions.bbclass 0 → 100644 +34 −0 Original line number Original line Diff line number Diff line # 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 classes/elphel-misc.bbclass +1 −32 Original line number Original line Diff line number Diff line # Well # Well # returns string - based on file inherit elphel-misc-functions 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 VFILE = "VERSION" VFILE = "VERSION" PE = "${@version_update('${VPATH}','${VFILE}',0)}" PE = "${@version_update('${VPATH}','${VFILE}',0)}" Loading recipes-devtools/php/php_5.6.%.bbappend +1 −32 Original line number Original line Diff line number Diff line Loading @@ -55,38 +55,7 @@ do_target_scp () { ssh ${REMOTE_USER}@${REMOTE_IP} ${SSH_COMMAND} ssh ${REMOTE_USER}@${REMOTE_IP} ${SSH_COMMAND} } } # returns string - based on file inherit elphel-misc-functions 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 ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" Loading recipes-kernel/linux/linux-xlnx_4.0.bbappend +4 −32 Original line number Original line Diff line number Diff line Loading @@ -158,38 +158,10 @@ kernel_do_compile() { fi fi } } # returns string - based on file inherit elphel-misc-functions def version_update(path,file,evr): import os.path VPATH = "${DEV_DIR}" if not os.path.exists(path+'/'+file): VFILE = "VERSION" 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 ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" Loading Loading
classes/elphel-misc-functions.bbclass 0 → 100644 +34 −0 Original line number Original line Diff line number Diff line # 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
classes/elphel-misc.bbclass +1 −32 Original line number Original line Diff line number Diff line # Well # Well # returns string - based on file inherit elphel-misc-functions 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 VFILE = "VERSION" VFILE = "VERSION" PE = "${@version_update('${VPATH}','${VFILE}',0)}" PE = "${@version_update('${VPATH}','${VFILE}',0)}" Loading
recipes-devtools/php/php_5.6.%.bbappend +1 −32 Original line number Original line Diff line number Diff line Loading @@ -55,38 +55,7 @@ do_target_scp () { ssh ${REMOTE_USER}@${REMOTE_IP} ${SSH_COMMAND} ssh ${REMOTE_USER}@${REMOTE_IP} ${SSH_COMMAND} } } # returns string - based on file inherit elphel-misc-functions 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 ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" Loading
recipes-kernel/linux/linux-xlnx_4.0.bbappend +4 −32 Original line number Original line Diff line number Diff line Loading @@ -158,38 +158,10 @@ kernel_do_compile() { fi fi } } # returns string - based on file inherit elphel-misc-functions def version_update(path,file,evr): import os.path VPATH = "${DEV_DIR}" if not os.path.exists(path+'/'+file): VFILE = "VERSION" 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 ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PE = "${@version_update('${VPATH}','${VFILE}',0)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" ELPHEL_PV = "${@version_update('${VPATH}','${VFILE}',1)}" Loading