#!/usr/bin/perl -w
# SPDX-License-Identifier: AGPL-3.0-or-later
# 2011-2015 by Bernhard M. Wiedemann
use strict;
use CGI;
my @distris=("openSUSE Tumbleweed", "openSUSE Factory", "openSUSE Leap 15.6", "openSUSE Leap 15.5", "openSUSE Leap 15.4", "openSUSE Leap 15.3", "SLE 12", "SLE 15", "SLE 15 SP3");
#my @distris=("openSUSE Tumbleweed", "openSUSE Factory", "openSUSE Leap 15.5", "openSUSE Leap 15.4", "openSUSE Leap 15.3", "openSUSE Leap 15.2", "openSUSE Leap 15.1", "openSUSE Leap 15.0", "openSUSE Leap 42.3", "openSUSE Leap 42.2", "openSUSE Leap 42.1", "openSUSE 13.2", "openSUSE 13.1", "openSUSE 12.3", "openSUSE 12.2", "openSUSE 12.1", "openSUSE 11.4", "openSUSE 11.3", "openSUSE 11.2", "openSUSE 11.1", "SLE 11 SP4", "SLE 12", "SLE 15", "SLE 15 SP3");
our $factoryregexp="openSUSE_Factory";
sub guessurl($$)
{ my($baserepo, $v)=@_;
if($baserepo=~m/distribution/) {
$v=~s{openSUSE_([0-9.]+)}{$1/repo/oss};
if($v=~s{$factoryregexp}{}) {
$baserepo=~s{distribution/}{tumbleweed/repo/oss};
}
}
return "$baserepo$v/";
}
sub groupblock($$$)
{
my ($pkgname, $url, $distver)=@_;
my $dv=qq( distversion="$distver");
$url =~ s/openSUSE_Leap_15.[3-9]/\$releasever/;
$url =~ s/15\.[0-9]/\$releasever/;
$dv="" if $distver =~ m/openSUSE Factory|Tumbleweed/; # make Factory the default because versions are updated many times a week
my $repo=qq(