File: 10_libwraster6.diff

package info (click to toggle)
wmaker 0.96.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 17,416 kB
  • sloc: ansic: 99,483; sh: 7,068; perl: 3,423; makefile: 1,647; lisp: 219; python: 34
file content (42 lines) | stat: -rw-r--r-- 1,568 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
Description: Fix calculation of version number in the library mapfiles
Author: Christophe CURIS <christophe.curis@free.fr>
Origin: https://repo.or.cz/wmaker-crm.git/commitdiff/2264ed9
Bug-Debian: https://bugs.debian.org/1043417
Last-Update: 2024-11-08
Forwarded: not-needed

--- a/script/generate-mapfile-from-header.sh
+++ b/script/generate-mapfile-from-header.sh
@@ -77,10 +77,8 @@
 
         -v)
             shift
-            # Version may be 'x:y:z', we keep only 'x'
-            version="`echo "$1" | sed -e 's,:.*$,,' `"
-            # the version should only be a number
-            echo "$version" | grep '^[1-9][0-9]*$' > /dev/null || \
+            version="$1"
+            echo "$version" | grep -E '^[1-9][0-9]*(:[0-9]+(:[0-9]+)?)?$' > /dev/null || \
                 arg_error "version \"$1\" is not valid"
           ;;
 
@@ -109,9 +107,18 @@
 # generate the rest of the script so that other symbols will not be kept.
 awk '
 BEGIN {
+  # Version number here uses only 1 number from the full version used in libtool
+  libversion="'"$version"'";
+  if (split(libversion, subversions, ":") > 1) {
+    # Calculate [CURRENT - AGE], the goal is that the number will not
+    # change when functions are added to the API, but it will be incremented
+    # when functions are removed or argument change (which breaks compat)
+    libversion = subversions[1] - subversions[3];
+  }
+
   print "/* Generated version-script for ld */";
   print "";
-  print "'"$libname$version"'";
+  print "'"$libname"'" libversion;
   print "{";
   print "  global:";
 }