From f9c44ecc8e92f7eeffc1aa6737e9ef515e4672e0 Mon Sep 17 00:00:00 2001 From: r00t Date: Tue, 11 Apr 2017 22:21:11 -0400 Subject: [PATCH] because sometimes people don't read/grok docs --- bdisk/host.py | 17 +++++++++++------ docs/manual/user/BUILDINI.adoc | 5 +++-- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/bdisk/host.py b/bdisk/host.py index f282c16..d74f138 100755 --- a/bdisk/host.py +++ b/bdisk/host.py @@ -93,12 +93,17 @@ def parseConfig(confs): # commits on top of a new tagged release). e.g. for build Y: # v#.##-Y or v#.##rX-Y if config_dict['bdisk']['ver'] == '': - repo = git.Repo(config_dict['build']['basedir']) - refs = repo.git.describe(repo.head.commit).split('-') - if len(refs) >= 2: - config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[1] - else: - config_dict['bdisk']['ver'] = refs[0] + try: + repo = git.Repo(config_dict['build']['basedir']) + refs = repo.git.describe(repo.head.commit).split('-') + if len(refs) >= 2: + config_dict['bdisk']['ver'] = refs[0] + 'r' + refs[1] + else: + config_dict['bdisk']['ver'] = refs[0] + except: + exit(('{0}: ERROR: {1} is NOT a valid git repository, and you did not specify bdisk:ver in your build.ini! ' + + 'Did you perhaps install from a package manager? Please refer to the documentation.').format(datetime.datetime.now(), + config_dict['build']['basedir'])) # And the build number. # TODO: support tracking builds per version. i.e. in buildnum: # v2.51r13:0 diff --git a/docs/manual/user/BUILDINI.adoc b/docs/manual/user/BUILDINI.adoc index a79f023..b9117b3 100644 --- a/docs/manual/user/BUILDINI.adoc +++ b/docs/manual/user/BUILDINI.adoc @@ -16,6 +16,7 @@ If you want to use your own `build.ini` file (and you should!), the following pa * `/opt/dev/bdisk/build.ini` * `/opt/dev/bdisk/extra/build.ini` * `/opt/dev/bdisk/extra/dist.build.ini` +* `/../build.ini` We'll go into more detail for each section below. @@ -64,7 +65,7 @@ We'll go into more detail for each section below. prepdir = ${dlpath}/temp archboot = ${prepdir}/${bdisk:name} mountpt = /mnt/${bdisk:uxname} - multiarch = yes + multiarch = x86_64 sign = yes ipxe = no i_am_a_racecar = no @@ -126,7 +127,7 @@ This string is used for "pretty-printing" of the project name; it should be a mo . ASCII only ==== `ver` -The version string. If this isn't specified, we'll try to guess based on the current git commit and tags in `<>`. +The version string. If this isn't specified, we'll try to guess based on the current git commit and tags in `<>`. If `<>` is *not* a git repository (i.e. you installed BDisk from a package manager), you MUST specify a version number. . No whitespace