Additional options:
--with-gnome find GNOME help files
--with-kde find KDE help files
+ --with-omf find OMF files
--all-name match all package/domain names
--without-mo skip *.mo locale files
EOF
GNOME='#'
KDE='#'
+OMF='#'
MO=''
MO_NAME=$NAME.lang
ALL_NAME='#'
KDE=''
shift
;;
+ --with-omf)
+ echo "$PROG: Enabling with OMF"
+ OMF=''
+ shift
+ ;;
--without-mo)
echo "$PROG: Disabling .mo files"
MO='#'
echo "$PROG: Using cached __find.files"
fi
+if [ ! -f __omf.files ] || [ "$TOP_DIR" -nt __omf.files ]; then
+ find $TOP_DIR -type f -name '*.omf' | \
+ sed -e '
+ s/:.*//
+ s:'"$TOP_DIR"'::' > __omf.files
+else
+ echo "$PROG: Using cached __omf.files"
+fi
+
(
if [ "$ALL_NAME" ]; then
fgrep $NAME __find.files
s:%lang(C) ::
s:^\$::' | egrep -v '^$' >> $MO_NAME
+(
+ if [ "$ALL_NAME" ]; then
+ fgrep $NAME __omf.files
+ else
+ cat __omf.files
+ fi
+) | sed '
+'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4:
+'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4:
+s:^\([^%].*\)::
+s:%lang(C) ::
+s:^\$::' | egrep -v '^$' >> $MO_NAME
+
if [ ! -f __find.dirs ] || [ "$TOP_DIR" -nt __find.dirs ]; then
find $TOP_DIR -type d | sed 's:'"$TOP_DIR"'::' > __find.dirs
else
s:^\([^%].*\)::
s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME
+(
+ if [ "$ALL_NAME" ]; then
+ fgrep $NAME __find.dirs
+ else
+ cat __find.dirs
+ fi
+) | sed '
+'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
+'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+s:^\([^%].*\)::
+s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME
+
if [ "$(egrep -v '(^%defattr|^$)' $MO_NAME | wc -l)" -le 0 ]; then
echo >&2 "Error: international files not found for $NAME!"
exit 1