mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-27 16:54:15 +01:00
Merge branch 'next' of ssh://git.openpilot.org/OpenPilot into OP-932-Modularize_Radio_Driver
This commit is contained in:
commit
7fe95b00a7
@ -160,17 +160,23 @@ class Repo:
|
|||||||
|
|
||||||
def label(self):
|
def label(self):
|
||||||
"""Return package label (tag if defined, or date-hash if no tag)"""
|
"""Return package label (tag if defined, or date-hash if no tag)"""
|
||||||
if self._tag == None:
|
try:
|
||||||
return ''.join([self.time('%Y%m%d'), "-", self.hash(8, 'untagged'), self.dirty()])
|
if self._tag == None:
|
||||||
else:
|
return ''.join([self.time('%Y%m%d'), "-", self.hash(8, 'untagged'), self.dirty()])
|
||||||
return ''.join([self.tag(''), self.dirty()])
|
else:
|
||||||
|
return ''.join([self.tag(''), self.dirty()])
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def revision(self):
|
def revision(self):
|
||||||
"""Return full revison string (tag if defined, or branch:hash date time if no tag)"""
|
"""Return full revison string (tag if defined, or branch:hash date time if no tag)"""
|
||||||
if self._tag == None:
|
try:
|
||||||
return ''.join([self.branch('no-branch'), ":", self.hash(8, 'no-hash'), self.dirty(), self.time(' %Y%m%d %H:%M')])
|
if self._tag == None:
|
||||||
else:
|
return ''.join([self.branch('no-branch'), ":", self.hash(8, 'no-hash'), self.dirty(), self.time(' %Y%m%d %H:%M')])
|
||||||
return ''.join([self.tag(''), self.dirty()])
|
else:
|
||||||
|
return ''.join([self.tag(''), self.dirty()])
|
||||||
|
except:
|
||||||
|
return None
|
||||||
|
|
||||||
def info(self):
|
def info(self):
|
||||||
"""Print some repository info"""
|
"""Print some repository info"""
|
||||||
@ -258,7 +264,6 @@ def xtrim(string, suffix, length):
|
|||||||
up to length characters. If it does not fit then the string will be
|
up to length characters. If it does not fit then the string will be
|
||||||
truncated and the '+' will be put between it and the suffix.
|
truncated and the '+' will be put between it and the suffix.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if len(string) + len(suffix) <= length:
|
if len(string) + len(suffix) <= length:
|
||||||
return ''.join([string, suffix])
|
return ''.join([string, suffix])
|
||||||
else:
|
else:
|
||||||
@ -270,6 +275,7 @@ def get_hash_of_dirs(directory, verbose = 0, raw = 0):
|
|||||||
"""Return hash of XML files from UAVObject definition directory"""
|
"""Return hash of XML files from UAVObject definition directory"""
|
||||||
import hashlib, os
|
import hashlib, os
|
||||||
SHAhash = hashlib.sha1()
|
SHAhash = hashlib.sha1()
|
||||||
|
|
||||||
if not os.path.exists(directory):
|
if not os.path.exists(directory):
|
||||||
return -1
|
return -1
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user