mirror of
https://git.proxmox.com/git/debcargo-conf
synced 2025-04-28 14:41:20 +00:00

sh is rather inconvenient. I am about to introduce a bashism in vars.sh.frag and various others.
7 lines
234 B
Bash
Executable File
7 lines
234 B
Bash
Executable File
#!/bin/bash
|
|
# Given a full version string, output just the part that is significant for
|
|
# semver. i.e.. 0.x.* becomes 0.x and x.* becomes x for x != 0.
|
|
sed -r \
|
|
-e 's/([1-9]+)\.[0-9]+\.[0-9]+/\1/g' \
|
|
-e 's/(0\.[0-9]+)\.[0-9]+/\1/g'
|