„difference.sh“ hinzufügen
This commit is contained in:
30
difference.sh
Normal file
30
difference.sh
Normal file
@@ -0,0 +1,30 @@
|
||||
#!/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}
|
Reference in New Issue
Block a user