30 lines
817 B
Bash
30 lines
817 B
Bash
#!/bin/bash
|
|
|
|
# Should be run as root user to avoid messing up permissions
|
|
BASEDIR=/root
|
|
SEARCHDIR=/usr/share/locale
|
|
|
|
ls ${SEARCHDIR}/de/LC_MESSAGES/ > ${BASEDIR}/before
|
|
|
|
#-----------------------------------------------
|
|
# Install app to make difference search possible
|
|
#-----------------------------------------------
|
|
|
|
ls ${SEARCHDIR}/de/LC_MESSAGES/ > ${BASEDIR}/after
|
|
|
|
diff ${BASEDIR}/before ${BASEDIR}/after > ${BASEDIR}/diff.list
|
|
|
|
sed -i '/^>/!d' ${BASEDIR}/diff.list
|
|
sed -i 's/^..//' ${BASEDIR}/diff.list
|
|
|
|
mkdir -p ${BASEDIR}/diff
|
|
|
|
while read -r line
|
|
do
|
|
find ${SEARCHDIR}/ -name $line -print0 | xargs -0 -I {} cp -r --parents {} ${BASEDIR}/diff
|
|
done < ${BASEDIR}/diff.list
|
|
|
|
cd ${BASEDIR}/diff
|
|
tar -czvf ../locales.tar .
|
|
rm -rf ${BASEDIR}/before ${BASEDIR}/after ${BASEDIR}/diff.list ${BASEDIR}/diff
|
|
cd ${BASEDIR} |