add fallback url to hp-plugin-download
This commit is contained in:
parent
d726b77698
commit
187b064062
28
hp-plugin.in
28
hp-plugin.in
@ -9,12 +9,20 @@ then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# link to the plugin
|
|
||||||
PLUGIN_SOURCE="https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/hplip-${VER}-plugin.run"
|
|
||||||
|
|
||||||
# plugin name
|
# plugin name
|
||||||
PLUGIN_FILE="hplip-${VER}-plugin.run"
|
PLUGIN_FILE="hplip-${VER}-plugin.run"
|
||||||
|
|
||||||
|
download()
|
||||||
|
{
|
||||||
|
SOURCE="$1"
|
||||||
|
|
||||||
|
@bindir@/curl --create-dir -O --output-dir ~/.hplip ${SOURCE}
|
||||||
|
}
|
||||||
|
|
||||||
|
# link to the plugin
|
||||||
|
PLUGIN_SOURCE="https://www.openprinting.org/download/printdriver/auxfiles/HP/plugins/${PLUGIN_FILE}"
|
||||||
|
FALLBACK_SOURCE="https://developers.hp.com/sites/default/files/${PLUGIN_FILE}"
|
||||||
|
|
||||||
# create a hidden hplip dir to store a file indicating the plugin version after successful install
|
# create a hidden hplip dir to store a file indicating the plugin version after successful install
|
||||||
# the directory can be used by other hplip tools, so we don't have to remove it if the failure happens
|
# the directory can be used by other hplip tools, so we don't have to remove it if the failure happens
|
||||||
if [ ! -d ~/.hplip ]
|
if [ ! -d ~/.hplip ]
|
||||||
@ -22,11 +30,19 @@ then
|
|||||||
@bindir@/mkdir ~/.hplip || (@bindir@/echo "Cannot create the ~/.hplip dir, exiting" && exit 1)
|
@bindir@/mkdir ~/.hplip || (@bindir@/echo "Cannot create the ~/.hplip dir, exiting" && exit 1)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@bindir@/curl --create-dir -O --output-dir ~/.hplip ${PLUGIN_SOURCE}
|
for link in ${PLUGIN_SOURCE} ${FALLBACK_SOURCE}
|
||||||
|
do
|
||||||
|
download ${link}
|
||||||
|
|
||||||
if [ ! -f ~/.hplip/${PLUGIN_FILE} ]
|
if test "x$(file --mime ~/.hplip/${PLUGIN_FILE} | grep 'text/x-shellscript')" = "xtext/x-shellscript"
|
||||||
|
then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
if test "x$(file --mime ~/.hplip/${PLUGIN_FILE} | grep 'text/x-shellscript')" = "x"
|
||||||
then
|
then
|
||||||
@bindir@/echo "The downloaded file does not exist - error during downloading, exiting..."
|
@bindir@/echo "The downloaded file does not exist or is not a shell script - error during downloading, exiting..."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
Summary: HP Linux Imaging and Printing Project
|
Summary: HP Linux Imaging and Printing Project
|
||||||
Name: hplip
|
Name: hplip
|
||||||
Version: 3.23.12
|
Version: 3.23.12
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
# most files (base/*, *, ui*/...) - GPL2+
|
# most files (base/*, *, ui*/...) - GPL2+
|
||||||
# prnt/hpijs/ jpeg related files - IJG
|
# prnt/hpijs/ jpeg related files - IJG
|
||||||
# prnt/* - BSD-3-Clause-HP - it is modified a little, asked here https://gitlab.com/fedora/legal/fedora-license-data/-/issues/267
|
# prnt/* - BSD-3-Clause-HP - it is modified a little, asked here https://gitlab.com/fedora/legal/fedora-license-data/-/issues/267
|
||||||
@ -966,6 +966,9 @@ find doc/images -type f -exec chmod 644 {} \;
|
|||||||
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
|
%config(noreplace) %{_sysconfdir}/sane.d/dll.d/hpaio
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Jan 19 2024 Zdenek Dohnal <zdohnal@redhat.com> - 3.23.12-2
|
||||||
|
- add fallback url to hp-plugin-download
|
||||||
|
|
||||||
* Mon Jan 08 2024 Zdenek Dohnal <zdohnal@redhat.com> - 3.23.12-1
|
* Mon Jan 08 2024 Zdenek Dohnal <zdohnal@redhat.com> - 3.23.12-1
|
||||||
- 2252302 - hplip-3.23.12 is available
|
- 2252302 - hplip-3.23.12 is available
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user