ubuntu-mainline-kernel.sh icon indicating copy to clipboard operation
ubuntu-mainline-kernel.sh copied to clipboard

More intuitive version matching

Open Roy-Orbison opened this issue 4 years ago • 1 comments

Avoids many issues with regex and glob patterns in version arguments matching incorrectly. Prevents invalid versions being requested from remote source. Always provides opportunity to confirm version being installed.

Fixes #58.

Roy-Orbison avatar Feb 10 '21 04:02 Roy-Orbison

For testing, I have been using these extra lines to avoid thrashing & waiting for the remote:

diff --git a/ubuntu-mainline-kernel.sh b/ubuntu-mainline-kernel.sh
index fc9c0c3..f60f946 100755
--- a/ubuntu-mainline-kernel.sh
+++ b/ubuntu-mainline-kernel.sh
@@ -369,6 +369,7 @@ latest_local_version() {
 }

 remote_html_cache=""
+remote_html_cache="$(cat < remote_html_cache)"
 remote_versions_read=0

 normalize_version_for_match() {
@@ -412,6 +413,7 @@ load_remote_versions () {
         if [ -z "$remote_html_cache" ]; then
           [ -z "$2" ] && logn "Downloading index from $ppa_host"
           remote_html_cache=$(download $ppa_host $ppa_index)
+          cat <<<"$remote_html_cache" > remote_html_cache
           [ -z "$2" ] && log
         fi

@@ -609,6 +611,7 @@ Optional:
         else
             log
         fi
+        exit

         [ ! -d "$workdir" ] && {
             mkdir -p "$workdir" 2>/dev/null

I used commands like these:

./ubuntu-mainline-kernel.sh -r 4.19 --rc
./ubuntu-mainline-kernel.sh -i 4.19 -do

Roy-Orbison avatar Feb 10 '21 04:02 Roy-Orbison