From 2350a771397d8000040fb916815aeaa4372e5a82 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 4 Nov 2024 16:41:22 -0500 Subject: [PATCH 1/2] ranger 1.9.4 Signed-off-by: Rui Chen autobump: add ranger Signed-off-by: Rui Chen --- .github/autobump.txt | 1 + Formula/r/ranger.rb | 56 ++------------------------------------------ 2 files changed, 3 insertions(+), 54 deletions(-) diff --git a/.github/autobump.txt b/.github/autobump.txt index 0124ad30b30d9..6d67664c0bfc2 100644 --- a/.github/autobump.txt +++ b/.github/autobump.txt @@ -2393,6 +2393,7 @@ rage railway rakudo-star rancher-cli +ranger rapidfuzz-cpp ratchet rattler-build diff --git a/Formula/r/ranger.rb b/Formula/r/ranger.rb index 3b5649cd1d8ff..991c974c3d891 100644 --- a/Formula/r/ranger.rb +++ b/Formula/r/ranger.rb @@ -3,19 +3,11 @@ class Ranger < Formula desc "File browser" homepage "https://ranger.github.io" + url "https://github.com/ranger/ranger/archive/refs/tags/v1.9.4.tar.gz" + sha256 "7ad75e0d1b29087335fbb1691b05a800f777f4ec9cba84faa19355075d7f0f89" license "GPL-3.0-or-later" - revision 2 head "https://github.com/ranger/ranger.git", branch: "master" - stable do - url "https://ranger.github.io/ranger-1.9.3.tar.gz" - sha256 "ce088a04c91c25263a9675dc5c43514b7ec1b38c8ea43d9a9d00923ff6cdd251" - - # Drop `imghdr` for python 3.13 - # Backport of https://github.com/ranger/ranger/commit/9c0d3ba3495bac80142fad518e29b9061be94cc6 - patch :DATA - end - bottle do rebuild 4 sha256 cellar: :any_skip_relocation, arm64_sequoia: "29f94668e81c45db4b87f46d183450c306196f58315d34c948090d87552d81a0" @@ -43,47 +35,3 @@ def install assert_equal "Hello World!\n", shell_output("#{bin}/rifle -p 2 test.py") end end - -__END__ -diff --git a/ranger/ext/img_display.py b/ranger/ext/img_display.py -index ffaa4c0..a7e027e 100644 ---- a/ranger/ext/img_display.py -+++ b/ranger/ext/img_display.py -@@ -15,7 +15,6 @@ import base64 - import curses - import errno - import fcntl --import imghdr - import os - import struct - import sys -@@ -341,12 +340,28 @@ class ITerm2ImageDisplayer(ImageDisplayer, FileManagerAware): - with open(path, 'rb') as fobj: - return base64.b64encode(fobj.read()).decode('utf-8') - -+ @staticmethod -+ def imghdr_what(path): -+ """Replacement for the deprecated imghdr module""" -+ with open(path, "rb") as img_file: -+ header = img_file.read(32) -+ if header[6:10] in (b'JFIF', b'Exif'): -+ return 'jpeg' -+ elif header[:4] == b'\xff\xd8\xff\xdb': -+ return 'jpeg' -+ elif header.startswith(b'\211PNG\r\n\032\n'): -+ return 'png' -+ if header[:6] in (b'GIF87a', b'GIF89a'): -+ return 'gif' -+ else: -+ return None -+ - @staticmethod - def _get_image_dimensions(path): - """Determine image size using imghdr""" - file_handle = open(path, 'rb') - file_header = file_handle.read(24) -- image_type = imghdr.what(path) -+ image_type = ITerm2ImageDisplayer.imghdr_what(path) - if len(file_header) != 24: - file_handle.close() - return 0, 0 From 30c06a50c109fe1d88d85e511d9df4bf1c3c6810 Mon Sep 17 00:00:00 2001 From: BrewTestBot <1589480+BrewTestBot@users.noreply.github.com> Date: Tue, 5 Nov 2024 05:33:14 +0000 Subject: [PATCH 2/2] ranger: update 1.9.4 bottle. --- Formula/r/ranger.rb | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/Formula/r/ranger.rb b/Formula/r/ranger.rb index 991c974c3d891..1d8b855a0c90a 100644 --- a/Formula/r/ranger.rb +++ b/Formula/r/ranger.rb @@ -9,13 +9,12 @@ class Ranger < Formula head "https://github.com/ranger/ranger.git", branch: "master" bottle do - rebuild 4 - sha256 cellar: :any_skip_relocation, arm64_sequoia: "29f94668e81c45db4b87f46d183450c306196f58315d34c948090d87552d81a0" - sha256 cellar: :any_skip_relocation, arm64_sonoma: "29f94668e81c45db4b87f46d183450c306196f58315d34c948090d87552d81a0" - sha256 cellar: :any_skip_relocation, arm64_ventura: "29f94668e81c45db4b87f46d183450c306196f58315d34c948090d87552d81a0" - sha256 cellar: :any_skip_relocation, sonoma: "c4a0c957609a0dbc3c20f6bb0e420d1166bb65de6c205acca14ee85c880b68da" - sha256 cellar: :any_skip_relocation, ventura: "c4a0c957609a0dbc3c20f6bb0e420d1166bb65de6c205acca14ee85c880b68da" - sha256 cellar: :any_skip_relocation, x86_64_linux: "29f94668e81c45db4b87f46d183450c306196f58315d34c948090d87552d81a0" + sha256 cellar: :any_skip_relocation, arm64_sequoia: "97ec1aa9eb07127348df0acbbe74ee70530e3c42b2b34b318d275a5b939b108c" + sha256 cellar: :any_skip_relocation, arm64_sonoma: "97ec1aa9eb07127348df0acbbe74ee70530e3c42b2b34b318d275a5b939b108c" + sha256 cellar: :any_skip_relocation, arm64_ventura: "97ec1aa9eb07127348df0acbbe74ee70530e3c42b2b34b318d275a5b939b108c" + sha256 cellar: :any_skip_relocation, sonoma: "9805b7b6198dac4993bf90919395a37d7e26dea6c1a059c87a82f30c56b915af" + sha256 cellar: :any_skip_relocation, ventura: "9805b7b6198dac4993bf90919395a37d7e26dea6c1a059c87a82f30c56b915af" + sha256 cellar: :any_skip_relocation, x86_64_linux: "97ec1aa9eb07127348df0acbbe74ee70530e3c42b2b34b318d275a5b939b108c" end depends_on "python@3.13"