Github messages for voidlinux
 help / color / mirror / Atom feed
From: 0x5c <0x5c@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] [RFC] mc: cleanup, python3, adopt.
Date: Tue, 10 Oct 2023 03:42:01 +0200	[thread overview]
Message-ID: <20231010014201.S1KiW2mkFAOBxZkzGeTU8NL6GyNJYHgwggw7SGb72Io@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-38079@inbox.vuxu.org>

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

There is an updated pull request by 0x5c against master on the void-packages repository

https://github.com/0x5c/void-packages mc-cleanup
https://github.com/void-linux/void-packages/pull/38079

[RFC] mc: cleanup, python3, adopt.
This PR splits off python-dependent backends into a subpackage. This is the approach used in other distros.
However, this only takes care of having python, it does not take into account more programs that may be needed (like the uc1451 backend needing the `vice` package). Most backends are just thin translation layers over an external tool, and some need perl. None of those dependencies are marked as such in the package, nor are they in other distros. What would be the best way to deal with that?

#### Testing the changes
- I tested the changes in this PR: **YES**
    It is impossible to test the s3 backend without an AWS S3 account, but the patch is used in other distros.


A patch file from https://github.com/void-linux/void-packages/pull/38079.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mc-cleanup-38079.patch --]
[-- Type: text/x-diff, Size: 8838 bytes --]

From 151212a082aaba766a0c8e9574b87debb8938e32 Mon Sep 17 00:00:00 2001
From: 0x5c <dev@0x5c.io>
Date: Fri, 15 Jul 2022 01:32:33 -0400
Subject: [PATCH] mc: update to 4.8.29, cleanup, adopt.

Also convert scripts from python2 to python3.
---
 srcpkgs/mc/files/README.voidlinux      | 50 ++++++++++++++++
 srcpkgs/mc/patches/extfs-python3.patch | 80 ++++++++++++++++++++++++++
 srcpkgs/mc/template                    | 14 +++--
 3 files changed, 138 insertions(+), 6 deletions(-)
 create mode 100644 srcpkgs/mc/files/README.voidlinux
 create mode 100644 srcpkgs/mc/patches/extfs-python3.patch

