AnsweredAssumed Answered

RPM postinstall script issue

Question asked by akusanagi Employee on Mar 13, 2012
Latest reply on Mar 13, 2012 by Ted Dunning
When installing MapR in a non-English environment, /opt/mapr/conf and /opt/mapr/ directories are created, but files in the directory are not copied to the conf directory.

Looking at the postinstall script of mapr-core-*.rpm, there is the following description:

    mkdir -p /opt/mapr/conf
    diffR=$(diff -r /opt/mapr/conf /opt/mapr/ | grep "^Only in " | grep "" | sed "s/^Only in //" | sed "s/: /\//")
    for i in `echo $diffR`; do j=$(echo $i | sed 's/'); cp -Rp $i $j ; done

In an English-environment, diff generates a text beginning with "Only in ...", but different representation is used in a non-English environment (I faced this problem with LANG=ja_JP.utf8).

So, I suggest a fix like this:

    diffR=$(LANG=C diff -r /opt/mapr/conf /opt/mapr/ | grep "^Only in " | grep "" | sed "s/^Only in //" | sed "s/: /\//")

The same is true for other RPM packages including mapr-client, mapr-flume-internal, mapr-hbase-internal, mapr-hive-internal, mapr-oozie-internal, mapr-pig-internal, mapr-sqoop-internal and mapr-zk-internal.