Accepting request 208806 from home:dnh:branches:Base:System
- Reimplementation of mcrar5fs_list in vfs/extfs/helpers/urar using 'unrar vt' fixing the "trailing space" problem with 'unrar [lv]' closing http://www.midnight-commander.org/ticket/3073 and bnc#849082 OBS-URL: https://build.opensuse.org/request/show/208806 OBS-URL: https://build.opensuse.org/package/show/Base:System/mc?expand=0&rev=78
This commit is contained in:
parent
765d0fb1cf
commit
dc3c4beda0
@ -1,10 +1,25 @@
|
|||||||
diff -urN -x '*~' mc-4.8.10.orig/src/vfs/extfs/helpers/urar.in mc-4.8.10/src/vfs/extfs/helpers/urar.in
|
diff -urN -x '*~' mc-4.8.10.orig/src/vfs/extfs/helpers/urar.in mc-4.8.10/src/vfs/extfs/helpers/urar.in
|
||||||
--- mc-4.8.10.orig/src/vfs/extfs/helpers/urar.in 2013-08-02 17:02:39.000000000 +0200
|
--- mc-4.8.10.orig/src/vfs/extfs/helpers/urar.in 2013-08-02 17:02:39.000000000 +0200
|
||||||
+++ mc-4.8.10/src/vfs/extfs/helpers/urar.in 2013-11-25 23:10:36.000000000 +0100
|
+++ mc-4.8.10/src/vfs/extfs/helpers/urar.in 2013-11-28 07:14:54.000000000 +0100
|
||||||
@@ -42,14 +42,43 @@
|
@@ -4,6 +4,11 @@
|
||||||
$UNRAR v -c- -cfg- "$1" | @AWK@ -v uid=`id -u` -v gid=`id -g` '
|
# (C) 1996 2:5020/337.13@fidonet.org
|
||||||
BEGIN { flag=0 }
|
# Updated by christian.gennerat@alcatel.fr 1999
|
||||||
/^-----------/ { flag++; if (flag > 1) exit 0; next }
|
# Andrew V. Samoilov <sav@bcs.zp.ua> 2000
|
||||||
|
+#
|
||||||
|
+# Andrew Borodin <aborodin@vmail.ru>
|
||||||
|
+# David Haller <dnh@opensuse.org>
|
||||||
|
+# 2013: support unrar5
|
||||||
|
+#
|
||||||
|
# beta version 2.0
|
||||||
|
#
|
||||||
|
# rar and unrar can be found on http://www.rarlabs.com/
|
||||||
|
@@ -39,18 +44,62 @@
|
||||||
|
|
||||||
|
mcrar5fs_list ()
|
||||||
|
{
|
||||||
|
- $UNRAR v -c- -cfg- "$1" | @AWK@ -v uid=`id -u` -v gid=`id -g` '
|
||||||
|
-BEGIN { flag=0 }
|
||||||
|
-/^-----------/ { flag++; if (flag > 1) exit 0; next }
|
||||||
-flag==1 {
|
-flag==1 {
|
||||||
- split($5, a, "-")
|
- split($5, a, "-")
|
||||||
- if (index($1, "D") != 0)
|
- if (index($1, "D") != 0)
|
||||||
@ -13,43 +28,63 @@ diff -urN -x '*~' mc-4.8.10.orig/src/vfs/extfs/helpers/urar.in mc-4.8.10/src/vfs
|
|||||||
- if (index($1, ".") != 0)
|
- if (index($1, ".") != 0)
|
||||||
- $1="-rw-r--r--"
|
- $1="-rw-r--r--"
|
||||||
- printf "%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n", $1, uid, gid, $2, a[2], a[1], a[3], $6, $8
|
- printf "%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n", $1, uid, gid, $2, a[2], a[1], a[3], $6, $8
|
||||||
+flag == 1 {
|
-}'
|
||||||
+ name=""; delete fields; delete seps;
|
+ $UNRAR vt -c- -cfg- "$1" | @AWK@ -F ':' -v uid=`id -u` -v gid=`id -g` '
|
||||||
|
+ {
|
||||||
|
+ ### remove space after the ":" of the field name
|
||||||
|
+ sub ("^ ", "", $2);
|
||||||
|
+ }
|
||||||
+
|
+
|
||||||
+ ### split line, save n-fields and save seperators in "seps"
|
+ $1 ~ / *Name$/ {
|
||||||
+ ### tested with busybox awk
|
+ ### next file
|
||||||
+ nameparts = split($0, fields, " ");
|
+ name = mtime = size = attrs = "";
|
||||||
+ split($0, seps, "[^ \t]+");
|
+ delete date;
|
||||||
+ sub("^ ", "", seps[8]);
|
+ name = $2;
|
||||||
+
|
+ ### if the name contains ":", append the rest of the fields
|
||||||
+ ### split date for reformatting
|
+ if (NF > 2) {
|
||||||
+ split(fields[5], date, "-");
|
+ for (i = 3; i <= NF; i++) {
|
||||||
+
|
+ name = name ":" $i;
|
||||||
+ ### check/adjust rights
|
+ }
|
||||||
+ if (index(fields[1], "D") != 0) {
|
|
||||||
+ fields[1] = "drwxr-xr-x";
|
|
||||||
+ } else {
|
|
||||||
+ if (index(fields[1], ".") != 0) {
|
|
||||||
+ fields[1] = "-rw-r--r--";
|
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
+
|
+ $1 ~ /^ *mtime$/ {
|
||||||
+ ### join filename from fields 8 .. nameparts (saved above)
|
+ mtime = $2 ":" $3;
|
||||||
+ for(i = 8; i <= nameparts; i++) {
|
+ }
|
||||||
+ name=name seps[i] fields[i];
|
+ $1 ~ /^ *Size$/ {
|
||||||
|
+ size = $2;
|
||||||
|
+ }
|
||||||
|
+ $1 ~ /^ *Attributes$/ {
|
||||||
|
+ attrs = $2;
|
||||||
+ }
|
+ }
|
||||||
+ name=name seps[i];
|
|
||||||
+
|
+
|
||||||
+# ### where did this come from? I say: if in doubt: pass on the
|
+ $1 ~ /^ *Compression$/ {
|
||||||
+# ### unrar bug to our users ... I leave this in for reference.
|
+ ### file done, using /^$/ is not so good you
|
||||||
+# ### remove padding blanks from short names
|
+ ### would have to skip the version stuff first
|
||||||
+# if (length(name)<13) {
|
|
||||||
+# sub(" *$", "", name);
|
|
||||||
+# }
|
|
||||||
+
|
+
|
||||||
+ printf("%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n",
|
+ ### get date and time
|
||||||
+ fields[1], uid, gid, fields[2], date[2],
|
+ split (mtime, date, " ");
|
||||||
+ date[1], date[3], fields[6], name);
|
+ time = date[2];
|
||||||
}'
|
+ ### cut off seconds from the time
|
||||||
|
+ sub (",[0-9]*$", "", time);
|
||||||
|
+ ### split for reordering of the date in the printf below
|
||||||
|
+ split (date[1], date, "-");
|
||||||
|
+ ### mc seems to be able to parse 4 digit years too, so remove if tested
|
||||||
|
+ # sub ("^..", "", date[1]); ### cut year to 2 digits only
|
||||||
|
+
|
||||||
|
+ ### check/adjust rights
|
||||||
|
+ if (index (attrs, "D") != 0) {
|
||||||
|
+ attrs = "drwxr-xr-x";
|
||||||
|
+ } else {
|
||||||
|
+ if (index (attrs, ".") != 0) {
|
||||||
|
+ attrs = "-rw-r--r--";
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ ### and finally
|
||||||
|
+ printf ("%s 1 %s %s %d %02d/%02d/%02d %s ./%s\n",
|
||||||
|
+ attrs, uid, gid, size, date[2], date[3], date[1], time, name);
|
||||||
|
+ }
|
||||||
|
+'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mcrarfs_list ()
|
||||||
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu Nov 28 12:27:16 UTC 2013 - dnh@opensuse.org
|
||||||
|
|
||||||
|
- Reimplementation of mcrar5fs_list in vfs/extfs/helpers/urar using
|
||||||
|
'unrar vt' fixing the "trailing space" problem with 'unrar [lv]'
|
||||||
|
closing http://www.midnight-commander.org/ticket/3073 and bnc#849082
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Nov 25 22:45:29 UTC 2013 - dnh@opensuse.org
|
Mon Nov 25 22:45:29 UTC 2013 - dnh@opensuse.org
|
||||||
|
|
||||||
|
1
mc.spec
1
mc.spec
@ -45,6 +45,7 @@ Patch21: mc-extfs-helpers-deb.patch
|
|||||||
|
|
||||||
# add mc-extfs-helpers-urar.patch (by dnh@opensuse.org) - Fix urar
|
# add mc-extfs-helpers-urar.patch (by dnh@opensuse.org) - Fix urar
|
||||||
# extfs failing on files with spaces (bnc#849082). Forwarded to upstream.
|
# extfs failing on files with spaces (bnc#849082). Forwarded to upstream.
|
||||||
|
# see http://www.midnight-commander.org/ticket/3073
|
||||||
Patch22: mc-extfs-helpers-urar.patch
|
Patch22: mc-extfs-helpers-urar.patch
|
||||||
|
|
||||||
#debian fixes for vfs
|
#debian fixes for vfs
|
||||||
|
Loading…
x
Reference in New Issue
Block a user