diff --git a/srcpkgs/mc/files/README.voidlinux b/srcpkgs/mc/files/README.voidlinux
new file mode 100644
index 0000000000000..a4301f03e50ad
--- /dev/null
+++ b/srcpkgs/mc/files/README.voidlinux
@@ -0,0 +1,50 @@
+MC has a number of "extfs" backend scripts to extend its functionality.
+They depend on various programs to work, which are not marked as dependencies of
+the mc package and must be installed manually for the backends to workproperly.
+
+| Backend                                     | Dependencies                                         |
+| ------------------------------------------- | ---------------------------------------------------- |
+| `a+` DOS filesystem access                  | `perl mtools`                                        |
+| `apt+` APT frontend (repository browser?)   | `perl apt dpkg`                                      |
+| `audio` browse audio cdroms+CDDB            | `cdparanoia wget`                                    |
+| `changesetfs` list git revs of curr. file   | `git`                                                |
+| `deb` .deb package viewer                   | `perl dpkg`                                          |
+| `deba` APT frontend (deb browser/installer) | `perl apt dpkg`                                      |
+| `debd` DPKG frontend (also deb browser)     | `perl dpkg`                                          |
+| `dpkg+` DPKG frontend                       | `perl dpkg`                                          |
+| `gitfs+` git repo browser                   | `git`                                                |
+| `iso9660` ISO9660 image browser             | `xorriso cdrtools [common_archivers]`                |
+| `lslR` "For browsing lslR listings"         | `[common_archivers]`                                 |
+| `mailfs` Mailbox browser                    | `[common_archivers] file perl-{TimeDate,Date-Manip}` |
+| `patchfs` patchfile explorer                | `[common_archivers] file perl-TimeDate`              |
+| `patchsetfs` list git patches of curr. file | `git`                                                |
+| `rpm` RPM package viewer                    | `rpm`                                                |
+| `rpms+` RPM frontend                        | `perl rpm`                                           |
+| `trpm` RPM frontend                         | `rpm`                                                |
+| `u7z` 7zip archive support                  | `7zip`                                               |
+| `uar` AR archive support                    | `binutils`                                           |
+| `uc1541` C64/128 disk image support         | `python3 vice`                                       |
+| `ucab` Microsoft CAB archive support        | `cabextract`                                         |
+| `ulib` gputils archive support              | `perl gputils`                                       |
+| `unar` unar wrapper                         | `unar`                                               |
+| `urar` RAR archive support                  | `unrar`                                              |
+| `uwim` Windows WIM archive support          | `wimlib`                                             |
+| `uzip` ZIP archive support                  | `perl zip unzip`                                      |
+
+`[common_archivers]` refers to the following archivers/compressors: `bzip2 gzip lz4 lzip xz zstd`.
+
+Additionally, the following extfs plugins require programs that are not packaged on void.
+
+| Backend                                   | Dependencies                        |
+| ----------------------------------------- | ----------------------------------- |
+| `bpp`   "Bad Penguin" package management  | Unknown executable: `package-setup` |
+| `hp48+` file manager for HP48 calculators | Unknown executable: `kermit`        |
+| `s3+`   AWS S3 client                     | Missing python pkg: `python3-boto`  |
+| `uace`  ACE archive support               | Unknown executable: `unace`         |
+| `ualz`  ALZ archive support               | Unknown executable: `unalz`         |
+| `uarc`  ARC archive support               | Unknown executable: `arc`           |
+| `uarj`  ARJ archive support               | Unknown executable: `arj`           |
+| `uha`   HA archive support                | Unknown executable: `ha`            |
+| `ulha`  LHa archive support               | Unknown executable: `lha`           |
+| `uzoo`  ZOO archive support               | Unknown executable: `zoo`           |
+
diff --git a/srcpkgs/mc/patches/extfs-python3.patch b/srcpkgs/mc/patches/extfs-python3.patch
new file mode 100644
index 0000000000000..d86472ea81766
--- /dev/null
+++ b/srcpkgs/mc/patches/extfs-python3.patch
@@ -0,0 +1,80 @@
+Taken from https://src.fedoraproject.org/rpms/mc/blob/rawhide/f/mc-python3.patch
+Also see https://github.com/MidnightCommander/mc/pull/149
+
+--
+
+--- a/src/vfs/extfs/helpers/uc1541
++++ b/src/vfs/extfs/helpers/uc1541
+@@ -1,4 +1,4 @@
+-#!/usr/bin/env python
++#!/usr/bin/env python3
+ """
+ UC1541 Virtual filesystem
+ 
+--- a/src/vfs/extfs/helpers/s3+.in
++++ b/src/vfs/extfs/helpers/s3+.in
+@@ -1,4 +1,4 @@
+-#! @PYTHON@
++#! /usr/bin/env python3
+ # -*- coding: utf-8 -*-
+ 
+ #
+@@ -153,16 +153,16 @@
+ 	Propagates exception safely.
+ 	"""
+ 	from threading import Thread
+-	import Queue
++	import queue
+ 
+ 	items = list(iterable)
+ 	nitems = len(items)
+ 	if nitems < 2:
+-		return map(fun, items)
++		return list(map(fun, items))
+ 
+ 	# Create and fill input queue
+-	input = Queue.Queue()
+-	output = Queue.Queue()
++	input = queue.Queue()
++	output = queue.Queue()
+ 
+ 	for i,item in enumerate(items):
+ 		input.put( (i,item) )
+@@ -181,7 +181,7 @@
+ 						output.put( (i,result) )
+ 					except:
+ 						output.put( (None,sys.exc_info()) )
+-				except Queue.Empty:
++				except queue.Empty:
+ 					return
+ 
+ 	# Start threads
+@@ -196,8 +196,8 @@
+ 		try:
+ 			i,res = output.get()
+ 			if i == None:
+-				raise res[0],res[1],res[2]
+-		except Queue.Empty:
++				raise res[0](res[1]).with_traceback(res[2])
++		except queue.Empty:
+ 			break
+ 		ret.append(res)
+ 
+@@ -241,7 +241,7 @@
+ 		b = s3.get_bucket(name, validate=False)
+ 		b.get_location() # just to raise an exception on error
+ 		return b
+-	except boto.exception.S3ResponseError, e:
++	except boto.exception.S3ResponseError as e:
+ 		# Seems this is the only proper way to switch to the bucket's region.
+ 		# Requesting of the default region for "?location" does not work unfortunately.
+ 		m = re.search(r'<Region>(.*?)</Region>', e.body)
+@@ -340,7 +340,7 @@
+ 	expr = re.compile(r'^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})\.\d{3}Z$')
+ 	def convDate(awsdatetime):
+ 		m = expr.match(awsdatetime)
+-		ye,mo,da,ho,mi,se = map(int,m.groups())
++		ye,mo,da,ho,mi,se = list(map(int,m.groups()))
+ 
+ 		dt = datetime.datetime(ye,mo,da,ho,mi,se, tzinfo=pytz.utc)
+ 		return dt.astimezone(tz).strftime('%m-%d-%Y %H:%M')
diff --git a/srcpkgs/mc/template b/srcpkgs/mc/template
index bcae7c672c3a5..302d978e2cd35 100644
--- a/srcpkgs/mc/template
+++ b/srcpkgs/mc/template
@@ -1,20 +1,18 @@
 # Template file for 'mc'
 pkgname=mc
