summaryrefslogtreecommitdiffstats
path: root/update_bootloader_files.sh
diff options
context:
space:
mode:
authorMartin Whitaker <mageia@martin.whitaker.me.uk>2023-01-28 13:25:22 +0000
committerMartin Whitaker <mageia@martin.whitaker.me.uk>2023-01-28 13:25:42 +0000
commit88d91fec021db34ad024f954c90b94368f0ca8c8 (patch)
tree4ae8578ac7d8837daf85409ab8d1b087366ecdfa /update_bootloader_files.sh
parent8dbdefeb7d38a079401aa6463eb5038b376682b9 (diff)
downloaddrakclassic-config-88d91fec021db34ad024f954c90b94368f0ca8c8.tar
drakclassic-config-88d91fec021db34ad024f954c90b94368f0ca8c8.tar.gz
drakclassic-config-88d91fec021db34ad024f954c90b94368f0ca8c8.tar.bz2
drakclassic-config-88d91fec021db34ad024f954c90b94368f0ca8c8.tar.xz
drakclassic-config-88d91fec021db34ad024f954c90b94368f0ca8c8.zip
Add support for remote repositories in update_bootloader_files.sh.
Diffstat (limited to 'update_bootloader_files.sh')
-rwxr-xr-xupdate_bootloader_files.sh31
1 files changed, 29 insertions, 2 deletions
diff --git a/update_bootloader_files.sh b/update_bootloader_files.sh
index 7655012..6ab4e2b 100755
--- a/update_bootloader_files.sh
+++ b/update_bootloader_files.sh
@@ -2,23 +2,50 @@
repository=$(grep repository config/settings.cfg | sed s/repository=//)
echo "Fetching bootloader files from $repository"
+remote=0
+case $repository in
+ ftp:* | http:* | https:* ) remote=1;;
+esac
+
# Remove old files
rm -rf bootloader
mkdir bootloader
archs="i586 x86_64"
for arch in $archs; do
- path=`ls -1v $repository/$arch/media/core/{release,updates}/drakiso-bootloader-files*.rpm 2> /dev/null | tail -1`
- if [ -z $path ] ; then
+ echo "Searching $arch/media/core/updates"
+ rpm_list=$(urpmq --use-distrib $repository/$arch --media "Core Updates" --exclude-media "Debug,Testing" --curl-options "-s" --wget-options "-q" -r drakiso-bootloader-files)
+ rpm_name=${rpm_list##*|}
+ media=core/updates
+ if [ -z $rpm_name ] ; then
+ echo "Searching $arch/media/core/release"
+ rpm_list=$(urpmq --use-distrib $repository/$arch --media "Core Release" --exclude-media "Debug,Testing" --curl-options "-s" --wget-options "-q" -r drakiso-bootloader-files)
+ rpm_name=${rpm_list##*|}
+ media=core/release
+ fi
+ if [ -z $rpm_name ] ; then
echo "ERROR: couldn't find $arch drakiso-bootloader-files RPM in $repository."
exit 1
else
echo "Extracting $arch bootloader files from repository."
+ if [ $remote -eq 1 ] ; then
+ wget -q $repository/$arch/media/$media/$rpm_name.$arch.rpm
+ if [ $? -ne 0 ] ; then
+ echo "ERROR: failed to download RPM from archive."
+ exit 1
+ fi
+ path=$rpm_name.$arch.rpm
+ else
+ path=$repository/$arch/media/$media/$rpm_name.$arch.rpm
+ fi
rpm2cpio $path | cpio -idm --quiet
if [ $? -ne 0 ] ; then
echo "ERROR: failed to extract files from archive."
exit 1
fi
+ if [ $remote -eq 1 ] ; then
+ rm $path
+ fi
fi
cp -ru usr/share/drakiso/bootloader/* bootloader
rm -r usr