comparison plugins/ufraw/geeqie-ufraw @ 1653:f66934d3706b

fixed regexp usage
author nadvornik
date Fri, 19 Jun 2009 22:37:30 +0000
parents 8966e72ae99a
children 00673c03d856
comparison
equal deleted inserted replaced
1652:58a5d1e01e33 1653:f66934d3706b
7 # localization? 7 # localization?
8 # help 8 # help
9 9
10 10
11 # matches raw file names, used as case insensitive 11 # matches raw file names, used as case insensitive
12 RAW_REGEX='.*\.\(arw\)\|\(srf\)\|\(sr2\)\|\(crw\)\|\(cr2\)\|\(kdc\)\|\(dcr\)\|\(k25\)\|\(raf\)\|\(mef\)\|\(mos\)\|\(mrw\)\|\(nef\)\|\(orf\)\|\(pef\)\|\(ptx\)\|\(dng\)\|\(x3f\)\|\(raw\)\|\(r3d\)\|\(3fr\)\|\(erf\)$' 12 RAW_REGEX='.*\.(arw|srf|sr2|crw|cr2|kdc|dcr|k25|raf|mef|mos|mrw|nef|orf|pef|ptx|dng|x3f|raw|r3d|3fr|erf)$'
13 13
14 # matches ufraw id file names, used as case sensitive 14 # matches ufraw id file names, used as case sensitive
15 ID_REGEX='.*\.ufraw$' 15 ID_REGEX='.*\.ufraw$'
16 16
17 get_output_from_id () 17 get_output_from_id ()
70 [ -n "$use_zenity" ] && echo 0 70 [ -n "$use_zenity" ] && echo 0
71 71
72 if [ "$count" -gt 0 ] ; then 72 if [ "$count" -gt 0 ] ; then
73 while read file; do 73 while read file; do
74 [ -f "$file" ] || continue 74 [ -f "$file" ] || continue
75 if echo "$file"|grep -q -i "$RAW_REGEX" ; then 75 if echo "$file"|grep -E -q -i "$RAW_REGEX" ; then
76 process_raw_file_default "$file" 76 process_raw_file_default "$file"
77 elif echo "$file"|grep -q "$ID_REGEX" ; then 77 elif echo "$file"|grep -E -q "$ID_REGEX" ; then
78 process_ufraw_id_file "$file" 78 process_ufraw_id_file "$file"
79 79
80 fi 80 fi
81 81
82 n=$((n + 1)) 82 n=$((n + 1))
94 # processing is controlled by zenity dialogs if $DISPLAY is set 94 # processing is controlled by zenity dialogs if $DISPLAY is set
95 process_tree () 95 process_tree ()
96 { 96 {
97 list=`mktemp /tmp/geeqie-ufraw-list.XXXXXXXXXX` || exit 1 97 list=`mktemp /tmp/geeqie-ufraw-list.XXXXXXXXXX` || exit 1
98 98
99 find "$1" -iregex "$RAW_REGEX" -print | while read rawfile ; do 99 find "$1" -regextype posix-egrep -iregex "$RAW_REGEX" -print | while read rawfile ; do
100 raw_file_not_processed "$rawfile" && echo "$rawfile" 100 raw_file_not_processed "$rawfile" && echo "$rawfile"
101 done >>$list 101 done >>$list
102 102
103 #refresh output from changed id files 103 #refresh output from changed id files
104 find "$1" -regex "$ID_REGEX" -print | while read idfile ; do 104 find "$1" -regextype posix-egrep -regex "$ID_REGEX" -print | while read idfile ; do
105 id_file_changed "$idfile" && echo "$idfile" 105 id_file_changed "$idfile" && echo "$idfile"
106 done >>$list 106 done >>$list
107 107
108 if [ -n "$DISPLAY" ] ; then 108 if [ -n "$DISPLAY" ] ; then
109 if [ -s $list ] && \ 109 if [ -s $list ] && \