Index: branches/stable/l10n-kde4/scripts/check_po_files =================================================================== --- branches/stable/l10n-kde4/scripts/check_po_files +++ branches/stable/l10n-kde4/scripts/check_po_files @@ -5,12 +5,17 @@ # This script checks the PO files with the help of Gettext's msgfmt tool +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + if test -f subdirs; then for lang in `cat subdirs`; do # Note: we do not use 'cd' here, to allow msgfmt to generate errors and warnings with paths containing the language code if test -f $lang/messages/kdelibs/kdelibs4.po; then - find $lang -name *.po | xargs perl scripts/change-header.pl $lang/messages/kdelibs/kdelibs4.po + find $lang -name *.po | xargs perl $SCRIPTY_DIR/change-header.pl $lang/messages/kdelibs/kdelibs4.po fi # Check all PO files with Gettext's msgfmt @@ -25,7 +30,7 @@ fi done - perl scripts/check_desktop_files + perl $SCRIPTY_DIR/check_desktop_files else echo "ERROR: could not find the subdirs file! (Wrong directory?)" fi Index: branches/stable/l10n-kde4/scripts/checkdocs.sh =================================================================== --- branches/stable/l10n-kde4/scripts/checkdocs.sh +++ branches/stable/l10n-kde4/scripts/checkdocs.sh @@ -1,8 +1,13 @@ #!/bin/bash +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + NTHREADS=4 -. scripts/find_meinproc +. $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 @@ -13,10 +18,8 @@ exit 1 fi -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit 1 -fi +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. if [ "x$DOOCBOOK_LOCATION" = "x" ]; then Index: branches/stable/l10n-kde4/scripts/createdoctemplates.sh =================================================================== --- branches/stable/l10n-kde4/scripts/createdoctemplates.sh +++ branches/stable/l10n-kde4/scripts/createdoctemplates.sh @@ -5,6 +5,11 @@ LC_MESSAGES=C CDPATH= +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + hput () { key=`echo $1 | sed -e "s#/#_#g" | sed -e "s#\.#_#g"` eval hash"$key"='$2' @@ -23,7 +28,7 @@ check=no if test "$1" = "--check"; then - . scripts/find_meinproc + . $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` DOCBOOK_L10N_ALL="$BASEDIR/`get_path kdelibs`/kdoctools/customization/xsl/all-l10n.xml" DOCBOOK_L10N_CUSTOM="$BASEDIR/`get_path kdelibs`/kdoctools/customization/xsl/kde-custom-l10n.xml" @@ -43,12 +48,12 @@ if [ $# -eq 0 ]; then rm -rf documentation - bash ./scripts/populate_documentation.sh --silent + bash $SCRIPTY_DIR/populate_documentation.sh --silent populateresult=$? modules=`find documentation/ -maxdepth 1 -type d -follow -printf '%f\n' | grep -v svn | grep -v documentation` elif [ $# -eq 1 ]; then rm -rf documentation/$1 - bash ./scripts/populate_documentation.sh --silent $1 + bash $SCRIPTY_DIR/populate_documentation.sh --silent $1 populateresult=$? modules=$1 else @@ -111,7 +116,7 @@ test -n "$VERBOSE" && echo "Generating $j.pot has failed!" continue fi - splitstatus=`python ./scripts/msgsplit templates/docmessages/$m/$j.pot.new` + splitstatus=`python $SCRIPTY_DIR/msgsplit templates/docmessages/$m/$j.pot.new` if [ -n "$splitstatus" ]; then echo "Problem in msgsplit of templates/docmessages/$m/$j.pot.new" echo $splitstatus Index: branches/stable/l10n-kde4/scripts/find_meinproc =================================================================== --- branches/stable/l10n-kde4/scripts/find_meinproc +++ branches/stable/l10n-kde4/scripts/find_meinproc @@ -1,6 +1,11 @@ -. scripts/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + function find_meinproc { MEINPROC_COMMAND="" Index: branches/stable/l10n-kde4/scripts/findfiles =================================================================== --- branches/stable/l10n-kde4/scripts/findfiles +++ branches/stable/l10n-kde4/scripts/findfiles @@ -12,11 +12,16 @@ fi filelist=$1 -dir=`dirname $0` -. $dir/get_paths -ml="`list_modules $dir` l10n" +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + +ml="`list_modules $SCRIPTY_DIR` l10n" + rm -f "$filelist"_* $filelist : > $filelist Index: branches/stable/l10n-kde4/scripts/merge_desktop_files.sh =================================================================== --- branches/stable/l10n-kde4/scripts/merge_desktop_files.sh +++ branches/stable/l10n-kde4/scripts/merge_desktop_files.sh @@ -1,8 +1,13 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; -g++ -O2 -march=nocona -o apply scripts/applycontext.cpp +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +g++ -O2 -march=nocona -o apply $SCRIPTY_DIR/applycontext.cpp + langfile=`tempfile` KDEDIR=`tempfile` logfile=`tempfile` Index: branches/stable/l10n-kde4/scripts/populate_documentation.sh =================================================================== --- branches/stable/l10n-kde4/scripts/populate_documentation.sh +++ branches/stable/l10n-kde4/scripts/populate_documentation.sh @@ -31,11 +31,14 @@ return $res } -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + mkdir -p documentation cd documentation @@ -207,7 +210,7 @@ echo "There was an error updating the sources" exit 1 fi -done < "../scripts/documentation_paths" +done < "$SCRIPTY_DIR/documentation_paths" cd .. Index: branches/stable/l10n-kde4/scripts/populate_source.sh =================================================================== --- branches/stable/l10n-kde4/scripts/populate_source.sh +++ branches/stable/l10n-kde4/scripts/populate_source.sh @@ -34,13 +34,16 @@ # source/link// -> ../repo/. # and are most of the time the same, but not always. -script=$0 modules="$@" -scriptdir=`dirname $script` -. $scriptdir/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD -svnroot=`LC_ALL=C svn info $scriptdir | grep '^Repository Root:' | sed 's/^[^:]*: *//'` +. $SCRIPTY_DIR/get_paths + +svnroot=`LC_ALL=C svn info $SCRIPTY_DIR | grep '^Repository Root:' | sed 's/^[^:]*: *//'` if test -z "$svnroot"; then echo "ERROR: Cannot extract Subversion repository root." exit 1 @@ -78,7 +81,7 @@ if test -z "$modules"; then echo "===== Fetching module list..." - modules=`list_modules $scriptdir` + modules=`list_modules $SCRIPTY_DIR` if test $? != 0 || test -z "$modules"; then echo "ERROR: Cannot list modules." exit 1 Index: branches/stable/l10n-kde4/scripts/posieve_check-tp-kde_results_to_webpage.sh =================================================================== --- branches/stable/l10n-kde4/scripts/posieve_check-tp-kde_results_to_webpage.sh +++ branches/stable/l10n-kde4/scripts/posieve_check-tp-kde_results_to_webpage.sh @@ -2,11 +2,14 @@ # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + if test "$1" = "--posievepath"; then POSIEVEPATH=$2 fi Index: branches/stable/l10n-kde4/scripts/update_translations =================================================================== --- branches/stable/l10n-kde4/scripts/update_translations +++ branches/stable/l10n-kde4/scripts/update_translations @@ -10,7 +10,7 @@ umask 022 extract_desktop() { - perl ./scripts/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp + perl $SCRIPTY_DIR/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp dest=$3 msguniq --to-code=UTF-8 -o desktop.$$ desktop.$$.tmp 2>/dev/null if test -f desktop.$$; then @@ -158,7 +158,7 @@ extractqml=$kdesdkscriptsdir/extractqml extractgrantlee=$kdesdkscriptsdir/grantlee_strings_extractor.py preparetips=$kdelibsdir/kdeui/preparetips - repackpot=$BASEDIR/$transmod/scripts/repack-pot.pl + repackpot=$SCRIPTY_DIR/repack-pot.pl kdelibs= @@ -200,19 +200,19 @@ REPACKPOT="perl $repackpot" \ PACKAGE=$mod \ IGNORE=".$vcs" \ - bash $BASEDIR/$transmod/scripts/extract-messages.sh) + bash $SCRIPTY_DIR/extract-messages.sh) rm -f messages.log ( XGETTEXT=`which xgettext` \ SUBMODULE=$templatename \ - FILLXMLFROMPO="python $BASEDIR/$transmod/scripts/fillxmlfrompo.py" \ + FILLXMLFROMPO="python $SCRIPTY_DIR/fillxmlfrompo.py" \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract-xml.sh) + bash $SCRIPTY_DIR/extract-xml.sh) ( SUBMODULE=$templatename \ - ASMETAINFOITS=$BASEDIR/$transmod/scripts/as-metainfo.its \ + ASMETAINFOITS=$SCRIPTY_DIR/as-metainfo.its \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract_metainfo.sh) + bash $SCRIPTY_DIR/extract_metainfo.sh) ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ @@ -226,7 +226,7 @@ BASEDIR=$BASEDIR \ transmod=$transmod \ templatename=$templatename \ - bash $BASEDIR/$transmod/scripts/process-static-messages.sh) + bash $SCRIPTY_DIR/process-static-messages.sh) rm -f messages.log @@ -347,7 +347,7 @@ test -z "$VERBOSE1" || echo "creating *._desktop_.pot files" test -z "$TIMING1" || date - bash scripts/findfiles `pwd`/all_files + bash $SCRIPTY_DIR/findfiles `pwd`/all_files for mod in $releases l10n; do case "$mod" in @@ -407,7 +407,7 @@ sed s#@DOCBOOKXSL_DIR@#$DOCBOOKXSL_LOCATION#g $kdelibsdir/kdoctools/customization/kde-include-man.xsl.cmake > $kdelibsdir/kdoctools/customization/kde-include-man.xsl docbookl10nhelper $DOCBOOKXSL_LOCATION $kdelibsdir/kdoctools/customization/xsl/ $kdelibsdir/kdoctools/customization/xsl/ - bash ./scripts/createdoctemplates.sh --commit --check --autosvnadd + bash $SCRIPTY_DIR/createdoctemplates.sh --commit --check --autosvnadd rm -f $kdelibsdir/kdoctools/customization/dtd/kdex.dtd \ $kdelibsdir/kdoctools/customization/kde-include-common.xsl \ $kdelibsdir/kdoctools/customization/kde-include-man.xsl \ @@ -431,7 +431,7 @@ echo echo "%% TRANSLATOR START $transmod" echo - bash scripts/merge_all.sh + bash $SCRIPTY_DIR/merge_all.sh echo echo "%% TRANSLATOR END $transmod" echo @@ -498,7 +498,7 @@ if cd $transmod; then test -z "$VERBOSE1" || echo "applying desktop file translations" test -z "$TIMING1" || date - bash scripts/merge_desktop_files.sh + bash $SCRIPTY_DIR/merge_desktop_files.sh cd $BASEDIR fi test -z "$VERBOSE1" || echo "commiting desktop files" @@ -559,11 +559,11 @@ echo "%% Updating x-test end" echo "%% Finding po without pot begin" - bash ./scripts/find_po_without_pot.sh --silent + bash $SCRIPTY_DIR/find_po_without_pot.sh --silent echo "%% Finding po without pot end" echo "%% Checking language docs are valid begin" - kdelibsdir=$kdelibsdir bash ./scripts/checkdocs.sh --optimized + kdelibsdir=$kdelibsdir bash $SCRIPTY_DIR/checkdocs.sh --optimized echo "%% Checking language docs are valid end" cd $BASEDIR @@ -573,14 +573,18 @@ test -z "$TIMING1" || date } +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + # releases: paths of modules - kdelibs has to be first # transmod: path of the corresponding l10n module # test only -dir=`dirname $0` -. $dir/get_paths +. $SCRIPTY_DIR/get_paths transmod=`get_path l10n` -releases=`list_modules $dir` +releases=`list_modules $SCRIPTY_DIR` kdelibsdir=$BASEDIR/`get_path kdelibs` kdesdkscriptsdir=$BASEDIR/`get_path kdesdk_kde-dev-scripts` update_translations Index: branches/stable/l10n-kf5-plasma-lts/scripts/check_po_files =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/check_po_files +++ branches/stable/l10n-kf5-plasma-lts/scripts/check_po_files @@ -5,6 +5,11 @@ # This script checks the PO files with the help of Gettext's msgfmt tool +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + copy_plural_header() { plural_master="$1" backup_path="$2" @@ -17,7 +22,7 @@ if test ! -f "$plural_master" ; then echo "Warning: Could not find file $plural_master to grab the plural formula from." else - find $find_args | xargs perl scripts/change-header.pl "$plural_master" + find $find_args | xargs perl $SCRIPTY_DIR/change-header.pl "$plural_master" fi } @@ -43,7 +48,7 @@ fi done - perl scripts/check_desktop_files + perl $SCRIPTY_DIR/check_desktop_files else echo "ERROR: could not find the subdirs file! (Wrong directory?)" fi Index: branches/stable/l10n-kf5-plasma-lts/scripts/checkdocs.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/checkdocs.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/checkdocs.sh @@ -1,8 +1,13 @@ #!/bin/bash +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + NTHREADS=4 -. scripts/find_meinproc +. $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 @@ -13,10 +18,8 @@ exit 1 fi -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit 1 -fi +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. if [ "x$DOOCBOOK_LOCATION" = "x" ]; then Index: branches/stable/l10n-kf5-plasma-lts/scripts/create_desktop_files.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/create_desktop_files.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/create_desktop_files.sh @@ -1,6 +1,11 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + get_prj_name() { local mod=$1 echo ${mod} | cut -d'_' -f2 @@ -7,7 +12,7 @@ } extract_desktop() { - perl ./scripts/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp + perl $SCRIPTY_DIR/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp dest=$3 msguniq --to-code=UTF-8 -o desktop.$$ desktop.$$.tmp 2>/dev/null if test -f desktop.$$; then @@ -24,9 +29,8 @@ rm -f desktop.$$ desktop.$$.tmp } -dir=`dirname $0` -. $dir/get_paths -releases="`list_modules $dir` l10n" +. $SCRIPTY_DIR/get_paths +releases="`list_modules $SCRIPTY_DIR` l10n" for mod in $releases l10n; do case "$mod" in Index: branches/stable/l10n-kf5-plasma-lts/scripts/createdoctemplates.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/createdoctemplates.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/createdoctemplates.sh @@ -5,6 +5,11 @@ LC_MESSAGES=C CDPATH= +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + hput () { key=`echo $1 | sed -e "s#/#_#g" | sed -e "s#\.#_#g"` eval hash"$key"='$2' @@ -23,7 +28,7 @@ check=no if test "$1" = "--check"; then - . scripts/find_meinproc + . $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` DOCBOOK_L10N_ALL="$BASEDIR/`get_path frameworks_kdoctools`/src/customization/xsl/all-l10n.xml" DOCBOOK_L10N_CUSTOM="$BASEDIR/`get_path frameworks_kdoctools`/src/customization/xsl/kde-custom-l10n.xml" @@ -43,12 +48,12 @@ if [ $# -eq 0 ]; then rm -rf documentation - bash ./scripts/populate_documentation.sh --silent + bash $SCRIPTY_DIR/populate_documentation.sh --silent populateresult=$? modules=`find documentation/ -maxdepth 1 -type d -follow -printf '%f\n' | grep -v svn | grep -v documentation` elif [ $# -eq 1 ]; then rm -rf documentation/$1 - bash ./scripts/populate_documentation.sh --silent $1 + bash $SCRIPTY_DIR/populate_documentation.sh --silent $1 populateresult=$? modules=$1 else @@ -111,7 +116,7 @@ test -n "$VERBOSE" && echo "Generating $j.pot has failed!" continue fi - splitstatus=`python ./scripts/msgsplit templates/docmessages/$m/$j.pot.new` + splitstatus=`python $SCRIPTY_DIR/msgsplit templates/docmessages/$m/$j.pot.new` if [ -n "$splitstatus" ]; then echo "Problem in msgsplit of templates/docmessages/$m/$j.pot.new" echo $splitstatus Index: branches/stable/l10n-kf5-plasma-lts/scripts/extract-tr-strings =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/extract-tr-strings +++ branches/stable/l10n-kf5-plasma-lts/scripts/extract-tr-strings @@ -3,7 +3,7 @@ OLD_PWD=$PWD cd $(dirname $0) -SCRIPTS_DIR=$PWD +SCRIPTY_DIR=$PWD cd $OLD_PWD LUPDATE=${LUPDATE:-lupdate} @@ -74,4 +74,4 @@ $LCONVERT $tmp_ts --sort-contexts --output-format pot -o $pot_file en_po_file=$enpodir/$(basename $pot_file .pot).po -$SCRIPTS_DIR/generate-en-po $src_files -o $en_po_file +$SCRIPTY_DIR/generate-en-po $src_files -o $en_po_file Index: branches/stable/l10n-kf5-plasma-lts/scripts/find_meinproc =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/find_meinproc +++ branches/stable/l10n-kf5-plasma-lts/scripts/find_meinproc @@ -1,6 +1,11 @@ -. scripts/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + function find_meinproc { MEINPROC_COMMAND="" Index: branches/stable/l10n-kf5-plasma-lts/scripts/findfiles =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/findfiles +++ branches/stable/l10n-kf5-plasma-lts/scripts/findfiles @@ -12,11 +12,16 @@ fi filelist=$1 -dir=`dirname $0` -. $dir/get_paths -ml="`list_modules $dir` l10n" +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + +ml="`list_modules $SCRIPTY_DIR` l10n" + rm -f "$filelist"_* $filelist : > $filelist Index: branches/stable/l10n-kf5-plasma-lts/scripts/handle_json_files.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/handle_json_files.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/handle_json_files.sh @@ -1,6 +1,11 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + get_prj_name() { local mod=$1 echo ${mod} | cut -d'_' -f2 @@ -9,7 +14,7 @@ extract_json() { arg1=$1; shift dest=$1; shift - python ./scripts/createjsoncontext.py "$@" "$arg1" > json.$$.tmp + python $SCRIPTY_DIR/createjsoncontext.py "$@" "$arg1" > json.$$.tmp msguniq --to-code=UTF-8 -o json.$$ json.$$.tmp 2>/dev/null if test -f json.$$; then if test ! -f "$dest"; then @@ -36,7 +41,7 @@ prj_name=$(get_prj_name "$mod") extract_json "$BASEDIR/$(get_path "$mod")" "templates/messages/${mod_po_path}/${prj_name}._json_.pot" $jsonfilelist for jsonfile in $jsonfilelist; do - python ./scripts/filljsonfrompo.py "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" + python $SCRIPTY_DIR/filljsonfrompo.py "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" done fi done Index: branches/stable/l10n-kf5-plasma-lts/scripts/merge_desktop_files.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/merge_desktop_files.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/merge_desktop_files.sh @@ -1,8 +1,13 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; -g++ -O2 -march=nocona -o apply scripts/applycontext.cpp +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +g++ -O2 -march=nocona -o apply $SCRIPTY_DIR/applycontext.cpp + langfile=`tempfile` KDEDIR=`tempfile` logfile=`tempfile` Index: branches/stable/l10n-kf5-plasma-lts/scripts/populate_documentation.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/populate_documentation.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/populate_documentation.sh @@ -31,11 +31,14 @@ return $res } -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + mkdir -p documentation cd documentation @@ -207,7 +210,7 @@ echo "There was an error updating the sources" exit 1 fi -done < "../scripts/documentation_paths" +done < "$SCRIPTY_DIR/documentation_paths" cd .. Index: branches/stable/l10n-kf5-plasma-lts/scripts/populate_source.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/populate_source.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/populate_source.sh @@ -34,13 +34,16 @@ # source/link// -> ../repo/. # and are most of the time the same, but not always. -script=$0 modules="$@" -scriptdir=`dirname $script` -. $scriptdir/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD -svnroot=`LC_ALL=C svn info $scriptdir | grep '^Repository Root:' | sed 's/^[^:]*: *//'` +. $SCRIPTY_DIR/get_paths + +svnroot=`LC_ALL=C svn info $SCRIPTY_DIR | grep '^Repository Root:' | sed 's/^[^:]*: *//'` if test -z "$svnroot"; then echo "ERROR: Cannot extract Subversion repository root." exit 1 @@ -78,7 +81,7 @@ if test -z "$modules"; then echo "===== Fetching module list..." - modules=`list_modules $scriptdir` + modules=`list_modules $SCRIPTY_DIR` if test $? != 0 || test -z "$modules"; then echo "ERROR: Cannot list modules." exit 1 Index: branches/stable/l10n-kf5-plasma-lts/scripts/posieve_check-tp-kde_results_to_webpage.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/posieve_check-tp-kde_results_to_webpage.sh +++ branches/stable/l10n-kf5-plasma-lts/scripts/posieve_check-tp-kde_results_to_webpage.sh @@ -2,11 +2,14 @@ # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + if test "$1" = "--posievepath"; then POSIEVEPATH=$2 fi Index: branches/stable/l10n-kf5-plasma-lts/scripts/update_translations =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/update_translations +++ branches/stable/l10n-kf5-plasma-lts/scripts/update_translations @@ -136,7 +136,7 @@ extractqml=$kdesdkscriptsdir/extractqml extractgrantlee=$kdesdkscriptsdir/grantlee_strings_extractor.py preparetips=$kconfigwidgetsdir/src/preparetips5 - repackpot=$BASEDIR/$transmod/scripts/repack-pot.pl + repackpot=$SCRIPTY_DIR/repack-pot.pl kdelibs= @@ -178,19 +178,19 @@ REPACKPOT="perl $repackpot" \ PACKAGE=$mod \ IGNORE=".$vcs" \ - bash $BASEDIR/$transmod/scripts/extract-messages.sh) + bash $SCRIPTY_DIR/extract-messages.sh) rm -f messages.log ( XGETTEXT=`which xgettext` \ SUBMODULE=$templatename \ - FILLXMLFROMPO="python $BASEDIR/$transmod/scripts/fillxmlfrompo.py" \ + FILLXMLFROMPO="python $SCRIPTY_DIR/fillxmlfrompo.py" \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract-xml.sh) + bash $SCRIPTY_DIR/extract-xml.sh) ( SUBMODULE=$templatename \ - ASMETAINFOITS=$BASEDIR/$transmod/scripts/as-metainfo.its \ + ASMETAINFOITS=$SCRIPTY_DIR/as-metainfo.its \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract_metainfo.sh) + bash $SCRIPTY_DIR/extract_metainfo.sh) ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ @@ -204,7 +204,7 @@ BASEDIR=$BASEDIR \ transmod=$transmod \ templatename=$templatename \ - bash $BASEDIR/$transmod/scripts/process-static-messages.sh) + bash $SCRIPTY_DIR/process-static-messages.sh) rm -f messages.log @@ -369,11 +369,11 @@ rm -f templatenames.tmp # Create the all_files_* files - bash scripts/findfiles `pwd`/all_files + bash $SCRIPTY_DIR/findfiles `pwd`/all_files echo "creating *._desktop_.pot files" test -z "$TIMING1" || date - bash scripts/create_desktop_files.sh + bash $SCRIPTY_DIR/create_desktop_files.sh echo "commiting *._desktop_.pot files" test -z "$TIMING1" || date @@ -397,7 +397,7 @@ echo "creating *._json_.pot files" test -z "$TIMING1" || date ( L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/handle_json_files.sh) + bash $SCRIPTY_DIR/handle_json_files.sh) echo "commiting *._json_.pot files" test -z "$TIMING1" || date if cd templates/messages; then @@ -432,7 +432,7 @@ [ ! -d $KDOCTOOLS_DATA_DIR ] && mkdir -p $KDOCTOOLS_DATA_DIR ln -s $kdoctoolsdir/src/customization $KDOCTOOLS_DATA_DIR export XDG_DATA_DIRS=$TMP_XDG_DIR:$XDG_DATA_DIRS - bash ./scripts/createdoctemplates.sh --commit --check --autosvnadd + bash $SCRIPTY_DIR/createdoctemplates.sh --commit --check --autosvnadd export XDG_DATA_DIRS=$OLD_XDG_DATA_DIRS rm -f $kdoctoolsdir/src/customization/dtd/kdedbx45.dtd \ $kdoctoolsdir/src/customization/kde-include-common.xsl \ @@ -457,7 +457,7 @@ echo echo "%% TRANSLATOR START $transmod" echo - bash scripts/merge_all.sh + bash $SCRIPTY_DIR/merge_all.sh echo echo "%% TRANSLATOR END $transmod" echo @@ -524,7 +524,7 @@ if cd $transmod; then echo "applying desktop file translations" test -z "$TIMING1" || date - bash scripts/merge_desktop_files.sh + bash $SCRIPTY_DIR/merge_desktop_files.sh cd $BASEDIR fi echo "commiting desktop files" @@ -585,11 +585,11 @@ echo "%% Updating x-test end" echo "%% Finding po without pot begin" - bash ./scripts/find_po_without_pot.sh --silent + bash $SCRIPTY_DIR/find_po_without_pot.sh --silent echo "%% Finding po without pot end" echo "%% Checking language docs are valid begin" - kdoctoolsdir=$kdoctoolsdir bash ./scripts/checkdocs.sh --optimized + kdoctoolsdir=$kdoctoolsdir bash $SCRIPTY_DIR/checkdocs.sh --optimized echo "%% Checking language docs are valid end" cd $BASEDIR @@ -599,14 +599,18 @@ test -z "$TIMING1" || date } +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + # releases: paths of modules - kdelibs has to be first # transmod: path of the corresponding l10n module # test only -dir=`dirname $0` -. $dir/get_paths +. $SCRIPTY_DIR/get_paths transmod=`get_path l10n` -releases=`list_modules $dir` +releases=`list_modules $SCRIPTY_DIR` kconfigwidgetsdir=$BASEDIR/`get_path frameworks_kconfigwidgets` kdoctoolsdir=$BASEDIR/`get_path frameworks_kdoctools` kdesdkscriptsdir=$BASEDIR/`get_path kdesdk_kde-dev-scripts` Index: branches/stable/l10n-kf5/scripts/check_po_files =================================================================== --- branches/stable/l10n-kf5/scripts/check_po_files +++ branches/stable/l10n-kf5/scripts/check_po_files @@ -5,6 +5,11 @@ # This script checks the PO files with the help of Gettext's msgfmt tool +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + copy_plural_header() { plural_master="$1" backup_path="$2" @@ -17,7 +22,7 @@ if test ! -f "$plural_master" ; then echo "Warning: Could not find file $plural_master to grab the plural formula from." else - find $find_args | xargs perl scripts/change-header.pl "$plural_master" + find $find_args | xargs perl $SCRIPTY_DIR/change-header.pl "$plural_master" fi } @@ -45,7 +50,7 @@ echo "*_qt.po files without X-Qt-Contexts: true" find `cat subdirs` -type f -name \*_qt.po -print | xargs grep -L "X-Qt-Contexts: true" - perl scripts/check_desktop_files + perl $SCRIPTY_DIR/check_desktop_files else echo "ERROR: could not find the subdirs file! (Wrong directory?)" fi Index: branches/stable/l10n-kf5/scripts/checkdocs.sh =================================================================== --- branches/stable/l10n-kf5/scripts/checkdocs.sh +++ branches/stable/l10n-kf5/scripts/checkdocs.sh @@ -1,8 +1,13 @@ #!/bin/bash +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + NTHREADS=4 -. scripts/find_meinproc +. $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 @@ -13,10 +18,8 @@ exit 1 fi -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit 1 -fi +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. if [ "x$DOOCBOOK_LOCATION" = "x" ]; then Index: branches/stable/l10n-kf5/scripts/create_desktop_files.sh =================================================================== --- branches/stable/l10n-kf5/scripts/create_desktop_files.sh +++ branches/stable/l10n-kf5/scripts/create_desktop_files.sh @@ -1,6 +1,11 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + get_prj_name() { local mod=$1 echo ${mod} | cut -d'_' -f2 @@ -7,7 +12,7 @@ } extract_desktop() { - perl ./scripts/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp + perl $SCRIPTY_DIR/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp dest=$3 msguniq --to-code=UTF-8 -o desktop.$$ desktop.$$.tmp 2>/dev/null if test -f desktop.$$; then @@ -24,9 +29,8 @@ rm -f desktop.$$ desktop.$$.tmp } -dir=`dirname $0` -. $dir/get_paths -releases="`list_modules $dir` l10n" +. $SCRIPTY_DIR/get_paths +releases="`list_modules $SCRIPTY_DIR` l10n" for mod in $releases l10n; do case "$mod" in Index: branches/stable/l10n-kf5/scripts/createdoctemplates.sh =================================================================== --- branches/stable/l10n-kf5/scripts/createdoctemplates.sh +++ branches/stable/l10n-kf5/scripts/createdoctemplates.sh @@ -5,6 +5,11 @@ LC_MESSAGES=C CDPATH= +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + hput () { key=`echo $1 | sed -e "s#/#_#g" | sed -e "s#\.#_#g"` eval hash"$key"='$2' @@ -23,7 +28,7 @@ check=no if test "$1" = "--check"; then - . scripts/find_meinproc + . $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` DOCBOOK_L10N_ALL="$BASEDIR/`get_path frameworks_kdoctools`/src/customization/xsl/all-l10n.xml" DOCBOOK_L10N_CUSTOM="$BASEDIR/`get_path frameworks_kdoctools`/src/customization/xsl/kde-custom-l10n.xml" @@ -43,12 +48,12 @@ if [ $# -eq 0 ]; then rm -rf documentation - bash ./scripts/populate_documentation.sh --silent + bash $SCRIPTY_DIR/populate_documentation.sh --silent populateresult=$? modules=`find documentation/ -maxdepth 1 -type d -follow -printf '%f\n' | grep -v svn | grep -v documentation` elif [ $# -eq 1 ]; then rm -rf documentation/$1 - bash ./scripts/populate_documentation.sh --silent $1 + bash $SCRIPTY_DIR/populate_documentation.sh --silent $1 populateresult=$? modules=$1 else @@ -111,7 +116,7 @@ test -n "$VERBOSE" && echo "Generating $j.pot has failed!" continue fi - splitstatus=`python ./scripts/msgsplit templates/docmessages/$m/$j.pot.new` + splitstatus=`python $SCRIPTY_DIR/msgsplit templates/docmessages/$m/$j.pot.new` if [ -n "$splitstatus" ]; then echo "Problem in msgsplit of templates/docmessages/$m/$j.pot.new" echo $splitstatus Index: branches/stable/l10n-kf5/scripts/extract-tr-strings =================================================================== --- branches/stable/l10n-kf5/scripts/extract-tr-strings +++ branches/stable/l10n-kf5/scripts/extract-tr-strings @@ -3,7 +3,7 @@ OLD_PWD=$PWD cd $(dirname $0) -SCRIPTS_DIR=$PWD +SCRIPTY_DIR=$PWD cd $OLD_PWD LUPDATE=${LUPDATE:-lupdate} @@ -74,4 +74,4 @@ $LCONVERT $tmp_ts --sort-contexts --output-format pot -o $pot_file en_po_file=$enpodir/$(basename $pot_file .pot).po -$SCRIPTS_DIR/generate-en-po $src_files -o $en_po_file +$SCRIPTY_DIR/generate-en-po $src_files -o $en_po_file Index: branches/stable/l10n-kf5/scripts/find_meinproc =================================================================== --- branches/stable/l10n-kf5/scripts/find_meinproc +++ branches/stable/l10n-kf5/scripts/find_meinproc @@ -1,6 +1,11 @@ -. scripts/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + function find_meinproc { MEINPROC_COMMAND="" Index: branches/stable/l10n-kf5/scripts/findfiles =================================================================== --- branches/stable/l10n-kf5/scripts/findfiles +++ branches/stable/l10n-kf5/scripts/findfiles @@ -12,11 +12,16 @@ fi filelist=$1 -dir=`dirname $0` -. $dir/get_paths -ml="`list_modules $dir` l10n" +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + +ml="`list_modules $SCRIPTY_DIR` l10n" + rm -f "$filelist"_* $filelist : > $filelist Index: branches/stable/l10n-kf5/scripts/handle_json_files.sh =================================================================== --- branches/stable/l10n-kf5/scripts/handle_json_files.sh +++ branches/stable/l10n-kf5/scripts/handle_json_files.sh @@ -1,6 +1,11 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + get_prj_name() { local mod=$1 echo ${mod} | cut -d'_' -f2 @@ -9,7 +14,7 @@ extract_json() { arg1=$1; shift dest=$1; shift - python ./scripts/createjsoncontext.py "$@" "$arg1" > json.$$.tmp + python $SCRIPTY_DIR/createjsoncontext.py "$@" "$arg1" > json.$$.tmp msguniq --to-code=UTF-8 -o json.$$ json.$$.tmp 2>/dev/null if test -f json.$$; then if test ! -f "$dest"; then @@ -36,7 +41,7 @@ prj_name=$(get_prj_name "$mod") extract_json "$BASEDIR/$(get_path "$mod")" "templates/messages/${mod_po_path}/${prj_name}._json_.pot" $jsonfilelist for jsonfile in $jsonfilelist; do - python ./scripts/filljsonfrompo.py "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" + python $SCRIPTY_DIR/filljsonfrompo.py "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" done fi done Index: branches/stable/l10n-kf5/scripts/merge_desktop_files.sh =================================================================== --- branches/stable/l10n-kf5/scripts/merge_desktop_files.sh +++ branches/stable/l10n-kf5/scripts/merge_desktop_files.sh @@ -1,8 +1,13 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; -g++ -O2 -march=nocona -o apply scripts/applycontext.cpp +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +g++ -O2 -march=nocona -o apply $SCRIPTY_DIR/applycontext.cpp + langfile=`tempfile` KDEDIR=`tempfile` logfile=`tempfile` Index: branches/stable/l10n-kf5/scripts/populate_documentation.sh =================================================================== --- branches/stable/l10n-kf5/scripts/populate_documentation.sh +++ branches/stable/l10n-kf5/scripts/populate_documentation.sh @@ -31,11 +31,14 @@ return $res } -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + mkdir -p documentation cd documentation @@ -207,7 +210,7 @@ echo "There was an error updating the sources" exit 1 fi -done < "../scripts/documentation_paths" +done < "$SCRIPTY_DIR/documentation_paths" cd .. Index: branches/stable/l10n-kf5/scripts/populate_source.sh =================================================================== --- branches/stable/l10n-kf5/scripts/populate_source.sh +++ branches/stable/l10n-kf5/scripts/populate_source.sh @@ -34,13 +34,16 @@ # source/link// -> ../repo/. # and are most of the time the same, but not always. -script=$0 modules="$@" -scriptdir=`dirname $script` -. $scriptdir/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD -svnroot=`LC_ALL=C svn info $scriptdir | grep '^Repository Root:' | sed 's/^[^:]*: *//'` +. $SCRIPTY_DIR/get_paths + +svnroot=`LC_ALL=C svn info $SCRIPTY_DIR | grep '^Repository Root:' | sed 's/^[^:]*: *//'` if test -z "$svnroot"; then echo "ERROR: Cannot extract Subversion repository root." exit 1 @@ -78,7 +81,7 @@ if test -z "$modules"; then echo "===== Fetching module list..." - modules=`list_modules $scriptdir` + modules=`list_modules $SCRIPTY_DIR` if test $? != 0 || test -z "$modules"; then echo "ERROR: Cannot list modules." exit 1 Index: branches/stable/l10n-kf5/scripts/posieve_check-tp-kde_results_to_webpage.sh =================================================================== --- branches/stable/l10n-kf5/scripts/posieve_check-tp-kde_results_to_webpage.sh +++ branches/stable/l10n-kf5/scripts/posieve_check-tp-kde_results_to_webpage.sh @@ -2,11 +2,14 @@ # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + if test "$1" = "--posievepath"; then POSIEVEPATH=$2 fi Index: branches/stable/l10n-kf5/scripts/update_translations =================================================================== --- branches/stable/l10n-kf5/scripts/update_translations +++ branches/stable/l10n-kf5/scripts/update_translations @@ -136,7 +136,7 @@ extractqml=$kdesdkscriptsdir/extractqml extractgrantlee=$kdesdkscriptsdir/grantlee_strings_extractor.py preparetips=$kconfigwidgetsdir/src/preparetips5 - repackpot=$BASEDIR/$transmod/scripts/repack-pot.pl + repackpot=$SCRIPTY_DIR/repack-pot.pl kdelibs= @@ -179,19 +179,19 @@ REPACKPOT="perl $repackpot" \ PACKAGE=$repo_name \ IGNORE=".$vcs" \ - bash $BASEDIR/$transmod/scripts/extract-messages.sh) + bash $SCRIPTY_DIR/extract-messages.sh) rm -f messages.log ( XGETTEXT=`which xgettext` \ SUBMODULE=$templatename \ - FILLXMLFROMPO="python $BASEDIR/$transmod/scripts/fillxmlfrompo.py" \ + FILLXMLFROMPO="python $SCRIPTY_DIR/fillxmlfrompo.py" \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract-xml.sh) + bash $SCRIPTY_DIR/extract-xml.sh) ( SUBMODULE=$templatename \ - ASMETAINFOITS=$BASEDIR/$transmod/scripts/as-metainfo.its \ + ASMETAINFOITS=$SCRIPTY_DIR/as-metainfo.its \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract_metainfo.sh) + bash $SCRIPTY_DIR/extract_metainfo.sh) ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ @@ -205,7 +205,7 @@ BASEDIR=$BASEDIR \ transmod=$transmod \ templatename=$templatename \ - bash $BASEDIR/$transmod/scripts/process-static-messages.sh) + bash $SCRIPTY_DIR/process-static-messages.sh) rm -f messages.log @@ -370,11 +370,11 @@ rm -f templatenames.tmp # Create the all_files_* files - bash scripts/findfiles `pwd`/all_files + bash $SCRIPTY_DIR/findfiles `pwd`/all_files echo "creating *._desktop_.pot files" test -z "$TIMING1" || date - bash scripts/create_desktop_files.sh + bash $SCRIPTY_DIR/create_desktop_files.sh echo "commiting *._desktop_.pot files" test -z "$TIMING1" || date @@ -398,7 +398,7 @@ echo "creating *._json_.pot files" test -z "$TIMING1" || date ( L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/handle_json_files.sh) + bash $SCRIPTY_DIR/handle_json_files.sh) echo "commiting *._json_.pot files" test -z "$TIMING1" || date if cd templates/messages; then @@ -433,7 +433,7 @@ [ ! -d $KDOCTOOLS_DATA_DIR ] && mkdir -p $KDOCTOOLS_DATA_DIR ln -s $kdoctoolsdir/src/customization $KDOCTOOLS_DATA_DIR export XDG_DATA_DIRS=$TMP_XDG_DIR:$XDG_DATA_DIRS - bash ./scripts/createdoctemplates.sh --commit --check --autosvnadd + bash $SCRIPTY_DIR/createdoctemplates.sh --commit --check --autosvnadd export XDG_DATA_DIRS=$OLD_XDG_DATA_DIRS rm -f $kdoctoolsdir/src/customization/dtd/kdedbx45.dtd \ $kdoctoolsdir/src/customization/kde-include-common.xsl \ @@ -458,7 +458,7 @@ echo echo "%% TRANSLATOR START $transmod" echo - bash scripts/merge_all.sh + bash $SCRIPTY_DIR/merge_all.sh echo echo "%% TRANSLATOR END $transmod" echo @@ -525,7 +525,7 @@ if cd $transmod; then echo "applying desktop file translations" test -z "$TIMING1" || date - bash scripts/merge_desktop_files.sh + bash $SCRIPTY_DIR/merge_desktop_files.sh cd $BASEDIR fi echo "commiting desktop files" @@ -586,11 +586,11 @@ echo "%% Updating x-test end" echo "%% Finding po without pot begin" - bash ./scripts/find_po_without_pot.sh --silent + bash $SCRIPTY_DIR/find_po_without_pot.sh --silent echo "%% Finding po without pot end" echo "%% Checking language docs are valid begin" - kdoctoolsdir=$kdoctoolsdir bash ./scripts/checkdocs.sh --optimized + kdoctoolsdir=$kdoctoolsdir bash $SCRIPTY_DIR/checkdocs.sh --optimized echo "%% Checking language docs are valid end" cd $BASEDIR @@ -600,14 +600,18 @@ test -z "$TIMING1" || date } +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + # releases: paths of modules - kdelibs has to be first # transmod: path of the corresponding l10n module # test only -dir=`dirname $0` -. $dir/get_paths +. $SCRIPTY_DIR/get_paths transmod=`get_path l10n` -releases=`list_modules $dir` +releases=`list_modules $SCRIPTY_DIR` kconfigwidgetsdir=$BASEDIR/`get_path frameworks_kconfigwidgets` kdoctoolsdir=$BASEDIR/`get_path frameworks_kdoctools` kdesdkscriptsdir=$BASEDIR/`get_path kdesdk_kde-dev-scripts` Index: trunk/l10n-kde4/scripts/check_po_files =================================================================== --- trunk/l10n-kde4/scripts/check_po_files +++ trunk/l10n-kde4/scripts/check_po_files @@ -5,12 +5,17 @@ # This script checks the PO files with the help of Gettext's msgfmt tool +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + if test -f subdirs; then for lang in `cat subdirs`; do # Note: we do not use 'cd' here, to allow msgfmt to generate errors and warnings with paths containing the language code if test -f $lang/messages/kdelibs/kdelibs4.po; then - find $lang -name *.po | xargs perl scripts/change-header.pl $lang/messages/kdelibs/kdelibs4.po + find $lang -name *.po | xargs perl $SCRIPTY_DIR/change-header.pl $lang/messages/kdelibs/kdelibs4.po fi # Check all PO files with Gettext's msgfmt @@ -25,7 +30,7 @@ fi done - perl scripts/check_desktop_files + perl $SCRIPTY_DIR/check_desktop_files else echo "ERROR: could not find the subdirs file! (Wrong directory?)" fi Index: trunk/l10n-kde4/scripts/checkdocs.sh =================================================================== --- trunk/l10n-kde4/scripts/checkdocs.sh +++ trunk/l10n-kde4/scripts/checkdocs.sh @@ -1,8 +1,13 @@ #!/bin/bash +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + NTHREADS=4 -. scripts/find_meinproc +. $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 @@ -13,10 +18,8 @@ exit 1 fi -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit 1 -fi +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. if [ "x$DOOCBOOK_LOCATION" = "x" ]; then Index: trunk/l10n-kde4/scripts/createdoctemplates.sh =================================================================== --- trunk/l10n-kde4/scripts/createdoctemplates.sh +++ trunk/l10n-kde4/scripts/createdoctemplates.sh @@ -5,6 +5,11 @@ LC_MESSAGES=C CDPATH= +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + hput () { key=`echo $1 | sed -e "s#/#_#g" | sed -e "s#\.#_#g"` eval hash"$key"='$2' @@ -23,7 +28,7 @@ check=no if test "$1" = "--check"; then - . scripts/find_meinproc + . $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` DOCBOOK_L10N_ALL="$BASEDIR/`get_path kdelibs`/kdoctools/customization/xsl/all-l10n.xml" DOCBOOK_L10N_CUSTOM="$BASEDIR/`get_path kdelibs`/kdoctools/customization/xsl/kde-custom-l10n.xml" @@ -43,12 +48,12 @@ if [ $# -eq 0 ]; then rm -rf documentation - bash ./scripts/populate_documentation.sh --silent + bash $SCRIPTY_DIR/populate_documentation.sh --silent populateresult=$? modules=`find documentation/ -maxdepth 1 -type d -follow -printf '%f\n' | grep -v svn | grep -v documentation` elif [ $# -eq 1 ]; then rm -rf documentation/$1 - bash ./scripts/populate_documentation.sh --silent $1 + bash $SCRIPTY_DIR/populate_documentation.sh --silent $1 populateresult=$? modules=$1 else @@ -111,7 +116,7 @@ test -n "$VERBOSE" && echo "Generating $j.pot has failed!" continue fi - splitstatus=`python ./scripts/msgsplit templates/docmessages/$m/$j.pot.new` + splitstatus=`python $SCRIPTY_DIR/msgsplit templates/docmessages/$m/$j.pot.new` if [ -n "$splitstatus" ]; then echo "Problem in msgsplit of templates/docmessages/$m/$j.pot.new" echo $splitstatus Index: trunk/l10n-kde4/scripts/find_meinproc =================================================================== --- trunk/l10n-kde4/scripts/find_meinproc +++ trunk/l10n-kde4/scripts/find_meinproc @@ -1,6 +1,11 @@ -. scripts/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + function find_meinproc { MEINPROC_COMMAND="" Index: trunk/l10n-kde4/scripts/findfiles =================================================================== --- trunk/l10n-kde4/scripts/findfiles +++ trunk/l10n-kde4/scripts/findfiles @@ -12,11 +12,16 @@ fi filelist=$1 -dir=`dirname $0` -. $dir/get_paths -ml="`list_modules $dir` l10n" +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + +ml="`list_modules $SCRIPTY_DIR` l10n" + rm -f "$filelist"_* $filelist : > $filelist Index: trunk/l10n-kde4/scripts/merge_desktop_files.sh =================================================================== --- trunk/l10n-kde4/scripts/merge_desktop_files.sh +++ trunk/l10n-kde4/scripts/merge_desktop_files.sh @@ -1,8 +1,13 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; -g++ -O2 -march=nocona -o apply scripts/applycontext.cpp +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +g++ -O2 -march=nocona -o apply $SCRIPTY_DIR/applycontext.cpp + langfile=`tempfile` KDEDIR=`tempfile` logfile=`tempfile` Index: trunk/l10n-kde4/scripts/populate_documentation.sh =================================================================== --- trunk/l10n-kde4/scripts/populate_documentation.sh +++ trunk/l10n-kde4/scripts/populate_documentation.sh @@ -31,11 +31,14 @@ return $res } -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + mkdir -p documentation cd documentation @@ -207,7 +210,7 @@ echo "There was an error updating the sources" exit 1 fi -done < "../scripts/documentation_paths" +done < "$SCRIPTY_DIR/documentation_paths" cd .. Index: trunk/l10n-kde4/scripts/populate_source.sh =================================================================== --- trunk/l10n-kde4/scripts/populate_source.sh +++ trunk/l10n-kde4/scripts/populate_source.sh @@ -34,13 +34,16 @@ # source/link// -> ../repo/. # and are most of the time the same, but not always. -script=$0 modules="$@" -scriptdir=`dirname $script` -. $scriptdir/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD -svnroot=`LC_ALL=C svn info $scriptdir | grep '^Repository Root:' | sed 's/^[^:]*: *//'` +. $SCRIPTY_DIR/get_paths + +svnroot=`LC_ALL=C svn info $SCRIPTY_DIR | grep '^Repository Root:' | sed 's/^[^:]*: *//'` if test -z "$svnroot"; then echo "ERROR: Cannot extract Subversion repository root." exit 1 @@ -78,7 +81,7 @@ if test -z "$modules"; then echo "===== Fetching module list..." - modules=`list_modules $scriptdir` + modules=`list_modules $SCRIPTY_DIR` if test $? != 0 || test -z "$modules"; then echo "ERROR: Cannot list modules." exit 1 Index: trunk/l10n-kde4/scripts/posieve_check-tp-kde_results_to_webpage.sh =================================================================== --- trunk/l10n-kde4/scripts/posieve_check-tp-kde_results_to_webpage.sh +++ trunk/l10n-kde4/scripts/posieve_check-tp-kde_results_to_webpage.sh @@ -2,11 +2,14 @@ # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + if test "$1" = "--posievepath"; then POSIEVEPATH=$2 fi Index: trunk/l10n-kde4/scripts/update_translations =================================================================== --- trunk/l10n-kde4/scripts/update_translations +++ trunk/l10n-kde4/scripts/update_translations @@ -10,7 +10,7 @@ umask 022 extract_desktop() { - perl ./scripts/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp + perl $SCRIPTY_DIR/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp dest=$3 msguniq --to-code=UTF-8 -o desktop.$$ desktop.$$.tmp 2>/dev/null if test -f desktop.$$; then @@ -158,7 +158,7 @@ extractqml=$kdesdkscriptsdir/extractqml extractgrantlee=$kdesdkscriptsdir/grantlee_strings_extractor.py preparetips=$kdelibsdir/kdeui/preparetips - repackpot=$BASEDIR/$transmod/scripts/repack-pot.pl + repackpot=$SCRIPTY_DIR/repack-pot.pl kdelibs= @@ -200,19 +200,19 @@ REPACKPOT="perl $repackpot" \ PACKAGE=$mod \ IGNORE=".$vcs" \ - bash $BASEDIR/$transmod/scripts/extract-messages.sh) + bash $SCRIPTY_DIR/extract-messages.sh) rm -f messages.log ( XGETTEXT=`which xgettext` \ SUBMODULE=$templatename \ - FILLXMLFROMPO="python $BASEDIR/$transmod/scripts/fillxmlfrompo.py" \ + FILLXMLFROMPO="python $SCRIPTY_DIR/fillxmlfrompo.py" \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract-xml.sh) + bash $SCRIPTY_DIR/extract-xml.sh) ( SUBMODULE=$templatename \ - ASMETAINFOITS=$BASEDIR/$transmod/scripts/as-metainfo.its \ + ASMETAINFOITS=$SCRIPTY_DIR/as-metainfo.its \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract_metainfo.sh) + bash $SCRIPTY_DIR/extract_metainfo.sh) ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ @@ -226,7 +226,7 @@ BASEDIR=$BASEDIR \ transmod=$transmod \ templatename=$templatename \ - bash $BASEDIR/$transmod/scripts/process-static-messages.sh) + bash $SCRIPTY_DIR/process-static-messages.sh) rm -f messages.log @@ -347,7 +347,7 @@ test -z "$VERBOSE1" || echo "creating *._desktop_.pot files" test -z "$TIMING1" || date - bash scripts/findfiles `pwd`/all_files + bash $SCRIPTY_DIR/findfiles `pwd`/all_files for mod in $releases l10n; do case "$mod" in @@ -400,7 +400,7 @@ sed s#@DOCBOOKXSL_DIR@#$DOCBOOKXSL_LOCATION#g $kdelibsdir/kdoctools/customization/kde-include-man.xsl.cmake > $kdelibsdir/kdoctools/customization/kde-include-man.xsl docbookl10nhelper $DOCBOOKXSL_LOCATION $kdelibsdir/kdoctools/customization/xsl/ $kdelibsdir/kdoctools/customization/xsl/ - kdelibsdir=$kdelibsdir bash ./scripts/createdoctemplates.sh --commit --check --autosvnadd + kdelibsdir=$kdelibsdir bash $SCRIPTY_DIR/createdoctemplates.sh --commit --check --autosvnadd rm -f $kdelibsdir/kdoctools/customization/dtd/kdex.dtd \ $kdelibsdir/kdoctools/customization/kde-include-common.xsl \ $kdelibsdir/kdoctools/customization/kde-include-man.xsl \ @@ -424,7 +424,7 @@ echo echo "%% TRANSLATOR START $transmod" echo - bash scripts/merge_all.sh + bash $SCRIPTY_DIR/merge_all.sh echo echo "%% TRANSLATOR END $transmod" echo @@ -491,7 +491,7 @@ if cd $transmod; then test -z "$VERBOSE1" || echo "applying desktop file translations" test -z "$TIMING1" || date - bash scripts/merge_desktop_files.sh + bash $SCRIPTY_DIR/merge_desktop_files.sh cd $BASEDIR fi test -z "$VERBOSE1" || echo "commiting desktop files" @@ -552,11 +552,11 @@ echo "%% Updating x-test end" echo "%% Finding po without pot begin" - bash ./scripts/find_po_without_pot.sh --silent + bash $SCRIPTY_DIR/find_po_without_pot.sh --silent echo "%% Finding po without pot end" echo "%% Checking language docs are valid begin" - kdelibsdir=$kdelibsdir bash ./scripts/checkdocs.sh --optimized + kdelibsdir=$kdelibsdir bash $SCRIPTY_DIR/checkdocs.sh --optimized echo "%% Checking language docs are valid end" cd $BASEDIR @@ -566,14 +566,18 @@ test -z "$TIMING1" || date } +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + # releases: paths of modules - kdelibs has to be first # transmod: path of the corresponding l10n module # test only -dir=`dirname $0` -. $dir/get_paths +. $SCRIPTY_DIR/get_paths transmod=`get_path l10n` -releases=`list_modules $dir` +releases=`list_modules $SCRIPTY_DIR` kdelibsdir=$BASEDIR/git-stable/kdelibs/ kdesdkscriptsdir=$BASEDIR/`get_path kdesdk_kde-dev-scripts` update_translations Index: trunk/l10n-kf5/scripts/check_po_files =================================================================== --- trunk/l10n-kf5/scripts/check_po_files +++ trunk/l10n-kf5/scripts/check_po_files @@ -5,6 +5,11 @@ # This script checks the PO files with the help of Gettext's msgfmt tool +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + copy_plural_header() { plural_master="$1" backup_path="$2" @@ -17,7 +22,7 @@ if test ! -f "$plural_master" ; then echo "Warning: Could not find file $plural_master to grab the plural formula from." else - find $find_args | xargs perl scripts/change-header.pl "$plural_master" + find $find_args | xargs perl $SCRIPTY_DIR/change-header.pl "$plural_master" fi } @@ -45,7 +50,7 @@ echo "*_qt.po files without X-Qt-Contexts: true" find `cat subdirs` -type f -name \*_qt.po -print | xargs grep -L "X-Qt-Contexts: true" - perl scripts/check_desktop_files + perl $SCRIPTY_DIR/check_desktop_files else echo "ERROR: could not find the subdirs file! (Wrong directory?)" fi Index: trunk/l10n-kf5/scripts/checkdocs.sh =================================================================== --- trunk/l10n-kf5/scripts/checkdocs.sh +++ trunk/l10n-kf5/scripts/checkdocs.sh @@ -1,8 +1,13 @@ #!/bin/bash +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + NTHREADS=4 -. scripts/find_meinproc +. $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 @@ -13,10 +18,8 @@ exit 1 fi -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit 1 -fi +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. if [ "x$DOOCBOOK_LOCATION" = "x" ]; then Index: trunk/l10n-kf5/scripts/create_desktop_files.sh =================================================================== --- trunk/l10n-kf5/scripts/create_desktop_files.sh +++ trunk/l10n-kf5/scripts/create_desktop_files.sh @@ -1,6 +1,11 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + get_prj_name() { local mod=$1 echo ${mod} | cut -d'_' -f2 @@ -7,7 +12,7 @@ } extract_desktop() { - perl ./scripts/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp + perl $SCRIPTY_DIR/createdesktopcontext.pl --file-list=./$1 --base-dir=$2 > desktop.$$.tmp dest=$3 msguniq --to-code=UTF-8 -o desktop.$$ desktop.$$.tmp 2>/dev/null if test -f desktop.$$; then @@ -24,9 +29,8 @@ rm -f desktop.$$ desktop.$$.tmp } -dir=`dirname $0` -. $dir/get_paths -releases="`list_modules $dir` l10n" +. $SCRIPTY_DIR/get_paths +releases="`list_modules $SCRIPTY_DIR` l10n" for mod in $releases l10n; do case "$mod" in Index: trunk/l10n-kf5/scripts/createdoctemplates.sh =================================================================== --- trunk/l10n-kf5/scripts/createdoctemplates.sh +++ trunk/l10n-kf5/scripts/createdoctemplates.sh @@ -5,6 +5,11 @@ LC_MESSAGES=C CDPATH= +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + hput () { key=`echo $1 | sed -e "s#/#_#g" | sed -e "s#\.#_#g"` eval hash"$key"='$2' @@ -23,7 +28,7 @@ check=no if test "$1" = "--check"; then - . scripts/find_meinproc + . $SCRIPTY_DIR/find_meinproc MEINPROC_COMMAND=`find_meinproc` DOCBOOK_L10N_ALL="$BASEDIR/`get_path frameworks_kdoctools`/src/customization/xsl/all-l10n.xml" DOCBOOK_L10N_CUSTOM="$BASEDIR/`get_path frameworks_kdoctools`/src/customization/xsl/kde-custom-l10n.xml" @@ -43,12 +48,12 @@ if [ $# -eq 0 ]; then rm -rf documentation - bash ./scripts/populate_documentation.sh --silent + bash $SCRIPTY_DIR/populate_documentation.sh --silent populateresult=$? modules=`find documentation/ -maxdepth 1 -type d -follow -printf '%f\n' | grep -v svn | grep -v documentation` elif [ $# -eq 1 ]; then rm -rf documentation/$1 - bash ./scripts/populate_documentation.sh --silent $1 + bash $SCRIPTY_DIR/populate_documentation.sh --silent $1 populateresult=$? modules=$1 else @@ -111,7 +116,7 @@ test -n "$VERBOSE" && echo "Generating $j.pot has failed!" continue fi - splitstatus=`python ./scripts/msgsplit templates/docmessages/$m/$j.pot.new` + splitstatus=`python $SCRIPTY_DIR/msgsplit templates/docmessages/$m/$j.pot.new` if [ -n "$splitstatus" ]; then echo "Problem in msgsplit of templates/docmessages/$m/$j.pot.new" echo $splitstatus Index: trunk/l10n-kf5/scripts/extract-tr-strings =================================================================== --- trunk/l10n-kf5/scripts/extract-tr-strings +++ trunk/l10n-kf5/scripts/extract-tr-strings @@ -3,7 +3,7 @@ OLD_PWD=$PWD cd $(dirname $0) -SCRIPTS_DIR=$PWD +SCRIPTY_DIR=$PWD cd $OLD_PWD LUPDATE=${LUPDATE:-lupdate} @@ -74,4 +74,4 @@ $LCONVERT $tmp_ts --sort-contexts --output-format pot -o $pot_file en_po_file=$enpodir/$(basename $pot_file .pot).po -$SCRIPTS_DIR/generate-en-po $src_files -o $en_po_file +$SCRIPTY_DIR/generate-en-po $src_files -o $en_po_file Index: trunk/l10n-kf5/scripts/find_meinproc =================================================================== --- trunk/l10n-kf5/scripts/find_meinproc +++ trunk/l10n-kf5/scripts/find_meinproc @@ -1,6 +1,11 @@ -. scripts/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + function find_meinproc { MEINPROC_COMMAND="" Index: trunk/l10n-kf5/scripts/findfiles =================================================================== --- trunk/l10n-kf5/scripts/findfiles +++ trunk/l10n-kf5/scripts/findfiles @@ -12,11 +12,16 @@ fi filelist=$1 -dir=`dirname $0` -. $dir/get_paths -ml="`list_modules $dir` l10n" +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +. $SCRIPTY_DIR/get_paths + +ml="`list_modules $SCRIPTY_DIR` l10n" + rm -f "$filelist"_* $filelist : > $filelist Index: trunk/l10n-kf5/scripts/handle_json_files.sh =================================================================== --- trunk/l10n-kf5/scripts/handle_json_files.sh +++ trunk/l10n-kf5/scripts/handle_json_files.sh @@ -1,6 +1,11 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + get_prj_name() { local mod=$1 echo ${mod} | cut -d'_' -f2 @@ -9,7 +14,7 @@ extract_json() { arg1=$1; shift dest=$1; shift - python ./scripts/createjsoncontext.py "$@" "$arg1" > json.$$.tmp + python $SCRIPTY_DIR/createjsoncontext.py "$@" "$arg1" > json.$$.tmp msguniq --to-code=UTF-8 -o json.$$ json.$$.tmp 2>/dev/null if test -f json.$$; then if test ! -f "$dest"; then @@ -39,7 +44,7 @@ extract_json $repo_dir "templates/messages/${mod_po_path}/${prj_name}._json_.pot" $jsonfilelist for jsonfile in $jsonfilelist; do - python ./scripts/filljsonfrompo.py $repo_dir "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" + python $SCRIPTY_DIR/filljsonfrompo.py $repo_dir "$jsonfile" "$L10NDIR" "${mod_po_path}" "${prj_name}._json_.po" done fi done Index: trunk/l10n-kf5/scripts/merge_desktop_files.sh =================================================================== --- trunk/l10n-kf5/scripts/merge_desktop_files.sh +++ trunk/l10n-kf5/scripts/merge_desktop_files.sh @@ -1,8 +1,13 @@ #! /bin/bash # kate: space-indent on; indent-width 2; replace-tabs on; -g++ -O2 -march=nocona -o apply scripts/applycontext.cpp +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +g++ -O2 -march=nocona -o apply $SCRIPTY_DIR/applycontext.cpp + langfile=`tempfile` KDEDIR=`tempfile` logfile=`tempfile` Index: trunk/l10n-kf5/scripts/populate_documentation.sh =================================================================== --- trunk/l10n-kf5/scripts/populate_documentation.sh +++ trunk/l10n-kf5/scripts/populate_documentation.sh @@ -31,11 +31,14 @@ return $res } -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + mkdir -p documentation cd documentation @@ -207,7 +210,7 @@ echo "There was an error updating the sources" exit 1 fi -done < "../scripts/documentation_paths" +done < "$SCRIPTY_DIR/documentation_paths" cd .. Index: trunk/l10n-kf5/scripts/populate_source.sh =================================================================== --- trunk/l10n-kf5/scripts/populate_source.sh +++ trunk/l10n-kf5/scripts/populate_source.sh @@ -34,13 +34,16 @@ # source/link// -> ../repo/. # and are most of the time the same, but not always. -script=$0 modules="$@" -scriptdir=`dirname $script` -. $scriptdir/get_paths +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD -svnroot=`LC_ALL=C svn info $scriptdir | grep '^Repository Root:' | sed 's/^[^:]*: *//'` +. $SCRIPTY_DIR/get_paths + +svnroot=`LC_ALL=C svn info $SCRIPTY_DIR | grep '^Repository Root:' | sed 's/^[^:]*: *//'` if test -z "$svnroot"; then echo "ERROR: Cannot extract Subversion repository root." exit 1 @@ -78,7 +81,7 @@ if test -z "$modules"; then echo "===== Fetching module list..." - modules=`list_modules $scriptdir` + modules=`list_modules $SCRIPTY_DIR` if test $? != 0 || test -z "$modules"; then echo "ERROR: Cannot list modules." exit 1 Index: trunk/l10n-kf5/scripts/posieve_check-tp-kde_results_to_webpage.sh =================================================================== --- trunk/l10n-kf5/scripts/posieve_check-tp-kde_results_to_webpage.sh +++ trunk/l10n-kf5/scripts/posieve_check-tp-kde_results_to_webpage.sh @@ -2,11 +2,14 @@ # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ -if [ ! -d scripts ]; then - echo "You have to run the script from the parent directory of scripts/" - exit -fi +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD +# Work in the parent directory of scripts/ +cd $SCRIPTY_DIR/.. + if test "$1" = "--posievepath"; then POSIEVEPATH=$2 fi Index: trunk/l10n-kf5/scripts/update_translations =================================================================== --- trunk/l10n-kf5/scripts/update_translations +++ trunk/l10n-kf5/scripts/update_translations @@ -131,7 +131,7 @@ extractattr=$kdesdkscriptsdir/extractattr extractgrantlee=$kdesdkscriptsdir/grantlee_strings_extractor.py preparetips=$kconfigwidgetsdir/src/preparetips5 - repackpot=$BASEDIR/$transmod/scripts/repack-pot.pl + repackpot=$SCRIPTY_DIR/repack-pot.pl for logmod in $releases; do @@ -171,19 +171,19 @@ REPACKPOT="perl $repackpot" \ PACKAGE=$repo_name \ IGNORE=".$vcs" \ - bash $BASEDIR/$transmod/scripts/extract-messages.sh) + bash $SCRIPTY_DIR/extract-messages.sh) rm -f messages.log ( XGETTEXT=`which xgettext` \ SUBMODULE=$templatename \ - FILLXMLFROMPO="python $BASEDIR/$transmod/scripts/fillxmlfrompo.py" \ + FILLXMLFROMPO="python $SCRIPTY_DIR/fillxmlfrompo.py" \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract-xml.sh) + bash $SCRIPTY_DIR/extract-xml.sh) ( SUBMODULE=$templatename \ - ASMETAINFOITS=$BASEDIR/$transmod/scripts/as-metainfo.its \ + ASMETAINFOITS=$SCRIPTY_DIR/as-metainfo.its \ L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/extract_metainfo.sh) + bash $SCRIPTY_DIR/extract_metainfo.sh) ( XGETTEXT=`which xgettext` \ MSGCAT=`which msgcat` \ @@ -197,7 +197,7 @@ BASEDIR=$BASEDIR \ transmod=$transmod \ templatename=$templatename \ - bash $BASEDIR/$transmod/scripts/process-static-messages.sh) + bash $SCRIPTY_DIR/process-static-messages.sh) rm -f messages.log @@ -362,11 +362,11 @@ rm -f templatenames.tmp # Create the all_files_* files - bash scripts/findfiles `pwd`/all_files + bash $SCRIPTY_DIR/findfiles `pwd`/all_files echo "creating *._desktop_.pot files" test -z "$TIMING1" || date - bash scripts/create_desktop_files.sh + bash $SCRIPTY_DIR/create_desktop_files.sh echo "commiting *._desktop_.pot files" test -z "$TIMING1" || date @@ -390,7 +390,7 @@ echo "creating *._json_.pot files" test -z "$TIMING1" || date ( L10NDIR=$BASEDIR/$transmod \ - bash $BASEDIR/$transmod/scripts/handle_json_files.sh) + bash $SCRIPTY_DIR/handle_json_files.sh) echo "commiting *._json_.pot files" test -z "$TIMING1" || date if cd templates/messages; then @@ -425,7 +425,7 @@ [ ! -d $KDOCTOOLS_DATA_DIR ] && mkdir -p $KDOCTOOLS_DATA_DIR ln -s $kdoctoolsdir/src/customization $KDOCTOOLS_DATA_DIR export XDG_DATA_DIRS=$TMP_XDG_DIR:$XDG_DATA_DIRS - bash ./scripts/createdoctemplates.sh --commit --check --autosvnadd + bash $SCRIPTY_DIR/createdoctemplates.sh --commit --check --autosvnadd export XDG_DATA_DIRS=$OLD_XDG_DATA_DIRS rm -f $kdoctoolsdir/src/customization/dtd/kdedbx45.dtd \ $kdoctoolsdir/src/customization/kde-include-common.xsl \ @@ -450,7 +450,7 @@ echo echo "%% TRANSLATOR START $transmod" echo - bash scripts/merge_all.sh + bash $SCRIPTY_DIR/merge_all.sh echo echo "%% TRANSLATOR END $transmod" echo @@ -517,7 +517,7 @@ if cd $transmod; then echo "applying desktop file translations" test -z "$TIMING1" || date - bash scripts/merge_desktop_files.sh + bash $SCRIPTY_DIR/merge_desktop_files.sh cd $BASEDIR fi echo "commiting desktop files" @@ -578,11 +578,11 @@ echo "%% Updating x-test end" echo "%% Finding po without pot begin" - bash ./scripts/find_po_without_pot.sh --silent + bash $SCRIPTY_DIR/find_po_without_pot.sh --silent echo "%% Finding po without pot end" echo "%% Checking language docs are valid begin" - kdoctoolsdir=$kdoctoolsdir bash ./scripts/checkdocs.sh --optimized + kdoctoolsdir=$kdoctoolsdir bash $SCRIPTY_DIR/checkdocs.sh --optimized echo "%% Checking language docs are valid end" echo "%% Generating i18n for www begin" @@ -605,7 +605,7 @@ for subdir in `ls $webi18ndir`; do file=$BASEDIR/$transmod/$subdir/messages/www/$web"_www.po" if [ -e $file ]; then - PYTHONPATH=$POLOGYDIR python $BASEDIR/$transmod/scripts/po2phparray.py $file $webi18ndir/$subdir/$web.inc + PYTHONPATH=$POLOGYDIR python $SCRIPTY_DIR/po2phparray.py $file $webi18ndir/$subdir/$web.inc git add $webi18ndir/$subdir/$web.inc else echo "$subdir in $web exists but $file does not" @@ -621,7 +621,7 @@ for subdir in `ls $webi18ndir`; do file=$BASEDIR/$transmod/$subdir/messages/www/$web"_www.po" if [ -e $file ]; then - PYTHONPATH=$POLOGYDIR python $BASEDIR/$transmod/scripts/po2phparray.py $file $webi18ndir/$subdir/$web.inc + PYTHONPATH=$POLOGYDIR python $SCRIPTY_DIR/po2phparray.py $file $webi18ndir/$subdir/$web.inc else echo "$subdir in $web exists but $file does not" fi @@ -633,7 +633,7 @@ echo "%% Generating announcements/release_data.php begin" webdir=$BASEDIR/`get_path www-www` - python ./scripts/generate_release_data.py -a $webdir/announcements/ -t . -s + python $SCRIPTY_DIR/generate_release_data.py -a $webdir/announcements/ -t . -s svn commit $SVNQUIETFLAG $webdir/announcements/ -m "SVN_SILENT regenerate from .po" echo "%% Generating announcements/release_data.php end" @@ -644,14 +644,18 @@ test -z "$TIMING1" || date } +OLD_PWD=$PWD +cd $(dirname $0) +SCRIPTY_DIR=$PWD +cd $OLD_PWD + # releases: paths of modules - kdelibs has to be first # transmod: path of the corresponding l10n module # test only -dir=`dirname $0` -. $dir/get_paths +. $SCRIPTY_DIR/get_paths transmod=`get_path l10n` -releases=`list_modules $dir` +releases=`list_modules $SCRIPTY_DIR` kconfigwidgetsdir=$BASEDIR/`get_path frameworks_kconfigwidgets` kdoctoolsdir=$BASEDIR/`get_path frameworks_kdoctools` kdesdkscriptsdir=$BASEDIR/`get_path kdesdk_kde-dev-scripts`