-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmc-4.7.0.10-iso9660-semicolon.patch
46 lines (42 loc) · 1.34 KB
/
mc-4.7.0.10-iso9660-semicolon.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
--- a/lib/vfs/mc-vfs/extfs/iso9660.in 2010-12-14 17:41:09.000000000 +0300
+++ b/lib/vfs/mc-vfs/extfs/iso9660.in 2010-12-21 09:45:11.000000000 +0300
@@ -24,6 +24,12 @@
fi
ISOINFO="isoinfo -R"
isoinfo -d -i "$1" 2>/dev/null | @GREP@ "UCS level 1\|NO Joliet" > /dev/null || ISOINFO="$ISOINFO $JOLIET_OPT"
+
+ if [ `isoinfo -d -i "$1" 2>/dev/null | @GREP@ "Joliet with UCS level 3 found" | wc -l` == 1 ] ; then
+ if [ `isoinfo -d -i "$1" 2>/dev/null | @GREP@ "NO Rock Ridge" | wc -l` == 1 ] ; then
+ SEMICOLON="YES"
+ fi
+ fi
}
mcisofs_list () {
@@ -38,7 +44,7 @@
*) MYCAT="cat";;
esac
-$ISOINFO -l -i "$1" | @AWK@ '
+$ISOINFO -l -i "$1" 2>/dev/null | @AWK@ -v SEMICOLON=$SEMICOLON '
BEGIN {
dir="";
# Pattern to match 8 first fields.
@@ -60,6 +66,8 @@
sub(irx, "", name)
sub("^---------- 0 0 0", "-r--r--r-- 1 root root", attr)
sub(" $", "", name)
+ # for Joliet UCS level 3
+ if (SEMICOLON = "YES") sub(";1$", "", name);
## sub(";[0-9]+$", "", name) ## would break copyout
# skip . and ..
if (name ~ /^\.\.?/) next;
@@ -68,7 +76,11 @@
}
mcisofs_copyout () {
- $ISOINFO -i "$1" -x "/$2" > "$3"
+ if [ "x$SEMICOLON" == "xYES" ]; then
+ $ISOINFO -i "$1" -x "/$2;1" 2>/dev/null > "$3"
+ else
+ $ISOINFO -i "$1" -x "/$2" 2>/dev/null > "$3"
+ fi
}
LC_ALL=C