gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Strange gpsd version


From: Gary E. Miller
Subject: Re: Strange gpsd version
Date: Sat, 11 Sep 2021 18:57:13 -0700

Yo Hal!

On Sat, 11 Sep 2021 18:47:37 -0700
Hal Murray <halmurray@sonic.net> wrote:

> scons: Reading SConscript files ...
> scons version: 3.1.2
> scons is running under Python version: 3.8.10.final.0
> gpsd version: 3.23.1~dev-gb'sh: git: not found\n'   <=====
> This system is: netbsd9
> scons: done reading SConscript files.
> scons: Cleaning targets ...
> 
> 
> 
> $ ./gpsd-3.23.1~dev/gpsd/gpsd --version
> ./gpsd-3.23.1~dev/gpsd/gpsd: 3.23.1~dev (revision
> 3.23.1~dev-gb'fatal: not a git repository (or any parent up to mount
> point /) Stopping at filesystem boundary
> (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). ')
> $ 


Whoops, you built from source, not from git clone.

Right?  You don't even have git installed?

Scons uses git to find the minor revision.  No git, then there are
problems.

The problem will be this commit d6482930236f731aebfc57d544305c0521907c5e

From user "beta-tester" on GitLab.

Here is the change:

diff --git a/SConscript b/SConscript
index e578012f5..3ffa25396 100644
--- a/SConscript
+++ b/SConscript
@@ -484,21 +484,28 @@ env = Environment(tools=["default", "tar", "textfile"], 
opt
ions=opts, ENV=envs)
 if 'dev' in gpsd_version:
     (st, gpsd_revision) = _getstatusoutput('git describe --tags')
     if st != 0:
-        # Only if git describe failed
-        # Use timestamp from latest relevant file,
-        # ignoring generated files (../$variantdir)
-        # from root, not from $variantdir
-        files = FileList(['../*.c', '../*/*.c', '../*.cpp', '../*/*.cpp',
-                          '../include/*.h', '../*.in', '../*/*.in',
-                          '../SConstruct', '../SConscript'],
-                         '../%s' % variantdir)
-        timestamps = map(GetMtime, files)
-        if timestamps:
-            from datetime import datetime
-            latest = datetime.fromtimestamp(sorted(timestamps)[-1])
-            gpsd_revision = '%s-%s' % (gpsd_version, latest.isoformat())
+        # If git describe failed
+        # Try to use current commit hash
+        (st, gpsd_commit) = _getstatusoutput('git rev-parse HEAD | cut -b 1-9')
+        if st == 0 and gpsd_commit:
+            # Format output similar to normal revision
+            gpsd_revision = '%s-g%s' % (gpsd_version, gpsd_commit)
         else:
-            gpsd_revision = gpsd_version  # Paranoia
+            # Only if git describe and git rev-parse failed
+            # Use timestamp from latest relevant file,
+            # ignoring generated files (../$variantdir)
+            # from root, not from $variantdir
+            files = FileList(['../*.c', '../*/*.c', '../*.cpp', '../*/*.cpp',
+                              '../include/*.h', '../*.in', '../*/*.in',
+                              '../SConstruct', '../SConscript'],
+                              '../%s' % variantdir)
+            timestamps = map(GetMtime, files)
+            if timestamps:
+                from datetime import datetime
+                latest = datetime.fromtimestamp(sorted(timestamps)[-1])
+                gpsd_revision = '%s-%s' % (gpsd_version, latest.isoformat())
+            else:
+                gpsd_revision = gpsd_version  # Paranoia
 else:
     gpsd_revision = gpsd_version

Not sure the fix, but should not be hard.

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
        gem@rellim.com  Tel:+1 541 382 8588

            Veritas liberabit vos. -- Quid est veritas?
    "If you can't measure it, you can't improve it." - Lord Kelvin

Attachment: pgpL2Meo0mhSi.pgp
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]