From 1d8ac31e2fc73feeb23ffd397834ecc45ea50610 Mon Sep 17 00:00:00 2001 From: Bob Polis Date: Wed, 18 Feb 2026 13:07:18 +0100 Subject: [PATCH] Add glv.pl, adapt README.md --- README.md | 3 +++ glv.pl | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100755 glv.pl diff --git a/README.md b/README.md index efa92f4..6b805e3 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,9 @@ C++ tool to obtain latest version number(s) of GitLab. It downloads the GitLab Release notes file, and processes it using regular expressions. +As an alternative, you can also simply install the Perl script `glv.pl` +somewhere, and use that. It has the same functionality as the C++ tool. + ## Dependencies - [libscrequest](https://git.bobpolis.com/bob/libscrequest) diff --git a/glv.pl b/glv.pl new file mode 100755 index 0000000..1074dc2 --- /dev/null +++ b/glv.pl @@ -0,0 +1,13 @@ +#!/usr/bin/env perl + +my $all = $ARGV[0] =~ /^-a|--all$/ ? 1 : 0; +my @lines = `curl "https://gitlab.com/gitlab-org/gitlab-foss/-/raw/master/CHANGELOG.md" 2>/dev/null`; + +foreach (@lines) { + if (/^##\s+(\d+\.\d+\.\d+)\s+\((\d+-\d+-\d+)/) { + print "$1 [$2]\n"; + if (!$all) { + last; + } + } +}