File tarup_yast2_schemas.sh of Package yast2-schemas
#!/bin/bash
repos="tw leap15.3 leap15.2 leap15.1 sle-15-sp3 sle-15-sp2 sle-12-sp5 sle-12-sp4 sles-11-sp4"
declare -A locs
locs=(
"tw" "/mounts/dist/openSUSE/openSUSE-Tumbleweed/*/DVD1/*/yast2-schema*.rpm"
"leap15.3" "/mounts/dist/openSUSE/openSUSE-Leap-15.3/*/DVD1/*/yast2-schema*.rpm"
"leap15.2" "/mounts/dist/openSUSE/openSUSE-Leap-15.2/*/yast2-schema*.rpm"
"leap15.1" "/mounts/dist/openSUSE/openSUSE-Leap-15.1/*/yast2-schema*.rpm"
"sle-15-sp3" "/mounts/dist/updates/ibs/SUSE:/SLE-15-SP3:/GA/standard/*/yast2-schema*.rpm"
"sle-15-sp2" "/mounts/dist/updates/ibs/SUSE:/SLE-15-SP2:/Update/standard/*/yast2-schema*.rpm"
"sle-12-sp5" "/mounts/dist/updates/ibs/SUSE:/SLE-12-SP5:/Update/standard/*/yast2-schema*.rpm"
"sle-12-sp4" "/mounts/dist/updates/ibs/SUSE:/SLE-12-SP4:/Update/standard/*/yast2-schema*.rpm"
"sles-11-sp4" "/mounts/dist/updates/ibs/SUSE:/SLE-11-SP4:/Update/standard/*/yast2-schema*.rpm"
)
archs="x86_64 aarch64 ppc64le ppc64 s390x"
prefix="/usr/share/yast2-schemas"
dir=$(mktemp -d)
t_dir=$(mktemp -d)
mkdir "$dir"/yast2-schemas
set -x
pushd "$dir"/yast2-schemas
for repo in $repos;do
for arch in $archs;do
for file in $(ls -1 ${locs["$repo"]}|grep "$arch.rpm$"); do
if [ -r $file ];then
echo $file
rpm2cpio "$file" |cpio -i -d -D "$t_dir"
mkdir -p "$dir/yast2-schemas/$repo/$arch"
if [ ! -d "$t_dir"/usr/share/YaST2/schema/autoyast/rng ];then
echo "Could not find rng files [${t_dir}/usr/share/YaST2/schema/autoyast/rng] extracted from rpm [$file]"
exit 1
fi
mv "$t_dir"/usr/share/YaST2/schema/autoyast/rng/* "$dir/yast2-schemas/$repo/$arch"
fi
done
done
done
popd
rm -rf "$t_dir"
echo $dir
tar -cJf yast2-schemas.tar.xz -C "$dir" yast2-schemas