How to properly escape weird characters in paths to have a valid filelist?

Miro Hrončok mhroncok at redhat.com
Fri Jul 2 11:00:56 UTC 2021


On 29. 06. 21 13:32, Miro Hrončok wrote:
> While at it, I've also tried to figure out how to escape a % symbol in path. 
> Suppose the path is literally:
> 
> /usr/share/data/%version
> 
> I've tried the following options with no luck:
> 
> "/usr/share/data/%version"
> /usr/share/data/%%version
> /usr/share/data/%%%version
> /usr/share/data/%%%%version
> /usr/share/data/%%%%%version ...

My experiments show that I need to put 8 % signs to the filelist to have a file 
listed with one % sign in the path.

However, that might very well not be a stable assumption:

   %install
   touch '%{buildroot}percent%%version'

   %files
   /percent%%%%%%%%version

-- 
Miro Hrončok
-- 
Phone: +420777974800
IRC: mhroncok



More information about the Rpm-list mailing list