makedist.midori: Add workdir and version_tag variables for better readability

This commit is contained in:
Paweł Forysiuk 2012-02-09 00:31:13 +01:00 committed by Christian Dywan
parent f387f9c29b
commit ef1928ad16

View file

@ -34,11 +34,15 @@ temp_dir=`mktemp -d`
# check if we can use 7zip # check if we can use 7zip
have_7zip=`which 7za` have_7zip=`which 7za`
if [ "$1" != "" ]; then
version_tag=$1
fi
# generate unique filename # generate unique filename
if [ "$have_7zip" != "" ]; then if [ "$have_7zip" != "" ]; then
ARCHIVE=midori$1-`date +%Y%m%d%H%M`.7z ARCHIVE=midori$version_tag-`date +%Y%m%d%H%M`.7z
else else
ARCHIVE=midori$1-`date +%Y%m%d%H%M`.zip ARCHIVE=midori$version_tag-`date +%Y%m%d%H%M`.zip
fi fi
# function: dll-recursive <list of exe and dll files ...> # function: dll-recursive <list of exe and dll files ...>
@ -72,7 +76,8 @@ dll_recursive ()
echo -n "Creating $ARCHIVE ." echo -n "Creating $ARCHIVE ."
# create destination folder # create destination folder
mkdir $temp_dir/midori$1 workdir=$temp_dir/midori$version_tag
mkdir $workdir
echo -n . echo -n .
@ -87,38 +92,38 @@ echo -n .
# copy auto generate dll list # copy auto generate dll list
pushd $root_dir/bin > /dev/null pushd $root_dir/bin > /dev/null
mkdir $temp_dir/midori$1/bin mkdir $workdir/bin
cp $files $temp_dir/midori$1/bin cp $files $workdir/bin
popd > /dev/null popd > /dev/null
echo -n . echo -n .
# copy etc # copy etc
pushd $root_dir > /dev/null pushd $root_dir > /dev/null
find etc "(" -name "*midori*" -o -name "gtkrc" ")" -prune -exec mkdir -p $temp_dir/midori$1/{} ";" -exec rmdir --ignore-fail-on-non-empty $temp_dir/midori$1/{} ";" -exec cp -r {} $temp_dir/midori$1/{} ";" find etc "(" -name "*midori*" -o -name "gtkrc" ")" -prune -exec mkdir -p $workdir/{} ";" -exec rmdir --ignore-fail-on-non-empty $workdir/{} ";" -exec cp -r {} $workdir/{} ";"
popd > /dev/null popd > /dev/null
echo -n . echo -n .
# copy lib # copy lib
pushd $root_dir > /dev/null pushd $root_dir > /dev/null
find lib "(" -path "lib/midori/*" -o -path "lib/gtk-2.0/*" -o -path "lib/enchant/*" -o -path "lib/engines/*" ")" -a -name "*.dll" -prune -exec mkdir -p $temp_dir/midori$1/{} ";" -exec rmdir --ignore-fail-on-non-empty $temp_dir/midori$1/{} ";" -exec cp -r {} $temp_dir/midori$1/{} ";" find lib "(" -path "lib/midori/*" -o -path "lib/gtk-2.0/*" -o -path "lib/enchant/*" -o -path "lib/engines/*" ")" -a -name "*.dll" -prune -exec mkdir -p $workdir/{} ";" -exec rmdir --ignore-fail-on-non-empty $workdir/{} ";" -exec cp -r {} $workdir/{} ";"
popd > /dev/null popd > /dev/null
echo -n . echo -n .
# copy share # copy share
pushd $root_dir > /dev/null pushd $root_dir > /dev/null
find share "(" -name "*midori*" -o -name "icons" -o -name "MS-Windows" -o -name "mime" ")" -prune -exec mkdir -p $temp_dir/midori$1/{} ";" -exec rmdir --ignore-fail-on-non-empty $temp_dir/midori$1/{} ";" -exec cp -r {} $temp_dir/midori$1/{} ";" find share "(" -name "*midori*" -o -name "icons" -o -name "MS-Windows" -o -name "mime" ")" -prune -exec mkdir -p $workdir/{} ";" -exec rmdir --ignore-fail-on-non-empty $workdir/{} ";" -exec cp -r {} $workdir/{} ";"
# copy locales for gtk # copy locales for gtk
# so we have translated stock items, file dialogs # so we have translated stock items, file dialogs
find share "(" -name "midori.mo" ")" > locale.list find share "(" -name "midori.mo" ")" > locale.list
mkdir -p $temp_dir/midori$1/share/locale/ mkdir -p $workdir/share/locale/
for LOCALE in $(cat locale.list); do for LOCALE in $(cat locale.list); do
LOCALE=$(echo $LOCALE|awk -F/ '{print $3}') LOCALE=$(echo $LOCALE|awk -F/ '{print $3}')
cp /usr/share/locale/$LOCALE/LC_MESSAGES/gtk20.mo $temp_dir/midori$1/share/locale/$LOCALE/LC_MESSAGES/ cp /usr/share/locale/$LOCALE/LC_MESSAGES/gtk20.mo $workdir/share/locale/$LOCALE/LC_MESSAGES/
done done
rm locale.list rm locale.list
popd > /dev/null popd > /dev/null
@ -126,7 +131,7 @@ popd > /dev/null
echo -n . echo -n .
# copy doc files to root # copy doc files to root
cp $temp_dir/midori$1/share/doc/midori/{COPYING,AUTHORS} $temp_dir/midori$1 cp $workdir/share/doc/midori/{COPYING,AUTHORS} $workdir
echo -n . echo -n .
@ -135,9 +140,9 @@ ARCHIVE=`pwd`/$ARCHIVE
# store as zip/7z file # store as zip/7z file
pushd $temp_dir > /dev/null pushd $temp_dir > /dev/null
if [ "$have_7zip" != "" ]; then if [ "$have_7zip" != "" ]; then
7za a -m0=lzma $ARCHIVE midori$1 7za a -m0=lzma $ARCHIVE midori$version_tag
else else
zip -rq $ARCHIVE midori$1 zip -rq $ARCHIVE midori$version_tag
fi fi
popd > /dev/null popd > /dev/null