From 44be4bb654e313344a427f35a527de3e636f4a61 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Wed, 23 Jun 2021 17:25:03 -0400 Subject: Add SBoTools plugin (needs a lot more work) --- bin/sbodb.pl | 123 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100755 bin/sbodb.pl (limited to 'bin') diff --git a/bin/sbodb.pl b/bin/sbodb.pl new file mode 100755 index 0000000..bfd997e --- /dev/null +++ b/bin/sbodb.pl @@ -0,0 +1,123 @@ +#!/usr/bin/perl -w + +# create SBo.sqlite3 database for SBo limnoria plugin. +# requires SLACKBUILDS.txt and TAGS.txt from the SBo repo. +# https://slackware.uk/slackbuilds.org/14.2/SLACKBUILDS.TXT +# https://slackware.uk/slackbuilds.org/14.2/TAGS.txt + +print <) { + my ($name, $cat, $ver, $deps, $desc,); + $deps = ""; + chomp; + /^SLACKBUILD NAME:\s+(\S+)$/m and $name = $1; + /^SLACKBUILD LOCATION:\s+\.\/([^\/]*)\//m and $cat = $1; + /^SLACKBUILD VERSION:\s+(\S+)$/m and $ver = $1; + /^SLACKBUILD REQUIRES:\s+(\S.+)\n/m and $deps = $1; + /^SLACKBUILD SHORT DESCRIPTION:\s+(.+)$/m and $desc = $1; + + if($desc =~ /^$name \((.+)\)$/) { + $desc = $1; + } + + $desc =~ s/'/''/g; + $catid = get_cat_id($cat); + $buildcat{$name} = $catid; + $buildver{$name} = $ver; + $builddeps{$name} = $deps; + $builddesc{$name} = $desc; + push @builds, $name; + } +} +close $sbtxt; + +print "\n"; + +$buildid = 0; +for(@builds) { + $buildid++; + $buildids{$_} = $buildid; + print <) { + my ($build, $t, @tags); + chomp; + next if /: No tags found for/; + ($build, $t) = /^([^:]*):\s+(.*)$/; + @tags = split /,/, $t; + for(@tags) { + next if /^\s*$/; + s/'/''/g; + print <