Ticket #2820 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

misc/ext.d/*.sh

Reported by: gv Owned by: slavazanko
Priority: major Milestone: 4.8.4
Component: mc-config-ini Version: master
Keywords: Cc: gabriel@…
Blocked By: Blocking:
Branch state: merged Votes for changeset: committed-master

Description

  1. doc.sh has

ooffice)

but mc.ext has

...doc.sh open oofice

Please choose one.

Also in all files in misc/ext.d the MC_EXT_FILENAME must be sent unescaped:
Currently the variable will have "/path/to/a/file/with\ spaces\ in\ name"
But the name must be "/path/to/a/file/with spaces in name"

Use:
MC_EXT_FILENAME=$(echo "${MC_EXT_FILENAME}" | tr -d '
' )
in each file or send an unescaped file name to the scripts.

Change History

comment:1 Changed 13 years ago by gv

  • Cc gabriel@… added

Also related to this ticket, in mc.ext there is no "View=..." entry for include/video. Flac also need "View=..."

Last edited 13 years ago by gv (previous) (diff)

comment:2 Changed 13 years ago by slavazanko

  • Status changed from new to accepted
  • Owner set to slavazanko
  • Branch state changed from no branch to on review

Created branch 2820_extd_fix
Review, please

comment:3 Changed 13 years ago by andrew_b

  • Votes for changeset set to andrew_b

comment:4 Changed 13 years ago by angel_il

  • Votes for changeset changed from andrew_b to andrew_b angel_il
  • Branch state changed from on review to approved

comment:5 Changed 12 years ago by slavazanko

  • Status changed from accepted to testing
  • Votes for changeset changed from andrew_b angel_il to committed-master
  • Resolution set to fixed
  • Branch state changed from approved to merged

Merged to master:

git log --pretty=oneline d8d2b52..7e44bfb

comment:6 Changed 12 years ago by slavazanko

  • Status changed from testing to closed

comment:7 Changed 12 years ago by gv

Scripts in misc/ext.d/ still cannot handle correctly files containing spaces in the file name (MC_EXT_FILENAME variable).

comment:8 Changed 12 years ago by slavazanko

Okay, my test case after this fix:

  • cp /path/to/any-file.rpm '/tmp/a n y - f i l e.rpm'
  • run mc, go to /tmp
  • place cursor on 'a n y - f i l e.rpm' file and press F3

actual result:
Name : bla-bla
Version : 1.2.3
Release : fc17
Architecture: x86_64

expected result (should same as output of 'rpm -qivlp --scripts file.rpm' command):
Name : bla-bla
Version : 1.2.3
Release : fc17
Architecture: x86_64

I see exact what I expected

What your test case?

Version 0, edited 12 years ago by slavazanko (next)

comment:9 Changed 12 years ago by gv

  1. cp /path/to/any-file.rpm '/tmp/a n y - f i l e.rpm'
  2. run /usr/bin/mc, go to /tmp
  3. Press enter or F3 on 'a n y - f i l e.rpm' file

For 'Enter' (big red rectangle):

Error

Inconsistent extfs archive
error: open of /tmp/a\ failed: No such file or directory
error: open of n\ failed: No such file or directory
error: open of y\ failed: No such file or directory
error: open of -\ failed: No such file or directory
error: open of f\ failed: No such file or directory
error: open of i\ failed: No such file or directory
error: open of l\ failed: No such file or directory
error: open of e.rpm failed: No such file or directory

For F3 (white rectangle):

Warning

error: open of /tmp/a\ failed: No such file or directory
error: open of n\ failed: No such file or directory
error: open of y\ failed: No such file or directory
error: open of -\ failed: No such file or directory
error: open of f\ failed: No such file or directory
error: open of i\ failed: No such file or directory
error: open of l\ failed: No such file or directory
error: open of e.rpm failed: No such file or directory

Press escape (2 times), new reg rectangle:

Error
Empty output from child filter

Last edited 12 years ago by gv (previous) (diff)

comment:10 Changed 12 years ago by gv

  1. cp /path/to/any-file.rpm /tmp
  1. cp /path/to/any-file.rpm '/tmp/a n y - f i l e.rpm'
  1. list content of the file without spaces in filename:

# /usr/libexec/mc/extfs.d/rpm list /tmp/any-file.rpm
-r--r--r-- 1 root root 1559 May 4 2012 HEADER
-r-xr-xr-x 1 root root 39 May 4 2012 INSTALL
-r-xr-xr-x 1 root root 39 May 4 2012 UPGRADE
dr-xr-xr-x 3 root root 0 May 4 2012 INFO
-r--r--r-- 1 root root 0 May 4 2012 INFO/NAME-VERSION-RELEASE
-r--r--r-- 1 root root 0 May 4 2012 INFO/GROUP
-r--r--r-- 1 root root 0 May 4 2012 INFO/BUILDHOST
-r--r--r-- 1 root root 0 May 4 2012 INFO/SOURCERPM
-r--r--r-- 1 root root 0 May 4 2012 INFO/BUILDTIME
-r--r--r-- 1 root root 0 May 4 2012 INFO/RPMVERSION
-r--r--r-- 1 root root 0 May 4 2012 INFO/OS
-r--r--r-- 1 root root 0 May 4 2012 INFO/SIZE
-r--r--r-- 1 root root 0 May 4 2012 INFO/DISTRIBUTION
-r--r--r-- 1 root root 0 May 4 2012 INFO/VENDOR
-r--r--r-- 1 root root 0 May 4 2012 INFO/DESCRIPTION
-r--r--r-- 1 root root 0 May 4 2012 INFO/SUMMARY
-r--r--r-- 1 root root 0 May 4 2012 INFO/PACKAGER
-r--r--r-- 1 root root 0 May 4 2012 INFO/URL
-r--r--r-- 1 root root 0 May 4 2012 INFO/LICENSE
-r--r--r-- 1 root root 0 May 4 2012 INFO/REQUIRENAME
-r--r--r-- 1 root root 0 May 4 2012 INFO/CHANGELOG
-r--r--r-- 1 root root 0 May 4 2012 CONTENTS.cpio

  1. list content of the file with spaces in filename:

# /usr/libexec/mc/extfs.d/rpm list /tmp/a\ n\ y\ -\ f\ i\ l\ e.rpm
error: open of /tmp/a\ failed: No such file or directory
error: open of n\ failed: No such file or directory
error: open of y\ failed: No such file or directory
error: open of -\ failed: No such file or directory
error: open of f\ failed: No such file or directory
error: open of i\ failed: No such file or directory
error: open of l\ failed: No such file or directory
error: open of e.rpm failed: No such file or directory
-r--r--r-- 1 root root 0 Jun 29 15:12 ERROR

  1. Step 4 try 2:

# /usr/libexec/mc/extfs.d/rpm list "/tmp/a n y - f i l e.rpm"
error: open of /tmp/a\ failed: No such file or directory
error: open of n\ failed: No such file or directory
error: open of y\ failed: No such file or directory
error: open of -\ failed: No such file or directory
error: open of f\ failed: No such file or directory
error: open of i\ failed: No such file or directory
error: open of l\ failed: No such file or directory
error: open of e.rpm failed: No such file or directory
-r--r--r-- 1 root root 0 Jun 29 15:15 ERROR

comment:11 follow-up: ↓ 12 Changed 12 years ago by slavazanko

I confirm bug with 'Enter' action - this bug unrelated to this ticket and should be assigned to the 'mc-vfs' component in a newly created ticket.

But bug with 'F3' action can not reproduced. Did you compiled and ran the latest version from 'master' branch? What version you use (the latest is 4.8.3-112-g3e66455)?

comment:12 in reply to: ↑ 11 Changed 12 years ago by gv

Replying to slavazanko:

I confirm bug with 'Enter' action - this bug unrelated to this ticket and should be assigned to the 'mc-vfs' component in a newly created ticket.

True. I'm going to create a new ticket today.

But bug with 'F3' action can not reproduced. Did you compiled and ran the latest version from 'master' branch? What version you use (the latest is 4.8.3-112-g3e66455)?

# git pull
Already up-to-date.

# git branch -v

  • master d8d2b52 Merge branch '2803_homedir_in_tests'

I do have 3 cases for listing a src.rpm file:

# MC_EXT_FILENAME=/tmp/a\ n\ y\ -\ f\ i\ l\ e.rpm /usr/libexec/mc/ext.d/package.sh view src.rpm
Name : ...
Version : ...
Release : 1.fc17
Architecture: noarch

# MC_EXT_FILENAME="/tmp/a n y - f i l e.rpm" /usr/libexec/mc/ext.d/package.sh view src.rpm
Name : ...
Version : ...
Release : 1.fc17
Architecture: noarch

# MC_EXT_FILENAME="/tmp/a\ n\ y\ -\ f\ i\ l\ e.rpm" /usr/libexec/mc/ext.d/package.sh view src.rpm
error: open of /tmp/a\ failed: No such file or directory
error: open of n\ failed: No such file or directory
error: open of y\ failed: No such file or directory
error: open of -\ failed: No such file or directory
error: open of f\ failed: No such file or directory
error: open of i\ failed: No such file or directory
error: open of l\ failed: No such file or directory
error: open of e.rpm failed: No such file or directory

Same on Fedora 17 (x64), CentOS 6 (x86/x64).

I added in the beginning of the file package.sh this line:

echo "$MC_EXT_FILENAME"

(right after filetype=$2)

F3 on /tmp/a n y - f i l e.rpm show:
/tmp/a\ n\ y\ -\ f\ i\ l\ e.rpm
and the warning message from above.

comment:13 follow-up: ↓ 14 Changed 12 years ago by slavazanko

# git branch -v

master d8d2b52 Merge branch '2803_homedir_in_tests'

Ops, sorry, my big fail. I have closed this ticket without pushing commits to main git-repo.

Try to fetch the latest changes from repo, please.

Last edited 12 years ago by slavazanko (previous) (diff)

comment:14 in reply to: ↑ 13 Changed 12 years ago by gv

Ops, sorry, my big fail. I have closed this ticket without pushing commits to main git-repo.

Try to fetch the latest changes from repo, please.

Works fine now. Thanks.

Note: See TracTickets for help on using tickets.