Hello,

We bumped into a potential bug in spax. According to the manual, spax should support backreferences with the '-s' option:

<quoting from spax manual>
-s replstr
(...)
The format shall be:
     -s /old/new/[gp]
where as in ed, old is a basic regular expression and new can contain an ampersand, '\n' (where n is a digit) backreferences, or subexpression matching.
(...)
</quoting from spax manual>

But it seems that backreferences are not working/supported. We also tested the same with the old pax and it's working there.


Steps to reproduce:
-------------------
1) Create a working dir and move to it.
# mkdir ptar
# cd ptar

2) Create a 3 level dir structure and put some files in the lowest level:
# mkdir -p dir1/{sdi1,sdi2}/cfg
# touch dir1/{sdi1,sdi2}/cfg/fich.cfg

3) Create a package with the files we've created:
# tar czvf ptar.tgz dir1/

4) Now we want the files to be placed in a different path, and instead of having 3 subdirectory levels place them in 2, the 2nd's gonna be a concatenation of the 2nd and 3rd level subdirectory names.

4a) With old pax it works:
# pax -z -v -f ptar.tgz -s ',dir1/\([^/]*\)/\([^/]*\),dir2/\1-\2,' *.cfg
-rw-rw---- 1 ut06121 cargas 0 Apr 20 12:24 dir2/sdi1-cfg/fich.cfg
-rw-rw---- 1 ut06121 cargas 0 Apr 20 12:24 dir2/sdi2-cfg/fich.cfg

4b) With the latest spax it doesn't:
# spax -z -v -f ptar.tgz -s ',dir1/\([^/]*\)/\([^/]*\),dir2/\1-\2,' *.cfg
-rw-r--r-- 0 ut06121 integ 0 Apr 20 12:30 dir1/sdi1/cfg/fich.cfg
-rw-r--r-- 0 ut06121 integ 0 Apr 20 12:30 dir1/sdi2/cfg/fich.cfg


Can you please help here? Are we missing something?

Thanks!

Best regards,
Kristyna Streitova


_______________________________________________
S-tar-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-tar-developers

Reply via email to