-version=4.8.29
-revision=1
+version=4.8.30
+revision=0
 build_style=gnu-configure
 configure_args="--with-screen=slang --without-x"
 hostmakedepends="perl pkg-config"
 makedepends="e2fsprogs-devel gpm-devel libglib-devel libssh2-devel slang-devel"
 short_desc="User-friendly file manager and visual shell"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="0x5c <dev@0x5c.io>"
 license="GPL-3.0-or-later"
 homepage="https://midnight-commander.org/"
 changelog="https://midnight-commander.org/wiki/NEWS-${version}"
 distfiles="https://www.midnight-commander.org/downloads/mc-${version}.tar.xz"
-#distfiles="http://fossies.org/linux/misc/mc-${version}.tar.gz"
-checksum=01d8a3b94f58180cca5bf17257b5078d1fd6fd27a9b5c0e970ec767549540ad4
-python_version=2
+checksum=5ebc3cb2144b970c5149fda556c4ad50b78780494696cdf2d14a53204c95c7df
 
 conf_files="
  /etc/mc/filehighlight.ini
@@ -25,3 +23,7 @@ conf_files="
  /etc/mc/mc.menu
  /etc/mc/mcedit.menu
  /etc/mc/sfs.ini"
+
+post_install() {
+	vdoc "${FILESDIR}/README.voidlinux"
+}

  parent reply	other threads:[~2023-10-10  1:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15  5:57 [PR PATCH] " 0x5c
2022-07-17  6:26 ` 0x5c
2022-07-17  7:28 ` 0x5c
2022-07-17  9:02 ` 0x5c
2022-10-16  2:14 ` github-actions
2022-10-31  2:15 ` [PR PATCH] [Closed]: " github-actions
2023-10-10  1:42 ` 0x5c [this message]
2023-10-10  1:45 ` [PR PATCH] [Updated] " 0x5c
2023-10-10  1:49 ` mc: update to 4.8.29, cleanup, adopt 0x5c
2023-10-10  1:51 ` [PR PATCH] [Merged]: " classabbyamp

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231010014201.S1KiW2mkFAOBxZkzGeTU8NL6GyNJYHgwggw7SGb72Io@z \
    --to=0x5c@users.noreply.github.com \
    --cc=ml@inbox.vuxu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).