X-Git-Url: http://git.grml.org/?p=grml2usb.git;a=blobdiff_plain;f=grml2usb;h=b4bbf3c5d36be939aea1110dbb633cd6bb8b0a33;hp=75fcd3ee838b3c01e7de9b6a361f4e98f4c48565;hb=4d800e56b2e2de9cdf1d133fd4ce6680c4918a33;hpb=c2e742a6dc8a594f71fb7cf0b3233f31f48935de diff --git a/grml2usb b/grml2usb index 75fcd3e..b4bbf3c 100755 --- a/grml2usb +++ b/grml2usb @@ -32,7 +32,22 @@ import uuid import shutil # The line following this line is patched by debian/rules and tarball.sh. -PROG_VERSION = '***UNRELEASED***' +PROG_VERSION = '***UNKNOWN***' + +# when running from inside git, try to report version information via git-describe +try: + git_dir = os.path.abspath(os.path.dirname(sys.argv[0])) + with open(os.devnull, 'w') as devnull: + PROG_VERSION = subprocess.check_output(["git", + "-C", + git_dir, + "describe", + "--always", + "--dirty"], + stderr=devnull).strip().decode('utf-8', errors='replace') + \ + " (git)" +except Exception: + pass # global variables MOUNTED = set() # register mountpoints @@ -41,7 +56,7 @@ DATESTAMP = time.mktime(datetime.datetime.now().timetuple()) # unique identifie GRML_FLAVOURS = set() # which flavours are being installed? GRML_DEFAULT = None UUID = None -SYSLINUX_LIBS = "/usr/lib/syslinux/" +SYSLINUX_LIBS = "/usr/lib/syslinux/modules/bios/" GPT_HEADER = b"\x55\xaa\x45\x46\x49\x20\x50\x41\x52\x54" # original GPT header GRUB_INSTALL = None