mirror of https://git.code.sf.net/p/isync/isync
Compare commits
16 Commits
e70c300f74
...
76e5f223ee
Author | SHA1 | Date |
---|---|---|
Oswald Buddenhagen | 76e5f223ee | 3 months ago |
Oswald Buddenhagen | d54c22d20e | 3 months ago |
Oswald Buddenhagen | 4c2031d616 | 3 months ago |
Oswald Buddenhagen | 4279aea6a0 | 3 months ago |
Oswald Buddenhagen | 6fbbcbb2c7 | 3 months ago |
Oswald Buddenhagen | 8421b3cb22 | 3 months ago |
Oswald Buddenhagen | f467b57a95 | 3 months ago |
Oswald Buddenhagen | 7bca6967a7 | 3 months ago |
Husain Alshehhi | 5f81162f5e | 3 months ago |
Oswald Buddenhagen | ee832951e2 | 3 months ago |
Oswald Buddenhagen | 31c504d432 | 3 months ago |
Oswald Buddenhagen | 43271d8fad | 3 months ago |
Oswald Buddenhagen | 8b8313997c | 3 months ago |
Oswald Buddenhagen | 84194a7a9f | 3 months ago |
Oswald Buddenhagen | ceb0fa9803 | 3 months ago |
Oswald Buddenhagen | 12e30ce560 | 3 months ago |
24 changed files with 314 additions and 370 deletions
@ -1,70 +0,0 @@ |
|||||||
#!/usr/bin/perl |
|
||||||
# |
|
||||||
# SPDX-FileCopyrightText: 2022 Oswald Buddenhagen <ossi@users.sf.net> |
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later |
|
||||||
# |
|
||||||
# mbsync - mailbox synchronizer |
|
||||||
# |
|
||||||
|
|
||||||
use strict; |
|
||||||
use warnings; |
|
||||||
|
|
||||||
my $in_enum = 0; |
|
||||||
my $conts; |
|
||||||
while (<>) { |
|
||||||
s,\s*(?://.*)?$,,; |
|
||||||
if ($in_enum) { |
|
||||||
if (/^\)$/) { |
|
||||||
$conts =~ s/\s//g; |
|
||||||
$conts =~ s/,$//; |
|
||||||
my @vals = split(/,/, $conts); |
|
||||||
my ($pfx, $pfx1); |
|
||||||
for my $e (@vals) { |
|
||||||
if (!defined($pfx)) { |
|
||||||
$pfx1 = $pfx = ($e =~ /^([A-Z]+_)/) ? $1 : ""; |
|
||||||
} elsif (length($pfx)) { |
|
||||||
$pfx = "" if ((($e =~ /^([A-Z]+_)/) ? $1 : "") ne $pfx); |
|
||||||
} |
|
||||||
} |
|
||||||
my $bit = 1; |
|
||||||
my $bitn = 0; |
|
||||||
my (@names, @nameos); |
|
||||||
my $nameo = 0; |
|
||||||
for my $e (@vals) { |
|
||||||
my $bits = ($e =~ s/\((\d+)\)$//) ? $1 : 1; |
|
||||||
my $n = substr($e, length($pfx)); |
|
||||||
if ($bits != 1) { |
|
||||||
die("Unsupported field size $bits\n") if ($bits != 2); |
|
||||||
print "#define $e(b) ($bit << (b))\n"; |
|
||||||
push @names, "F-".$n, "N-".$n; |
|
||||||
my $nl = length($n) + 3; |
|
||||||
push @nameos, $nameo, $nameo + $nl; |
|
||||||
$nameo += $nl * 2; |
|
||||||
} else { |
|
||||||
print "#define $e $bit\n"; |
|
||||||
push @names, $n; |
|
||||||
push @nameos, $nameo; |
|
||||||
$nameo += length($n) + 1; |
|
||||||
} |
|
||||||
$bit <<= $bits; |
|
||||||
$bitn += $bits; |
|
||||||
} |
|
||||||
if (length($pfx)) { |
|
||||||
print "#define ${pfx}_NUM_BITS $bitn\n"; |
|
||||||
} |
|
||||||
if (length($pfx1)) { |
|
||||||
print "#define ${pfx1}_STRINGS \"".join("\\0", @names)."\"\n"; |
|
||||||
print "#define ${pfx1}_OFFSETS ".join(", ", @nameos)."\n"; |
|
||||||
} |
|
||||||
print "\n"; |
|
||||||
$in_enum = 0; |
|
||||||
} else { |
|
||||||
$conts .= $_; |
|
||||||
} |
|
||||||
} else { |
|
||||||
if (/^BIT_ENUM\($/) { |
|
||||||
$conts = ""; |
|
||||||
$in_enum = 1; |
|
||||||
} |
|
||||||
} |
|
||||||
} |
|
@ -0,0 +1,36 @@ |
|||||||
|
#!/bin/sh |
||||||
|
# SPDX-FileCopyrightText: (C) 2024 Oswald Buddenhagen <ossi@users.sf.net> |
||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later |
||||||
|
|
||||||
|
cd $(dirname $0) |
||||||
|
|
||||||
|
test -e .git || exit |
||||||
|
|
||||||
|
mb=$(git merge-base HEAD "@{upstream}" 2> /dev/null) |
||||||
|
if test -z "$mb"; then |
||||||
|
# we presume that a failure to find a merge base means no upstream. |
||||||
|
# and no upstream may mean detached head in the middle of a rebase |
||||||
|
br=$(git branch | sed -n -e 's/^\* (no branch, rebasing \([^\)]*\))$/\1/p') |
||||||
|
if test -n "$br"; then |
||||||
|
mb=$(git merge-base HEAD "$br@{upstream}" 2> /dev/null) |
||||||
|
fi |
||||||
|
fi |
||||||
|
if test -z "$mb"; then |
||||||
|
# still no upstream, so just describe HEAD as-is. |
||||||
|
gver=$(git describe --tags HEAD) |
||||||
|
else |
||||||
|
# find out whether we have local work, and if so, collapse it into |
||||||
|
# a single suffix. otherwise, we'd cause pointless rebuilds during |
||||||
|
# development. |
||||||
|
gver=$(git describe --tags $mb) |
||||||
|
lcl=$(git rev-list -n 1 $mb..HEAD) |
||||||
|
if test -n "$lcl"; then |
||||||
|
gver="$gver-plus" |
||||||
|
fi |
||||||
|
fi |
||||||
|
gver=${gver#v} |
||||||
|
pgver=$(cat VERSION 2> /dev/null) |
||||||
|
if [ "x$gver" != "x$pgver" ]; then |
||||||
|
echo "$gver" > VERSION |
||||||
|
fi |
||||||
|
|
Loading…
Reference in new issue