Fetch linux-vfio version using markzz repo

pull/276/head
Jan Houben 6 years ago
parent 40e120de90
commit 19777aec8b
No known key found for this signature in database
GPG Key ID: 6866AADB974DD983
  1. 35
      lib.sh
  2. 6
      src/kernels/linux-vfio.sh

@ -444,14 +444,10 @@ check_internet() {
return 0
}
get_webpage() {
# $1: The url to scrape
cmd_regex() {
# $1: the cmd command to run
# $2: The Perl regex to match with
debug "Checking webpage: $1"
debug "Using regex: `printf "%q" "$2"`"
run_cmd_no_output "curl -sL ${1}"
run_cmd_no_output "${1}"
if [[ ${dry_run} -eq 1 ]]; then
return 0
@ -467,8 +463,29 @@ get_webpage() {
return 55
fi
webpage_output=$(echo "${run_cmd_output}" | \grep -Po -m 1 "${2}")
debug "Got \"${webpage_output}\" from webpage."
regex_match=$(echo "${run_cmd_output}" | \grep -Po -m 1 "${2}")
debug "Got \"${regex_match}\" from command."
}
get_webpage() {
# $1: The url to scrape
# $2: The Perl regex to match with
debug "Checking webpage: $1"
debug "Using regex: `printf "%q" "$2"`"
cmd_regex "curl -sL ${1}" "${2}"
webpage_output="${regex_match}"
}
get_repo_package() {
# $1: The url to scrape
# $2: The Perl regex to match with
debug "Checking repo files: $1"
debug "Using regex: `printf "%q" "$2"`"
cmd_regex "curl -sL ${1} | tar tzv --exclude='*/*'" "${2}"
}
check_webpage() {

@ -33,11 +33,11 @@ header="\
#"
get_kernel_options() {
msg "Checking linux-vfio download page for the latest linux kernel version..."
if ! get_webpage "https://aur.archlinux.org/packages/linux-vfio" "(?<=linux-vfio )[\d\w\.-]+"; then
msg "Checking linux-vfio repo for the latest linux kernel version..."
if ! get_repo_package "https://repo.markzz.com/arch/markzz/x86_64/markzz.files" "(?<=linux-vfio-)[\d\w\.-]+(?=/)"; then
exit 1
fi
kernel_version=${webpage_output}
kernel_version=${regex_match}
kernel_version_full=$(kernel_version_full ${kernel_version})
kernel_version_full_pkgver=$(kernel_version_full_no_hyphen ${kernel_version})
kernel_version_major=${kernel_version%-*}

Loading…
Cancel
Save