8b7777d
#! /bin/bash
8b7777d
# Copyright (C) 2021 Jakub ńĆajka jcajka@redhat.com
8b7777d
#
8b7777d
# This program is free software; you can redistribute it and/or
8b7777d
# modify it under the terms of the GNU General Public License
8b7777d
# as published by the Free Software Foundation; either version 2
8b7777d
# of the License, or (at your option) any later version.
8b7777d
#
8b7777d
# This program is distributed in the hope that it will be useful,
8b7777d
# but WITHOUT ANY WARRANTY; without even the implied warranty of
8b7777d
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
8b7777d
# GNU General Public License for more details.
8b7777d
#
8b7777d
# You should have received a copy of the GNU General Public License
8b7777d
# along with this program; if not, write to the Free Software
8b7777d
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
8b7777d
8b7777d
provides=""
8b7777d
for bundle in $(find -name modules.txt); do
e2c9fbb
provides="$provides\n$(cat "$bundle" | grep "^# " | grep -v "# explicit" | sed -r s/"^#.* => "// | sed -r "s/# //" | sed -r "s:(.*) v(.*):Provides\: bundled(golang(\1)) = \2:")"
8b7777d
done
e2c9fbb
#TODO replace - with . in version per packaging guidelines
8b7777d
echo -e "$provides" | sort -u