extfs trpm

Roland Illig roland.illig at gmx.de
Sat Oct 23 06:46:20 UTC 2004


Leonard den Ottolander wrote:
> On Wed, 2004-10-20 at 00:44, Leonard den Ottolander wrote:
> 
>>Hi,
>>
>>Attached you find the proposed fixes to trpm. The SEDCMD that is used in
>>rpm can not be used for the rpms file system. This should fix all the
>>quoting. Increased the "file" size for UNINSTALL to 40 as the message
>>"uninstalling rpm" was missing the last char.
>>
>>Please check for omissions and errors before committing ;) .

One omission is that you did not properly quote filenames that might 
start with a hyphen. Imagine a weird rpm called -package-4.5.rpm.

To solve this you can use mc_shellquote:

mc_shellquote() {
   case "$1" in [A-Za-z0-9_./]*) echo "$1";; *) echo "./$1";; esac
}

trpm_copyout() {
   rpmname=`mc_shellquote "$1"`
   ...
}

Roland



More information about the mc-devel mailing list