mc does not open/view deb packages

Bug #2076503 reported by Attila Fülöp
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mc (Ubuntu)
New
Undecided
Unassigned

Bug Description

Hi,

When I press Enter (for open) or F3 (for view) on a deb package in midnight commander, not the expected action ("cd into" package , show details of package) is performed.

I found this in the /etc/mc/mc.ext.ini for deb:

```bash
[deb]
Regex=\.u?deb$
Open=%cd %p/deb://
View=%view{ascii} /usr/lib/mc/ext.d/package.sh view deb
```

After I comment out the Regex line and insert the line below, mc works as expected:
```bash
Shell=.deb
```

Ubuntu release:
== 0 ==> lsb_release -rd
No LSB modules are available.
Description: Ubuntu 24.04 LTS
Release: 24.04

== 0 ==> apt-cache policy mc
mc:
  Installed: 3:4.8.30-1build2
  Candidate: 3:4.8.30-1build2

Thanks,
Attila

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Can you confirm that it's a duplicate of #2062968 ? If so, workaround:

sudo wget https://raw.githubusercontent.com/MidnightCommander/mc/master/misc/mc.ext.ini.in -O /etc/mc/mc.ext.ini

Substitute @EXTHELPERSDIR@ by /usr/lib/mc/ext.d .

Revision history for this message
Attila Fülöp (fuelee) wrote (last edit ):

Hi,

It is similar, but I opened only for "deb" extension (but other extensions can also be problematic, I did not check. I just found another, the ".tar.xz" also broken).

The original configuration came with the package is:
```bash
[deb]
Regex=\.u?deb$
Open=%cd %p/deb://
View=%view{ascii} /usr/lib/mc/ext.d/package.sh view deb
```

According to the above workaround I should substitute the @EXTHELPERSDIR@ by /usr/lib/mc/ext.d from the file I download with wget, but it is already that path. Additionaly, mc never complain to me that package.sh is not found, this line might not be triggered with the "Regex=" detection.

In my "fix" I used the "Shell=.deb" expression instead of "Regex=\.u?deb$". I also tried to change the "Regex=" expression, for example remove the "u" letter...but did not solve the issue.

I suspect an issue with regular expression processing, because when I used the shell expression it worked instantly, without any other modification.

I saw this comment in the you mailed me(#2062968): "Detection by type is broken due to wrong escaping. Reopened upstream. Thanks for reporting."

What if the Regex type detection is also broken and for now, only the Shell works?

Thanks

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

> According to the above workaround I should substitute the @EXTHELPERSDIR@ ... but it is already that path

This is not possible, you must have not overwritten the original file. Please try the extensions file from master correctly and report back, before any more time is spent on this.

Revision history for this message
Attila Fülöp (fuelee) wrote :

Hi,

I did not overwrite the original file, in fact I copied the file from /etc in my .config/mc directory and used midnight commander "F9/c/e" shortcuts to modify the file and reload automatically.

I just did "apt download mc" in my home directory, opened/extracted the package content and inspected the mc.ext.ini file and it does not contain @EXTHELPERSDIR@ string, but contains the path already: /usr/lib/mc/ext.d/package.sh

== 0 ==> llr mc_3%3a4.8.30-1build2_amd64.deb
548K -rw-r--r-- 1 attila attila 546K ápr 1 12:33 mc_3%3a4.8.30-1build2_amd64.deb

== 0 ==> sha256sum mc_3%3a4.8.30-1build2_amd64.deb
c2368c0c78aec9026e9dd535c64eec77471db6e35fdf1286f7e75c357ebce2e9 mc_3%3a4.8.30-1build2_amd64.deb

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

> I did not overwrite the original file, in fact I copied the file from /etc in my .config/mc directory
> and used midnight commander "F9/c/e" shortcuts to modify the file and reload automatically.

So can you confirm that with the definitions from master branch, however you load them the problem is still present? Or if you compile from master, it still doesn't work?

> I just did "apt download mc" in my home directory, opened/extracted the package content and inspected
> the mc.ext.ini file and it does not contain @EXTHELPERSDIR@ string, but contains the path already

Of course it does, and I didn't ask about that.

Revision history for this message
Attila Fülöp (fuelee) wrote :

I can confirm that this config file: https://raw.githubusercontent.com/MidnightCommander/mc/master/misc/mc.ext.ini.in with the suggested substitution, fixes the problem - deb open/view - with the version of mc binary mentioned above.

Revision history for this message
Yury V. Zaytsev (zyv) wrote :

Alright thanks so this *is* a duplicate of #2062968 and will be fixed in Ubuntu when we release 4.8.32 and it gets imported into the distribution. Partial fix is available in 4.8.31.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.