From f7300080d27c5e49f9220f803ca81b68eca04ccd Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Fri, 4 May 2018 14:40:13 +0200 Subject: lib/mysql-functions: small cleanup --- lib/mysql-functions | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/mysql-functions b/lib/mysql-functions index e830cf5..e6e76fb 100755 --- a/lib/mysql-functions +++ b/lib/mysql-functions @@ -331,6 +331,7 @@ mysql_generate_package_metadata() { } ) + # iterate over all pkgnames grep '^pkgname = ' "${temp_dir}/SRCINFO" | \ cut -d' ' -f3 | \ while read -r pkgname; do @@ -347,6 +348,7 @@ mysql_generate_package_metadata() { ' "${temp_dir}/SRCINFO" > \ "${temp_dir}/BINARYINFO.${pkgname64}" + # iterate over all archs grep '^arch = ' "${temp_dir}/BINARYINFO.${pkgname64}" | \ cut -d' ' -f3 | \ while read -r arch; do @@ -360,18 +362,21 @@ mysql_generate_package_metadata() { "${temp_dir}/ARCHINFO ${pkgname64} ${arch64}" done done + find "${temp_dir}" -mindepth 1 -maxdepth 1 -name 'ARCHINFO * *' -printf '%f\n' | \ while read -r _ pkgname arch; do pkgver=$( grep '^pkgver = ' "${temp_dir}/ARCHINFO ${pkgname} ${arch}" | \ cut -d' ' -f3 | \ - base64_encode_each + tr -d '\n' | \ + base64 -w0 ) pkgrel=$( grep '^pkgrel = ' "${temp_dir}/ARCHINFO ${pkgname} ${arch}" | \ cut -d' ' -f3 | \ sed 's/\.[0-9]\+$//' | \ - base64_encode_each + tr -d '\n' | \ + base64 -w0 ) epoch=$( { @@ -379,7 +384,8 @@ mysql_generate_package_metadata() { echo 'epoch = 0' } | \ cut -d' ' -f3 | \ - base64_encode_each + tr -d '\n' | \ + base64 -w0 ) provides=$( grep '^\(groups\|provides\) = ' "${temp_dir}/ARCHINFO ${pkgname} ${arch}" | \ -- cgit v1.2.3-70-g09d2