File: 00-gnulib-tool-version.patch

package info (click to toggle)
gnulib 20250303-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 188,836 kB
  • sloc: ansic: 378,598; sh: 30,630; python: 8,358; cpp: 2,811; yacc: 1,846; perl: 920; makefile: 577; lisp: 328; sed: 11; java: 5
file content (51 lines) | stat: -rw-r--r-- 2,191 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Subject: Debianize gnulib-tool --version; show snapshot and debian version
Forwarded: not-needed
Date: Sat, 5 Sep 2009 06:48:56 +0100
Author: Ian Beckwith <ianb@erislabs.net>
Author: Simon Josefsson <simon@josefsson.org>
Last-Update: 2024-07-02

diff --git a/gnulib-tool.sh b/gnulib-tool.sh
index 12f0b82461..cf3bb79d3b 100755
--- a/gnulib-tool.sh
+++ b/gnulib-tool.sh
@@ -363,8 +363,8 @@ q
     version=' '`cd "$gnulib_dir" && ./build-aux/git-version-gen /dev/null | sed -e 's/-dirty/-modified/'`
   else
     # gnulib copy without versioning information.
-    date=`sed -e 's/ .*//;q' "$gnulib_dir"/ChangeLog`
-    version=
+    date=`dpkg-query --show --showformat '${source:Version}' gnulib`" Debian"
+    version=" "`git bundle list-heads /usr/share/gnulib/gnulib.bundle refs/heads/master | cut -f1 -d" "`
   fi
   year=`"$gnulib_dir"/build-aux/mdate-sh "$self_abspathname" | sed -e 's,^.* ,,'`
   echo "\
diff --git a/pygnulib/GLInfo.py b/pygnulib/GLInfo.py
index eac4c65071..8b24e04424 100644
--- a/pygnulib/GLInfo.py
+++ b/pygnulib/GLInfo.py
@@ -102,10 +102,10 @@ def date(self) -> str:
                     result = result.rstrip(os.linesep)
                     return result
         # gnulib copy without versioning information.
-        with open(os.path.join(DIRS['root'], 'ChangeLog'), mode='r', newline='\n', encoding='utf-8') as file:
-            line = file.readline()
-            first_changelog_line = line.rstrip()
-        result = re.compile(r' .*').sub(r'', first_changelog_line)
+        args = ['dpkg-query', '--show', '--showformat', '${source:Version}', 'gnulib']
+        pkgv = sp.check_output(args)
+        pkgv = str(pkgv, 'UTF-8')
+        result = pkgv + " Debian"
         return result
 
     def copyright_range(self) -> str:
@@ -330,4 +330,8 @@ def version(self) -> str:
                     result = ''
                 return result
         # gnulib copy without versioning information.
-        return ''
+        args = ['git', 'bundle', 'list-heads', '/usr/share/gnulib/gnulib.bundle', 'refs/heads/master' ]
+        gitv = sp.check_output(args)
+        gitv = str(gitv, 'UTF-8')
+        result = gitv.split(' ', 1)[0]
+        return result