Index: branches/stable/l10n-kde4/scripts/get_paths =================================================================== --- branches/stable/l10n-kde4/scripts/get_paths (revision 1572395) +++ branches/stable/l10n-kde4/scripts/get_paths (revision 1572396) @@ -1,93 +1,109 @@ KDE_PROJECTS_API_URL="https://projects.kde.org/api/v1" I18N_BRANCH='stable' +function check_kde_projects_requirements +{ + local programs_required="curl jq" + for program_checked in ${programs_required}; do + ${program_checked} --help &>/dev/null + if [ $? -ne 0 ]; then + printf "\'${program_checked}\' is required but it was not found\n" 1>&2 + exit 1 + fi + done +} + function list_modules { + check_kde_projects_requirements + # --retry 5 is a safeguard local all_modules=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifiers?active=true | jq -r '.[]' 2>/dev/null) if [ $? -ne 0 ]; then all_modules="" fi modules="" # most of the code which follows should and wll be replaced # by proper filtering on the API side for M in ${all_modules}; do local project_details=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/${M} 2>/dev/null) local found_repo=$(echo "${project_details}" | jq -r '.repo' 2>/dev/null) [[ "${found_repo}" =~ (unmaintained|historical|sysadmin)/ ]] && continue local found_branch=$(echo "${project_details}" | jq -r ".i18n.${I18N_BRANCH}" 2>/dev/null) expected_branch=$(get_branch ${M}) if [ -z "${expected_branch}" ] || [ "${expected_branch}" = "get_branch_none" ]; then expected_branch="none" fi if [ "${found_branch}" != "${expected_branch}" ]; then printf "Warning: '%s' has different branches in get_paths (%s) than in XML file (%s)\n" ${M} ${expected_branch} ${found_branch} >&2 fi if [ "${expected_branch}" != "none" ]; then modules="${modules} ${M}" fi done echo $modules } function get_path { case "$1" in l10n) echo branches/stable/l10n-kde4 ;; *) echo git-stable/$1 ;; esac } function get_po_path { echo $1 } function get_vcs { case "$1" in l10n) echo svn ;; *) echo git ;; esac } function get_branch { case "$1" in kmymoney) echo "4.8" ;; kde-dev-scripts|kdelibs) echo "KDE/4.14" ;; *) echo "get_branch_none" exit 1 ;; esac } function get_url { + check_kde_projects_requirements + repo_full_path=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/$1 | jq -r '.repo' 2>/dev/null) res=$? if [ ${res} -eq 0 ] && [ -n "${repo_full_path}" ]; then echo "kde:${repo_full_path}.git" else echo "ERROR: url not found for $1" exit 1 fi } Index: branches/stable/l10n-kde4/scripts/populate_documentation.sh =================================================================== --- branches/stable/l10n-kde4/scripts/populate_documentation.sh (revision 1572395) +++ branches/stable/l10n-kde4/scripts/populate_documentation.sh (revision 1572396) @@ -1,132 +1,133 @@ #!/bin/bash # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ function git_download { if [ -z "$3" ]; then oldmd5=$4 newmd5=`mktemp` fi timeout 1h git archive --remote=$1 $2 | tar -x res=$? if [ $res -ne 0 ]; then echo "Failed to download $1 $2" fi if [ -z "$3" ]; then hashdeep -rl . > $newmd5 if [ -n "$oldmd5" ]; then differences=`diff -ub $oldmd5 $newmd5 | grep ^[+-] | grep -v ^+++ | grep -v ^--- | cut -d " " -f 3 | uniq` else differences=`ls` fi if [ -z "$differences" ]; then echo "No differences" else echo "New/changed/removed files:" echo $differences fi rm -f $oldmd5 $newmd5 fi return $res } if [ ! -d scripts ]; then echo "You have to run the script from the parent directory of scripts/" exit fi dir=`dirname $0` . $dir/get_paths +check_kde_projects_requirements mkdir -p documentation cd documentation onlyonemodule="" sawentry=0 lastupdate=0 silentflag="" if test "$1" = "--silent"; then silentflag="-q" shift fi if [ -n "$1" ]; then onlyonemodule=$1 fi while read line; do if [ -z "$line" ]; then continue fi if [[ $line = \#* ]]; then continue fi IFS=' ' read -ra tokens <<< $line ntokens=${#tokens[@]} if [ $ntokens -lt 2 ]; then echo "The number of tokens is not valid - $line" else if [ "${tokens[0]}" = "entry" ]; then if [ $ntokens -lt 3 ] || [ $ntokens -gt 4 ]; then echo "The number of tokens (${ntokens}) is not valid - ${line}" else doc_dir="" if [ $ntokens -eq 4 ]; then doc_dir="${tokens[3]}" fi entry_dir="${tokens[1]}" module_name="${tokens[2]}" if [ -n "${onlyonemodule}" ] && [ "${onlyonemodule}" != "${module_name}" ]; then # if a specific module is requested, only update it continue fi module_branch="$(get_branch ${module_name})" if [ "${module_branch}" = "get_branch_none" ]; then echo "Unknown branch for ${module_name}/${entry_dir}" else if [ -z "$silentflag" ]; then echo "Updating ${module_name}/${entry_dir} documentation (${module_branch})" fi savepwd=$PWD mkdir -p ${module_name} cd ${module_name} oldmd5="" if [ -d ${entry_dir} ]; then if [ -z "$silentflag" ]; then oldmd5=`mktemp` ( cd ${entry_dir} hashdeep -rl . > $oldmd5 ) fi rm -rf ${entry_dir} fi mkdir -p ${entry_dir} cd ${entry_dir} repo_url="$(get_url ${module_name})" repo_branchpath="${module_branch}:${doc_dir}" git_download ${repo_url} ${repo_branchpath} "$silentflag" $oldmd5 lastupdate=$? cd $savepwd sawentry=1 fi fi else echo "Invalid line - $line" fi fi if [ "x$lastupdate" != "x0" ]; then echo "There was an error updating the sources" exit 1 fi done < "../scripts/documentation_paths" cd .. Index: branches/stable/l10n-kde4/scripts/update_xml =================================================================== --- branches/stable/l10n-kde4/scripts/update_xml (revision 1572395) +++ branches/stable/l10n-kde4/scripts/update_xml (revision 1572396) @@ -1,194 +1,196 @@ #! /bin/bash function check_xml() { if test -f $trans_doc; then case $trans_doc in */api/index.docbook) ;; */index.docbook|*/man-*.docbook) dir=`dirname $trans_doc` status=`svn st $dir` if [ "x$status" != "x" ]; then if ! $MEINPROC_COMMAND $trans_doc >/dev/null; then $MEINPROC_COMMAND $trans_doc if test "$delete" -eq 1; then echo "RESTORING $trans_doc" echo "RESTORING $trans_doc" >>update_xml.log rm -f $trans_doc svn revert -R $(dirname $trans_doc) else echo "Failed on $trans_doc. Exiting." exit 1 fi fi fi ;; *) ;; esac fi } LANG=C LC_ALL=C LC_MESSAGES=C . scripts/find_meinproc # Check for some version of meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 if test $# -eq 0 || test "$1" = "--help"; then echo "update_xml [--nodelete] [--commit] [--noupdate] [module [program]]" exit fi delete=1 if test "$1" = "--nodelete"; then delete=0 shift fi commit=0 if test "$1" = "--commit"; then commit=1 shift fi update=1 if test "$1" = "--noupdate"; then update=0 shift fi subdir=$1 selection=$2 if test -z "$selection"; then selection=* if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh + [ $? -eq 0 ] || exit 1 fi modules=`ls -1 documentation` else modules=$selection if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh $selection + [ $? -eq 0 ] || exit 1 fi fi program=$3 if [ $commit = "1" ]; then if test -n "$program"; then echo "--commit is not supported with a single catalog" exit fi fi for m in $modules; do test -d documentation/$m || continue files=`find -H documentation/$m -name "*.docbook"` if test -n "$files"; then for i in $files; do case $i in *_original.docbook) continue ;; *$selection*) ;; *) continue ;; esac j=`echo $i | sed -e "s#documentation/$m/##" | sed -e 's#.docbook$##' | sed -e 's#/index$##' | sed -e "s#/#_#g"` translations=`ls -1 $subdir/docmessages/$m/$j.po 2>/dev/null` for t in $translations; do # If a single program selected, skip unless this is the one. if test -n "$program"; then test `echo $t | sed "s#/$program.*.po##"` = $t && continue fi bd=`dirname $t` p=`echo $i | sed -e "s#documentation/$m/##"` trans_doc="$bd/../../docs/$m/$p" dir=`dirname $trans_doc` mbase=`dirname $dir` result=`msgfmt -o /dev/null --statistics $t 2>&1` ret=$? if test $delete -eq 0 && test "$ret" -ne 0; then echo "ERROR: msgfmt $t failed. Exiting." exit 1 fi if test "$ret" -ne 0 || echo $result | grep -q untranslated; then echo "$t: $result" continue fi if echo $result | grep -q fuzzy; then echo "$t: $result" continue fi echo po2xml $i $t if ! po2xml $i $t >temp.xml; then echo "ERROR: po2xml $i $t failed! Exiting!" exit 1 fi language=`cat $bd/../language` if test -n "$language"; then sed -e "s,temp.xml.new mv temp.xml.new temp.xml fi lang=$subdir # call external postfilter if it exists (try several locations) postfilter="$bd/../post-po2xml" test -x $postfilter || postfilter="$subdir/internal/post-po2xml" test -x $postfilter || postfilter="$subdir/../internal/post-po2xml" if test -x $postfilter; then if $postfilter temp.xml.new; then mv temp.xml.new temp.xml else echo "ERROR: $postfilter failed! Exiting!" rm -f temp.xml.new exit 1 fi fi # if missing, add base module dir to svn (/docs/) if ! svn info $mbase 1>/dev/null 2>/dev/null || test ! -d $mbase; then mkdir -p $mbase svn add --force --parents -N $mbase fi if ! svn info $dir 1>/dev/null 2>/dev/null || test ! -d $dir; then mkdir -p $dir rm -f $trans_doc mv temp.xml $trans_doc echo Makefile >ignore.$$ echo CMake* >>ignore.$$ # For those who build in the same dir: echo *.cmake >>ignore.$$ echo DartTextfile.txt >>ignore.$$ svn add --force $dir svn ps svn:ignore -F ignore.$$ $dir rm ignore.$$ else if ! cmp -s temp.xml $trans_doc; then : rm -f $trans_doc mv temp.xml $trans_doc if test "`svn status $trans_doc | cut -b-6`" = '? '; then svn add --force $trans_doc fi else rm temp.xml fi fi check_xml done done fi done if [ $commit = "1" ]; then svn commit -m "SVN_SILENT made docs" $subdir/docs/$selection fi Index: branches/stable/l10n-kf5/scripts/get_paths =================================================================== --- branches/stable/l10n-kf5/scripts/get_paths (revision 1572395) +++ branches/stable/l10n-kf5/scripts/get_paths (revision 1572396) @@ -1,218 +1,234 @@ KDE_PROJECTS_API_URL="https://projects.kde.org/api/v1" I18N_BRANCH='stableKF5' +function check_kde_projects_requirements +{ + local programs_required="curl jq" + for program_checked in ${programs_required}; do + ${program_checked} --help &>/dev/null + if [ $? -ne 0 ]; then + printf "\'${program_checked}\' is required but it was not found\n" 1>&2 + exit 1 + fi + done +} + function list_modules { + check_kde_projects_requirements + # --retry 5 is a safeguard local all_modules=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifiers?active=true | jq -r '.[]' 2>/dev/null) if [ $? -ne 0 ]; then all_modules="" fi modules="" # most of the code which follows should and wll be replaced # by proper filtering on the API side for M in ${all_modules}; do local project_details=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/${M} 2>/dev/null) local found_repo=$(echo "${project_details}" | jq -r '.repo' 2>/dev/null) [[ "${found_repo}" =~ (unmaintained|historical|sysadmin)/ ]] && continue local found_branch=$(echo "${project_details}" | jq -r ".i18n.${I18N_BRANCH}" 2>/dev/null) expected_branch=$(get_branch ${M}) if [ -z "${expected_branch}" ] || [ "${expected_branch}" = "get_branch_none" ]; then expected_branch="none" fi if [ "${found_branch}" != "${expected_branch}" ]; then printf "Warning: '%s' has different branches in get_paths (%s) than in XML file (%s)\n" ${M} ${expected_branch} ${found_branch} >&2 fi if [ "${expected_branch}" != "none" ]; then modules="${modules} ${M}" fi done echo $modules } function get_path { # kde-dev-scripts, kconfigwidgets and kdoctools are not # part of stable kf5, just here for update_translations needs case "$1" in kde-dev-scripts) echo git-stable/$1 ;; kconfigwidgets|kdoctools) echo git-unstable-kf5/$1 ;; l10n) echo branches/stable/l10n-kf5 ;; *) echo git-stable-kf5/$1 ;; esac } function get_po_path { echo $1 } function get_vcs { case "$1" in l10n) echo svn ;; *) echo git ;; esac } function get_branch { case "$1" in phonon-vlc) echo "0.11" ;; phonon-gstreamer) echo "4.10" ;; phonon) echo "4.11" ;; kdialog|keditbookmarks|kfind|konqueror|kate|khelpcenter|konsole|yakuake|dolphin|analitza|artikulate|blinken|cantor|kalgebra|kalzium|kanagram|kbruch|kdeedu-data|kgeography|khangman|kig|kiten|klettres|kmplot|kqtquickcharts|ktouch|kturtle|kwordquiz|libkeduvocdocument|marble|minuet|parley|rocs|step|gwenview|kamera|kcolorchooser|kdegraphics-mobipocket|kdegraphics-thumbnailers|kolourpaint|kruler|spectacle|libkdcraw|libkexiv2|libkgeomap|libkipi|libksane|okular|svgpart|ark|filelight|kcalc|kcharselect|kdebugsettings|kdf|kfloppy|kgpg|ktimer|kwalletmanager|print-manager|sweeper|kmag|kmousetool|kmouth|audiocd-kio|dragon|ffmpegthumbs|juk|k3b|kdenlive|kmix|kwave|libkcddb|libkcompactdisc|bomber|bovo|granatier|kajongg|kapman|katomic|kblackbox|kblocks|kbounce|kbreakout|kdiamond|kfourinline|kgoldrunner|kigo|killbots|kiriki|kjumpingcube|klickety|klines|kmahjongg|kmines|knavalbattle|knetwalk|knights|kolf|kollision|konquest|kpat|kreversi|kshisen|ksirk|ksnakeduel|kspaceduel|ksquares|ksudoku|ktuberling|kubrick|libkdegames|libkmahjongg|lskat|palapeli|picmi|cervisia|dolphin-plugins|kapptemplate|kcachegrind|kde-dev-utils|kde-dev-scripts|kdesdk-kioslaves|kdesdk-thumbnailers|kompare|libkomparediff2|lokalize|poxml|umbrello|kteatime|kcron|ksystemlog|kdenetwork-filesharing|zeroconf-ioslave|kget|kio-extras|kopete|krdc|krfb|ktp-accounts-kcm|ktp-approver|ktp-auth-handler|ktp-call-ui|ktp-common-internals|ktp-contact-list|ktp-contact-runner|ktp-desktop-applets|ktp-filetransfer-handler|ktp-kded-module|ktp-send-file|ktp-text-ui|kaccounts-integration|kaccounts-providers|signon-kwallet-extension|kross-interpreters|baloo-widgets|akonadi|akonadi-search|kalarmcal|kblog|kcalutils|kidentitymanagement|kimap|kldap|kleopatra|kmailtransport|kmbox|kmime|kontactinterface|kpimtextedit|ktnef|akonadi-calendar|akonadi-contacts|akonadi-notes|akonadi-mime|akonadi-calendar-tools|akonadiconsole|akonadi-import-wizard|akregator|grantlee-editor|kaddressbook|kalarm|kmail|kmail-account-wizard|knotes|kontact|korganizer|mbox-importer|pim-data-exporter|pim-sieve-editor|kdepim-runtime|kdepim-addons|calendarsupport|eventviews|grantleetheme|incidenceeditor|kdepim-apps-libs|libgravatar|libkdepim|libkgapi|libkleo|libksieve|mailcommon|mailimporter|messagelib|pimcommon|kdav|kpkpass|kitinerary|ksmtp|kimagemapeditor|kbackup|kamoso|kirigami-gallery|kipi-plugins|elisa|kdeconnect-kde) echo "release/20.04" ;; wacomtablet) echo "3.2" ;; kdiagram) echo "2.7" ;; krita) echo "krita/4.3" ;; calligra) echo "calligra/3.2" ;; calligraplan) echo "3.2" ;; gcompris) echo "KDE/0.97" ;; kdiff3) echo "1.8" ;; krename) echo "5.0" ;; kronometer) echo "2.2" ;; krusader) echo "stable" ;; okteta) echo "0.26" ;; symboleditor) echo "release-2.1.0" ;; kxstitch) echo "release-2.2.0" ;; atcore) echo "1.0" ;; latte-dock|liblatte) echo "v0.9" ;; qtcurve) echo "1.9" ;; # kdevplatform was merged into kdevelop, so it's not here kdevelop|kdev-php|kdev-python) echo "5.5" ;; kdevelop-pg-qt) echo "2.2" ;; kmplayer) echo "0.12" ;; falkon) echo "Falkon/3.1" ;; kio-gdrive) echo "1.3" ;; konversation) echo "1.7" ;; libktorrent) echo "2.1" ;; ktorrent) echo "5.1" ;; smb4k) echo "3.0" ;; kexi|kdb|kproperty|kreport) echo "3.2" ;; alkimia) echo "8.0" ;; kbibtex) echo "kbibtex/0.9" ;; kmymoney) echo "5.1" ;; tellico) echo "3.3" ;; kdesvn) echo "2.1" ;; massif-visualizer) echo "0.7" ;; heaptrack) echo "1.2" ;; ikona) echo "1.0" ;; bluedevil|breeze|breeze-grub|breeze-gtk|breeze-plymouth|discover|drkonqi|kactivitymanagerd|kde-cli-tools|kdecoration|kde-gtk-config|kdeplasma-addons|kgamma5|khotkeys|kinfocenter|kmenuedit|kscreen|kscreenlocker|ksshaskpass|ksysguard|kwallet-pam|kwayland-integration|kwayland-server|kwin|kwrited|libkscreen|libksysguard|milou|oxygen|plasma-browser-integration|plasma-desktop|plasma-integration|plasma-nano|plasma-nm|plasma-pa|plasma-phone-components|plasma-sdk|plasma-tests|plasma-thunderbolt|plasma-vault|plasma-workspace|plasma-workspace-wallpapers|plymouth-kcm|polkit-kde-agent-1|powerdevil|sddm-kcm|systemsettings|user-manager|xdg-desktop-portal-kde) echo "Plasma/5.19" ;; *) echo "get_branch_none" exit 1 ;; esac } function get_repo_name { echo $(get_po_path $1) } function get_url { + check_kde_projects_requirements + local repo_full_path=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/$1 | jq -r '.repo' 2>/dev/null) res=$? if [ ${res} -eq 0 ] && [ -n "${repo_full_path}" ]; then echo "kde:${repo_full_path}.git" else echo "ERROR: url not found for $1" exit 1 fi } Index: branches/stable/l10n-kf5/scripts/populate_documentation.sh =================================================================== --- branches/stable/l10n-kf5/scripts/populate_documentation.sh (revision 1572395) +++ branches/stable/l10n-kf5/scripts/populate_documentation.sh (revision 1572396) @@ -1,132 +1,133 @@ #!/bin/bash # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ function git_download { if [ -z "$3" ]; then oldmd5=$4 newmd5=`mktemp` fi timeout 1h git archive --remote=$1 $2 | tar -x res=$? if [ $res -ne 0 ]; then echo "Failed to download $1 $2" fi if [ -z "$3" ]; then hashdeep -rl . > $newmd5 if [ -n "$oldmd5" ]; then differences=`diff -ub $oldmd5 $newmd5 | grep ^[+-] | grep -v ^+++ | grep -v ^--- | cut -d " " -f 3 | uniq` else differences=`ls` fi if [ -z "$differences" ]; then echo "No differences" else echo "New/changed/removed files:" echo $differences fi rm -f $oldmd5 $newmd5 fi return $res } if [ ! -d scripts ]; then echo "You have to run the script from the parent directory of scripts/" exit fi dir=`dirname $0` . $dir/get_paths +check_kde_projects_requirements mkdir -p documentation cd documentation onlyonemodule="" sawentry=0 lastupdate=0 silentflag="" if test "$1" = "--silent"; then silentflag="-q" shift fi if [ -n "$1" ]; then onlyonemodule=$1 fi while read line; do if [ -z "$line" ]; then continue fi if [[ $line = \#* ]]; then continue fi IFS=' ' read -ra tokens <<< $line ntokens=${#tokens[@]} if [ $ntokens -lt 2 ]; then echo "The number of tokens is not valid - $line" else if [ "${tokens[0]}" = "entry" ]; then if [ $ntokens -lt 3 ] || [ $ntokens -gt 4 ]; then echo "The number of tokens (${ntokens}) is not valid - ${line}" else doc_dir="" if [ $ntokens -eq 4 ]; then doc_dir="${tokens[3]}" fi entry_dir="${tokens[1]}" module_name="${tokens[2]}" if [ -n "${onlyonemodule}" ] && [ "${onlyonemodule}" != "${module_name}" ]; then # if a specific module is requested, only update it continue fi module_branch="$(get_branch ${module_name})" if [ "${module_branch}" = "get_branch_none" ]; then echo "Unknown branch for ${module_name}/${entry_dir}" else if [ -z "$silentflag" ]; then echo "Updating ${module_name}/${entry_dir} documentation (${module_branch})" fi savepwd=$PWD mkdir -p ${module_name} cd ${module_name} oldmd5="" if [ -d ${entry_dir} ]; then if [ -z "$silentflag" ]; then oldmd5=`mktemp` ( cd ${entry_dir} hashdeep -rl . > $oldmd5 ) fi rm -rf ${entry_dir} fi mkdir -p ${entry_dir} cd ${entry_dir} repo_url="$(get_url ${module_name})" repo_branchpath="${module_branch}:${doc_dir}" git_download ${repo_url} ${repo_branchpath} "$silentflag" $oldmd5 lastupdate=$? cd $savepwd sawentry=1 fi fi else echo "Invalid line - $line" fi fi if [ "x$lastupdate" != "x0" ]; then echo "There was an error updating the sources" exit 1 fi done < "../scripts/documentation_paths" cd .. Index: branches/stable/l10n-kf5/scripts/update_xml =================================================================== --- branches/stable/l10n-kf5/scripts/update_xml (revision 1572395) +++ branches/stable/l10n-kf5/scripts/update_xml (revision 1572396) @@ -1,194 +1,196 @@ #! /bin/bash function check_xml() { if test -f $trans_doc; then case $trans_doc in */api/index.docbook) ;; */index.docbook|*/man-*.docbook) dir=`dirname $trans_doc` status=`svn st $dir` if [ "x$status" != "x" ]; then if ! $MEINPROC_COMMAND $trans_doc >/dev/null; then $MEINPROC_COMMAND $trans_doc if test "$delete" -eq 1; then echo "RESTORING $trans_doc" echo "RESTORING $trans_doc" >>update_xml.log rm -f $trans_doc svn revert -R $(dirname $trans_doc) else echo "Failed on $trans_doc. Exiting." exit 1 fi fi fi ;; *) ;; esac fi } LANG=C LC_ALL=C LC_MESSAGES=C . scripts/find_meinproc # Check for some version of meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 if test $# -eq 0 || test "$1" = "--help"; then echo "update_xml [--nodelete] [--commit] [--noupdate] [module [program]]" exit fi delete=1 if test "$1" = "--nodelete"; then delete=0 shift fi commit=0 if test "$1" = "--commit"; then commit=1 shift fi update=1 if test "$1" = "--noupdate"; then update=0 shift fi subdir=$1 selection=$2 if test -z "$selection"; then selection=* if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh + [ $? -eq 0 ] || exit 1 fi modules=`ls -1 documentation` else modules=$selection if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh $selection + [ $? -eq 0 ] || exit 1 fi fi program=$3 if [ $commit = "1" ]; then if test -n "$program"; then echo "--commit is not supported with a single catalog" exit fi fi for m in $modules; do test -d documentation/$m || continue files=`find -H documentation/$m -name "*.docbook"` if test -n "$files"; then for i in $files; do case $i in *_original.docbook) continue ;; *$selection*) ;; *) continue ;; esac j=`echo $i | sed -e "s#documentation/$m/##" | sed -e 's#.docbook$##' | sed -e 's#/index$##' | sed -e "s#/#_#g"` translations=`ls -1 $subdir/docmessages/$m/$j.po 2>/dev/null` for t in $translations; do # If a single program selected, skip unless this is the one. if test -n "$program"; then test `echo $t | sed "s#/$program.*.po##"` = $t && continue fi bd=`dirname $t` p=`echo $i | sed -e "s#documentation/$m/##"` trans_doc="$bd/../../docs/$m/$p" dir=`dirname $trans_doc` mbase=`dirname $dir` result=`msgfmt -o /dev/null --statistics $t 2>&1` ret=$? if test $delete -eq 0 && test "$ret" -ne 0; then echo "ERROR: msgfmt $t failed. Exiting." exit 1 fi if test "$ret" -ne 0 || echo $result | grep -q untranslated; then echo "$t: $result" continue fi if echo $result | grep -q fuzzy; then echo "$t: $result" continue fi echo po2xml $i $t if ! po2xml $i $t >temp.xml; then echo "ERROR: po2xml $i $t failed! Exiting!" exit 1 fi language=`cat $bd/../language` if test -n "$language"; then sed -e "s,temp.xml.new mv temp.xml.new temp.xml fi lang=$subdir # call external postfilter if it exists (try several locations) postfilter="$bd/../post-po2xml" test -x $postfilter || postfilter="$subdir/internal/post-po2xml" test -x $postfilter || postfilter="$subdir/../internal/post-po2xml" if test -x $postfilter; then if $postfilter temp.xml.new; then mv temp.xml.new temp.xml else echo "ERROR: $postfilter failed! Exiting!" rm -f temp.xml.new exit 1 fi fi # if missing, add base module dir to svn (/docs/) if ! svn info $mbase 1>/dev/null 2>/dev/null || test ! -d $mbase; then mkdir -p $mbase svn add --force --parents -N $mbase fi if ! svn info $dir 1>/dev/null 2>/dev/null || test ! -d $dir; then mkdir -p $dir rm -f $trans_doc mv temp.xml $trans_doc echo Makefile >ignore.$$ echo CMake* >>ignore.$$ # For those who build in the same dir: echo *.cmake >>ignore.$$ echo DartTextfile.txt >>ignore.$$ svn add --force $dir svn ps svn:ignore -F ignore.$$ $dir rm ignore.$$ else if ! cmp -s temp.xml $trans_doc; then : rm -f $trans_doc mv temp.xml $trans_doc if test "`svn status $trans_doc | cut -b-6`" = '? '; then svn add --force $trans_doc fi else rm temp.xml fi fi check_xml done done fi done if [ $commit = "1" ]; then svn commit -m "SVN_SILENT made docs" $subdir/docs/$selection fi Index: branches/stable/l10n-kf5-plasma-lts/scripts/get_paths =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/get_paths (revision 1572395) +++ branches/stable/l10n-kf5-plasma-lts/scripts/get_paths (revision 1572396) @@ -1,104 +1,120 @@ KDE_PROJECTS_API_URL="https://projects.kde.org/api/v1" I18N_BRANCH='stableKF5' +function check_kde_projects_requirements +{ + local programs_required="curl jq" + for program_checked in ${programs_required}; do + ${program_checked} --help &>/dev/null + if [ $? -ne 0 ]; then + printf "\'${program_checked}\' is required but it was not found\n" 1>&2 + exit 1 + fi + done +} + function list_modules { + check_kde_projects_requirements + # --retry 5 is a safeguard local all_modules=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifiers?active=true | jq -r '.[]' 2>/dev/null) if [ $? -ne 0 ]; then all_modules="" fi modules="" # most of the code which follows should and wll be replaced # by proper filtering on the API side for M in ${all_modules}; do local project_details=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/${M} 2>/dev/null) local found_repo=$(echo "${project_details}" | jq -r '.repo' 2>/dev/null) # special rule for the lts branch [[ "${found_repo}" =~ plasma/ ]] || continue local found_branch=$(echo "${project_details}" | jq -r ".i18n.${I18N_BRANCH}" 2>/dev/null) expected_branch=$(get_branch ${M}) if [ -z "${expected_branch}" ] || [ "${expected_branch}" = "get_branch_none" ]; then expected_branch="none" fi if [ "${found_branch}" != "${expected_branch}" ]; then printf "Warning: '%s' has different branches in get_paths (%s) than in XML file (%s)\n" ${M} ${expected_branch} ${found_branch} >&2 fi if [ "${expected_branch}" != "none" ]; then modules="${modules} ${M}" fi done echo $modules } function get_path { # kde-dev-scripts, kconfigwidgets and kdoctools are not # part of stable kf5, just here for update_translations needs case "$1" in kde-dev-scripts) echo git-stable/$1 ;; kconfigwidgets|kdoctools) echo git-unstable-kf5/$1 ;; l10n) echo branches/stable/l10n-kf5-plasma-lts ;; *) echo git-stable-kf5/$1 ;; esac } function get_po_path { echo $1 } function get_vcs { case "$1" in l10n) echo svn ;; *) echo git ;; esac } function get_branch { case "$1" in bluedevil|breeze|breeze-grub|breeze-gtk|breeze-plymouth|discover|drkonqi|kactivitymanagerd|kde-cli-tools|kdecoration|kde-gtk-config|kdeplasma-addons|kgamma5|khotkeys|kinfocenter|kmenuedit|kscreen|kscreenlocker|ksshaskpass|ksysguard|kwallet-pam|kwayland-integration|kwin|kwrited|libkscreen|libksysguard|milou|oxygen|plasma-browser-integration|plasma-desktop|plasma-integration|plasma-nano|plasma-nm|plasma-pa|plasma-phone-components|plasma-sdk|plasma-tests|plasma-thunderbolt|plasma-vault|plasma-workspace|plasma-workspace-wallpapers|plymouth-kcm|polkit-kde-agent-1|powerdevil|sddm-kcm|systemsettings|user-manager|xdg-desktop-portal-kde) echo "Plasma/5.18" ;; *) echo "get_branch_none" exit 1 ;; esac } function get_repo_name { echo $(get_po_path $1) } function get_url { + check_kde_projects_requirements + local repo_full_path=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/$1 | jq -r '.repo' 2>/dev/null) res=$? if [ ${res} -eq 0 ] && [ -n "${repo_full_path}" ]; then echo "kde:${repo_full_path}.git" else echo "ERROR: url not found for $1" exit 1 fi } Index: branches/stable/l10n-kf5-plasma-lts/scripts/populate_documentation.sh =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/populate_documentation.sh (revision 1572395) +++ branches/stable/l10n-kf5-plasma-lts/scripts/populate_documentation.sh (revision 1572396) @@ -1,132 +1,133 @@ #!/bin/bash # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ function git_download { if [ -z "$3" ]; then oldmd5=$4 newmd5=`mktemp` fi timeout 1h git archive --remote=$1 $2 | tar -x res=$? if [ $res -ne 0 ]; then echo "Failed to download $1 $2" fi if [ -z "$3" ]; then hashdeep -rl . > $newmd5 if [ -n "$oldmd5" ]; then differences=`diff -ub $oldmd5 $newmd5 | grep ^[+-] | grep -v ^+++ | grep -v ^--- | cut -d " " -f 3 | uniq` else differences=`ls` fi if [ -z "$differences" ]; then echo "No differences" else echo "New/changed/removed files:" echo $differences fi rm -f $oldmd5 $newmd5 fi return $res } if [ ! -d scripts ]; then echo "You have to run the script from the parent directory of scripts/" exit fi dir=`dirname $0` . $dir/get_paths +check_kde_projects_requirements mkdir -p documentation cd documentation onlyonemodule="" sawentry=0 lastupdate=0 silentflag="" if test "$1" = "--silent"; then silentflag="-q" shift fi if [ -n "$1" ]; then onlyonemodule=$1 fi while read line; do if [ -z "$line" ]; then continue fi if [[ $line = \#* ]]; then continue fi IFS=' ' read -ra tokens <<< $line ntokens=${#tokens[@]} if [ $ntokens -lt 2 ]; then echo "The number of tokens is not valid - $line" else if [ "${tokens[0]}" = "entry" ]; then if [ $ntokens -lt 3 ] || [ $ntokens -gt 4 ]; then echo "The number of tokens (${ntokens}) is not valid - ${line}" else doc_dir="" if [ $ntokens -eq 4 ]; then doc_dir="${tokens[3]}" fi entry_dir="${tokens[1]}" module_name="${tokens[2]}" if [ -n "${onlyonemodule}" ] && [ "${onlyonemodule}" != "${module_name}" ]; then # if a specific module is requested, only update it continue fi module_branch="$(get_branch ${module_name})" if [ "${module_branch}" = "get_branch_none" ]; then echo "Unknown branch for ${module_name}/${entry_dir}" else if [ -z "$silentflag" ]; then echo "Updating ${module_name}/${entry_dir} documentation (${module_branch})" fi savepwd=$PWD mkdir -p ${module_name} cd ${module_name} oldmd5="" if [ -d ${entry_dir} ]; then if [ -z "$silentflag" ]; then oldmd5=`mktemp` ( cd ${entry_dir} hashdeep -rl . > $oldmd5 ) fi rm -rf ${entry_dir} fi mkdir -p ${entry_dir} cd ${entry_dir} repo_url="$(get_url ${module_name})" repo_branchpath="${module_branch}:${doc_dir}" git_download ${repo_url} ${repo_branchpath} "$silentflag" $oldmd5 lastupdate=$? cd $savepwd sawentry=1 fi fi else echo "Invalid line - $line" fi fi if [ "x$lastupdate" != "x0" ]; then echo "There was an error updating the sources" exit 1 fi done < "../scripts/documentation_paths" cd .. Index: branches/stable/l10n-kf5-plasma-lts/scripts/update_xml =================================================================== --- branches/stable/l10n-kf5-plasma-lts/scripts/update_xml (revision 1572395) +++ branches/stable/l10n-kf5-plasma-lts/scripts/update_xml (revision 1572396) @@ -1,194 +1,196 @@ #! /bin/bash function check_xml() { if test -f $trans_doc; then case $trans_doc in */api/index.docbook) ;; */index.docbook|*/man-*.docbook) dir=`dirname $trans_doc` status=`svn st $dir` if [ "x$status" != "x" ]; then if ! $MEINPROC_COMMAND $trans_doc >/dev/null; then $MEINPROC_COMMAND $trans_doc if test "$delete" -eq 1; then echo "RESTORING $trans_doc" echo "RESTORING $trans_doc" >>update_xml.log rm -f $trans_doc svn revert -R $(dirname $trans_doc) else echo "Failed on $trans_doc. Exiting." exit 1 fi fi fi ;; *) ;; esac fi } LANG=C LC_ALL=C LC_MESSAGES=C . scripts/find_meinproc # Check for some version of meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 if test $# -eq 0 || test "$1" = "--help"; then echo "update_xml [--nodelete] [--commit] [--noupdate] [module [program]]" exit fi delete=1 if test "$1" = "--nodelete"; then delete=0 shift fi commit=0 if test "$1" = "--commit"; then commit=1 shift fi update=1 if test "$1" = "--noupdate"; then update=0 shift fi subdir=$1 selection=$2 if test -z "$selection"; then selection=* if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh + [ $? -eq 0 ] || exit 1 fi modules=`ls -1 documentation` else modules=$selection if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh $selection + [ $? -eq 0 ] || exit 1 fi fi program=$3 if [ $commit = "1" ]; then if test -n "$program"; then echo "--commit is not supported with a single catalog" exit fi fi for m in $modules; do test -d documentation/$m || continue files=`find -H documentation/$m -name "*.docbook"` if test -n "$files"; then for i in $files; do case $i in *_original.docbook) continue ;; *$selection*) ;; *) continue ;; esac j=`echo $i | sed -e "s#documentation/$m/##" | sed -e 's#.docbook$##' | sed -e 's#/index$##' | sed -e "s#/#_#g"` translations=`ls -1 $subdir/docmessages/$m/$j.po 2>/dev/null` for t in $translations; do # If a single program selected, skip unless this is the one. if test -n "$program"; then test `echo $t | sed "s#/$program.*.po##"` = $t && continue fi bd=`dirname $t` p=`echo $i | sed -e "s#documentation/$m/##"` trans_doc="$bd/../../docs/$m/$p" dir=`dirname $trans_doc` mbase=`dirname $dir` result=`msgfmt -o /dev/null --statistics $t 2>&1` ret=$? if test $delete -eq 0 && test "$ret" -ne 0; then echo "ERROR: msgfmt $t failed. Exiting." exit 1 fi if test "$ret" -ne 0 || echo $result | grep -q untranslated; then echo "$t: $result" continue fi if echo $result | grep -q fuzzy; then echo "$t: $result" continue fi echo po2xml $i $t if ! po2xml $i $t >temp.xml; then echo "ERROR: po2xml $i $t failed! Exiting!" exit 1 fi language=`cat $bd/../language` if test -n "$language"; then sed -e "s,temp.xml.new mv temp.xml.new temp.xml fi lang=$subdir # call external postfilter if it exists (try several locations) postfilter="$bd/../post-po2xml" test -x $postfilter || postfilter="$subdir/internal/post-po2xml" test -x $postfilter || postfilter="$subdir/../internal/post-po2xml" if test -x $postfilter; then if $postfilter temp.xml.new; then mv temp.xml.new temp.xml else echo "ERROR: $postfilter failed! Exiting!" rm -f temp.xml.new exit 1 fi fi # if missing, add base module dir to svn (/docs/) if ! svn info $mbase 1>/dev/null 2>/dev/null || test ! -d $mbase; then mkdir -p $mbase svn add --force --parents -N $mbase fi if ! svn info $dir 1>/dev/null 2>/dev/null || test ! -d $dir; then mkdir -p $dir rm -f $trans_doc mv temp.xml $trans_doc echo Makefile >ignore.$$ echo CMake* >>ignore.$$ # For those who build in the same dir: echo *.cmake >>ignore.$$ echo DartTextfile.txt >>ignore.$$ svn add --force $dir svn ps svn:ignore -F ignore.$$ $dir rm ignore.$$ else if ! cmp -s temp.xml $trans_doc; then : rm -f $trans_doc mv temp.xml $trans_doc if test "`svn status $trans_doc | cut -b-6`" = '? '; then svn add --force $trans_doc fi else rm temp.xml fi fi check_xml done done fi done if [ $commit = "1" ]; then svn commit -m "SVN_SILENT made docs" $subdir/docs/$selection fi Index: trunk/l10n-kf5/scripts/get_paths =================================================================== --- trunk/l10n-kf5/scripts/get_paths (revision 1572395) +++ trunk/l10n-kf5/scripts/get_paths (revision 1572396) @@ -1,139 +1,155 @@ KDE_PROJECTS_API_URL="https://projects.kde.org/api/v1" I18N_BRANCH='trunkKF5' +function check_kde_projects_requirements +{ + local programs_required="curl jq" + for program_checked in ${programs_required}; do + ${program_checked} --help &>/dev/null + if [ $? -ne 0 ]; then + printf "\'${program_checked}\' is required but it was not found\n" 1>&2 + exit 1 + fi + done +} + function list_modules { + check_kde_projects_requirements + # --retry 5 is a safeguard local all_modules=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifiers?active=true | jq -r '.[]' 2>/dev/null) if [ $? -ne 0 ]; then all_modules="" fi modules="" # most of the code which follows should and wll be replaced # by proper filtering on the API side for M in ${all_modules}; do local project_details=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/${M} 2>/dev/null) local found_repo=$(echo "${project_details}" | jq -r '.repo' 2>/dev/null) [[ "${found_repo}" =~ (unmaintained|historical|sysadmin)/ ]] && continue local found_branch=$(echo "${project_details}" | jq -r ".i18n.${I18N_BRANCH}" 2>/dev/null) expected_branch=$(get_branch ${M}) if [ -z "${expected_branch}" ] || [ "${expected_branch}" = "get_branch_none" ]; then expected_branch="none" fi if [ "${found_branch}" != "${expected_branch}" ]; then printf "Warning: '%s' has different branches in get_paths (%s) than in XML file (%s)\n" ${M} ${expected_branch} ${found_branch} >&2 fi if [ "${expected_branch}" != "none" ]; then modules="${modules} ${M}" fi done echo $modules } function get_path { case "$1" in l10n) echo trunk/l10n-kf5 ;; *) echo git-unstable-kf5/$1 ;; esac } function get_po_path { echo $1 } function get_vcs { case "$1" in l10n) echo svn ;; *) echo git ;; esac } function get_branch { case "$1" in websites-docs-krita-org) # yes, it's stable, but it's where the site is generated from echo "krita/4.3" ;; phonon|phonon-gstreamer|phonon-vlc) echo "master" ;; attica|baloo|bluez-qt|breeze-icons|extra-cmake-modules|frameworkintegration|kactivities|kactivities-stats|kapidox|karchive|kauth|kbookmarks|kcalendarcore|kcmutils|kcodecs|kcompletion|kconfig|kconfigwidgets|kcontacts|kcoreaddons|kcrash|kdbusaddons|kdeclarative|kded|kdelibs4support|kdesignerplugin|kdesu|kdewebkit|kdnssd|kdoctools|kemoticons|kfilemetadata|kglobalaccel|kguiaddons|kholidays|khtml|ki18n|kiconthemes|kidletime|kimageformats|kinit|kio|kirigami|kitemmodels|kitemviews|kjobwidgets|kjs|kjsembed|kmediaplayer|knewstuff|knotifications|knotifyconfig|kpackage|kparts|kpeople|kplotting|kpty|kquickcharts|kross|krunner|kservice|ktexteditor|ktextwidgets|kunitconversion|kwallet|kwayland|kwidgetsaddons|kwindowsystem|kxmlgui|kxmlrpcclient|modemmanager-qt|networkmanager-qt|oxygen-icons5|plasma-framework|prison|purpose|qqc2-desktop-style|solid|sonnet|syndication|syntax-highlighting|threadweaver) # Frameworks echo "master" ;; bluedevil|breeze|breeze-grub|breeze-gtk|breeze-plymouth|discover|drkonqi|kactivitymanagerd|kde-cli-tools|kdecoration|kde-gtk-config|kdeplasma-addons|kgamma5|khotkeys|kinfocenter|kmenuedit|kscreen|kscreenlocker|ksshaskpass|ksysguard|kwallet-pam|kwayland-integration|kwayland-server|kwin|kwrited|libkscreen|libksysguard|milou|oxygen|plasma-browser-integration|plasma-desktop|plasma-integration|plasma-nano|plasma-nm|plasma-pa|plasma-phone-components|plasma-sdk|plasma-tests|plasma-thunderbolt|plasma-vault|plasma-workspace|plasma-workspace-wallpapers|plymouth-kcm|polkit-kde-agent-1|powerdevil|sddm-kcm|systemsettings|user-manager|xdg-desktop-portal-kde) # Plasma echo "master" ;; kdialog|keditbookmarks|kfind|konqueror|kate|khelpcenter|konsole|yakuake|dolphin|analitza|artikulate|blinken|cantor|kalgebra|kalzium|kanagram|kbruch|kdeedu-data|kgeography|khangman|kig|kiten|klettres|kmplot|kqtquickcharts|ktouch|kturtle|kwordquiz|libkeduvocdocument|marble|minuet|parley|rocs|step|gwenview|kamera|kcolorchooser|kdegraphics-mobipocket|kdegraphics-thumbnailers|kolourpaint|kruler|spectacle|libkdcraw|libkexiv2|libkgeomap|libkipi|libksane|okular|svgpart|ark|filelight|kcalc|kcharselect|kdebugsettings|kdf|kfloppy|kgpg|ktimer|kwalletmanager|print-manager|sweeper|kmag|kmousetool|kmouth|audiocd-kio|dragon|ffmpegthumbs|juk|k3b|kdenlive|kmix|kwave|libkcddb|libkcompactdisc|bomber|bovo|granatier|kajongg|kapman|katomic|kblackbox|kblocks|kbounce|kbreakout|kdiamond|kfourinline|kgoldrunner|kigo|killbots|kiriki|kjumpingcube|klickety|klines|kmahjongg|kmines|knavalbattle|knetwalk|knights|kolf|kollision|konquest|kpat|kreversi|kshisen|ksirk|ksnakeduel|kspaceduel|ksquares|ksudoku|ktuberling|kubrick|libkdegames|libkmahjongg|lskat|palapeli|picmi|cervisia|dolphin-plugins|kapptemplate|kcachegrind|kde-dev-utils|kde-dev-scripts|kdesdk-kioslaves|kdesdk-thumbnailers|kompare|libkomparediff2|lokalize|poxml|umbrello|kteatime|kcron|ksystemlog|kdenetwork-filesharing|zeroconf-ioslave|kget|kio-extras|kopete|krdc|krfb|ktp-accounts-kcm|ktp-approver|ktp-auth-handler|ktp-call-ui|ktp-common-internals|ktp-contact-list|ktp-contact-runner|ktp-desktop-applets|ktp-filetransfer-handler|ktp-kded-module|ktp-send-file|ktp-text-ui|kaccounts-integration|kaccounts-providers|signon-kwallet-extension|kross-interpreters|baloo-widgets|akonadi|akonadi-search|kalarmcal|kblog|kcalutils|kidentitymanagement|kimap|kldap|kleopatra|kmailtransport|kmbox|kmime|kontactinterface|kpimtextedit|ktnef|akonadi-calendar|akonadi-contacts|akonadi-notes|akonadi-mime|akonadi-calendar-tools|akonadiconsole|akonadi-import-wizard|akregator|grantlee-editor|kaddressbook|kalarm|kmail|kmail-account-wizard|knotes|kontact|korganizer|mbox-importer|pim-data-exporter|pim-sieve-editor|kdepim-runtime|kdepim-addons|calendarsupport|eventviews|grantleetheme|incidenceeditor|kdepim-apps-libs|libgravatar|libkdepim|libkgapi|libkleo|libksieve|mailcommon|mailimporter|messagelib|pimcommon|kdav|kpkpass|kitinerary|ksmtp|kimagemapeditor|kbackup|kamoso|kirigami-gallery|kipi-plugins|elisa|kdeconnect-kde) # Release Service echo "master" ;; plasma-wayland-protocols) echo "master" ;; calligra|calligraplan|kexi) echo "master" ;; akonadiclient|akonadi-phabricator-resource|alkimia|amarok|amor|apper|atcore|atelier|atlantik|audex|basket|choqok|clazy|colord-kde|cutehmi|digikam|digikam-doc|distro-release-notifier|elf-dissector|falkon|gcompris|gcompris-data|git-lab|heaptrack|ikona|isoimagewriter|itinerary|kaffeine|kaidan|kairo|kalternatives|kasync|kbibtex|kbibtex-testset|kcgroups|kcm-grub2|kdav2|kdb|kdeconnect-android|kdesrc-build|kdesvn|kdev-css|kdevelop|kdevelop-pg-qt|kdev-embedded|kdev-executebrowser|kdev-krazy2|kdev-mercurial|kdev-php|kdev-python|kdev-ruby|kdev-upload|kdev-valgrind|kdev-verapp|kdev-xdebug|kdiagram|kdiff3|keurocalc|keysmith|kgraphviewer|khipu|kid3|kije|kile|kimap2|kio-fuse|kio-gdrive|kio-gopher|kio-stash|kirigami-addons|kirogi|kjots|klimbgrades|kmarkdownwebview|kmplayer|kmuddy|kmymoney|kolorfill|kolor-manager|kongress|konversation|kooka|kookbook|kpeoplesink|kpeoplevcard|kphotoalbum|kpmcore|kproperty|kpublictransport|kquickimageeditor|kquickitemviews|kregexpeditor|krename|kreport|krita|kronometer|krusader|ksokoban|kstars|kst-plot|ktechlab|ktimetracker|ktorrent|ktrip|kube|kubuntu-debug-installer|kubuntu-driver-kcm|kubuntu-notification-helper|kuickshow|kup|kuserfeedback|kwebkitpart|kwindowsaddons|kxstitch|labplot|libdebconf-kde|libkimageannotator|libktorrent|libkvkontakte|libmediawiki|libqaccessibilityclient|libqapt|libtmdbqt|liquidshell|mangonel|mark|massif-visualizer|muon|okteta|partitionmanager|peruse|mycroft-plasmoid|plasma-pk-updates|polkit-qt-1|pulseaudio-qt|pvfviewer|qca|qtcurve|qtjolie|ring-kde|rkward|rsibreak|ruqola|rust-qt-binding-generator|samba-mounter|kdesdk-devenv-dependencies|sink|skanlite|skrooge|smb4k|snorenotify|subtitlecomposer|symboleditor|symmy|systemdgenie|tellico|trojita|ubiquity-slideshow-neon|upnp-lib-qt|wacomtablet|washipad|whoopsie-kcm|xdg-portal-test-kde|zanshin) # independent release echo "master" ;; alligator|calindori|kaccounts-mobile|kclock|koko|kweather|mtp-server|plasma-angelfish|plasma-camera|plasma-dialer|plasma-maliit-framework|plasma-mycroft-mobile|plasma-phonebook|plasma-phone-settings|plasma-samegame|plasma-settings|qmlkonsole|qrca|spacebar|trainer) # plasma-mobile echo "master" ;; lancelot|latte-dock|plasma-active-window-control|plasma-bigscreen|plasma-pass|plasma-redshift-control|plasma-simplemenu|smaragd) # plasma namespace but not Plasma echo "master" ;; buho|index-fm|maui-accounts-dbus-daemon|maui-accounts-gui|maui-cinema|maui-communicator|mauikit|maui-libdavclient|maui-pix|maui-shelf|maui-station|nomad-style|nota|vvave) # mauikit echo "master" ;; rcharactersheet|rcse|rolisteam|rolisteam-common|rolisteam-community-data|rolisteam-diceparser|rolisteam-packaging|rolisteam-plugins) echo "master" ;; websites-calligra-org|websites-capacity|websites-edu-kde-org|websites-gcompris-net|websites-kate-editor-org|websites-kde-org-announcements-releases|websites-okular-kde-org|websites-kde-org|websites-kde-org-applications) echo "master" ;; *) echo "get_branch_none" ;; esac } function get_repo_name { echo $(get_po_path $1) } function get_url { + check_kde_projects_requirements + local repo_full_path=$(curl --retry 5 -s ${KDE_PROJECTS_API_URL}/identifier/$1 | jq -r '.repo' 2>/dev/null) res=$? if [ ${res} -eq 0 ] && [ -n "${repo_full_path}" ]; then echo "kde:${repo_full_path}.git" else echo "ERROR: url not found for $1" exit 1 fi } Index: trunk/l10n-kf5/scripts/populate_documentation.sh =================================================================== --- trunk/l10n-kf5/scripts/populate_documentation.sh (revision 1572395) +++ trunk/l10n-kf5/scripts/populate_documentation.sh (revision 1572396) @@ -1,132 +1,133 @@ #!/bin/bash # Author: Albert Astals Cid # License: WTFPL 2 - http://sam.zoy.org/wtfpl/ function git_download { if [ -z "$3" ]; then oldmd5=$4 newmd5=`mktemp` fi timeout 1h git archive --remote=$1 $2 | tar -x res=$? if [ $res -ne 0 ]; then echo "Failed to download $1 $2" fi if [ -z "$3" ]; then hashdeep -rl . > $newmd5 if [ -n "$oldmd5" ]; then differences=`diff -ub $oldmd5 $newmd5 | grep ^[+-] | grep -v ^+++ | grep -v ^--- | cut -d " " -f 3 | uniq` else differences=`ls` fi if [ -z "$differences" ]; then echo "No differences" else echo "New/changed/removed files:" echo $differences fi rm -f $oldmd5 $newmd5 fi return $res } if [ ! -d scripts ]; then echo "You have to run the script from the parent directory of scripts/" exit fi dir=`dirname $0` . $dir/get_paths +check_kde_projects_requirements mkdir -p documentation cd documentation onlyonemodule="" sawentry=0 lastupdate=0 silentflag="" if test "$1" = "--silent"; then silentflag="-q" shift fi if [ -n "$1" ]; then onlyonemodule=$1 fi while read line; do if [ -z "$line" ]; then continue fi if [[ $line = \#* ]]; then continue fi IFS=' ' read -ra tokens <<< $line ntokens=${#tokens[@]} if [ $ntokens -lt 2 ]; then echo "The number of tokens is not valid - $line" else if [ "${tokens[0]}" = "entry" ]; then if [ $ntokens -lt 3 ] || [ $ntokens -gt 4 ]; then echo "The number of tokens (${ntokens}) is not valid - ${line}" else doc_dir="" if [ $ntokens -eq 4 ]; then doc_dir="${tokens[3]}" fi entry_dir="${tokens[1]}" module_name="${tokens[2]}" if [ -n "${onlyonemodule}" ] && [ "${onlyonemodule}" != "${module_name}" ]; then # if a specific module is requested, only update it continue fi module_branch="$(get_branch ${module_name})" if [ "${module_branch}" = "get_branch_none" ]; then echo "Unknown branch for ${module_name}/${entry_dir}" else if [ -z "$silentflag" ]; then echo "Updating ${module_name}/${entry_dir} documentation (${module_branch})" fi savepwd=$PWD mkdir -p ${module_name} cd ${module_name} oldmd5="" if [ -d ${entry_dir} ]; then if [ -z "$silentflag" ]; then oldmd5=`mktemp` ( cd ${entry_dir} hashdeep -rl . > $oldmd5 ) fi rm -rf ${entry_dir} fi mkdir -p ${entry_dir} cd ${entry_dir} repo_url="$(get_url ${module_name})" repo_branchpath="${module_branch}:${doc_dir}" git_download ${repo_url} ${repo_branchpath} "$silentflag" $oldmd5 lastupdate=$? cd $savepwd sawentry=1 fi fi else echo "Invalid line - $line" fi fi if [ "x$lastupdate" != "x0" ]; then echo "There was an error updating the sources" exit 1 fi done < "../scripts/documentation_paths" cd .. Index: trunk/l10n-kf5/scripts/update_xml =================================================================== --- trunk/l10n-kf5/scripts/update_xml (revision 1572395) +++ trunk/l10n-kf5/scripts/update_xml (revision 1572396) @@ -1,194 +1,196 @@ #! /bin/bash function check_xml() { if test -f $trans_doc; then case $trans_doc in */api/index.docbook) ;; */index.docbook|*/man-*.docbook) dir=`dirname $trans_doc` status=`svn st $dir` if [ "x$status" != "x" ]; then if ! $MEINPROC_COMMAND $trans_doc >/dev/null; then $MEINPROC_COMMAND $trans_doc if test "$delete" -eq 1; then echo "RESTORING $trans_doc" echo "RESTORING $trans_doc" >>update_xml.log rm -f $trans_doc svn revert -R $(dirname $trans_doc) else echo "Failed on $trans_doc. Exiting." exit 1 fi fi fi ;; *) ;; esac fi } LANG=C LC_ALL=C LC_MESSAGES=C . scripts/find_meinproc # Check for some version of meinproc MEINPROC_COMMAND=`find_meinproc` test -z "${MEINPROC_COMMAND}" && echo "No suitable version of meinproc was found. Exiting..." && exit 1 if test $# -eq 0 || test "$1" = "--help"; then echo "update_xml [--nodelete] [--commit] [--noupdate] [module [program]]" exit fi delete=1 if test "$1" = "--nodelete"; then delete=0 shift fi commit=0 if test "$1" = "--commit"; then commit=1 shift fi update=1 if test "$1" = "--noupdate"; then update=0 shift fi subdir=$1 selection=$2 if test -z "$selection"; then selection=* if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh + [ $? -eq 0 ] || exit 1 fi modules=`ls -1 documentation` else modules=$selection if test "$update" -eq 1; then bash ./scripts/populate_documentation.sh $selection + [ $? -eq 0 ] || exit 1 fi fi program=$3 if [ $commit = "1" ]; then if test -n "$program"; then echo "--commit is not supported with a single catalog" exit fi fi for m in $modules; do test -d documentation/$m || continue files=`find -H documentation/$m -name "*.docbook"` if test -n "$files"; then for i in $files; do case $i in *_original.docbook) continue ;; *$selection*) ;; *) continue ;; esac j=`echo $i | sed -e "s#documentation/$m/##" | sed -e 's#.docbook$##' | sed -e 's#/index$##' | sed -e "s#/#_#g"` translations=`ls -1 $subdir/docmessages/$m/$j.po 2>/dev/null` for t in $translations; do # If a single program selected, skip unless this is the one. if test -n "$program"; then test `echo $t | sed "s#/$program.*.po##"` = $t && continue fi bd=`dirname $t` p=`echo $i | sed -e "s#documentation/$m/##"` trans_doc="$bd/../../docs/$m/$p" dir=`dirname $trans_doc` mbase=`dirname $dir` result=`msgfmt -o /dev/null --statistics $t 2>&1` ret=$? if test $delete -eq 0 && test "$ret" -ne 0; then echo "ERROR: msgfmt $t failed. Exiting." exit 1 fi if test "$ret" -ne 0 || echo $result | grep -q untranslated; then echo "$t: $result" continue fi if echo $result | grep -q fuzzy; then echo "$t: $result" continue fi echo po2xml $i $t if ! po2xml $i $t >temp.xml; then echo "ERROR: po2xml $i $t failed! Exiting!" exit 1 fi language=`cat $bd/../language` if test -n "$language"; then sed -e "s,temp.xml.new mv temp.xml.new temp.xml fi lang=$subdir # call external postfilter if it exists (try several locations) postfilter="$bd/../post-po2xml" test -x $postfilter || postfilter="$subdir/internal/post-po2xml" test -x $postfilter || postfilter="$subdir/../internal/post-po2xml" if test -x $postfilter; then if $postfilter temp.xml.new; then mv temp.xml.new temp.xml else echo "ERROR: $postfilter failed! Exiting!" rm -f temp.xml.new exit 1 fi fi # if missing, add base module dir to svn (/docs/) if ! svn info $mbase 1>/dev/null 2>/dev/null || test ! -d $mbase; then mkdir -p $mbase svn add --force --parents -N $mbase fi if ! svn info $dir 1>/dev/null 2>/dev/null || test ! -d $dir; then mkdir -p $dir rm -f $trans_doc mv temp.xml $trans_doc echo Makefile >ignore.$$ echo CMake* >>ignore.$$ # For those who build in the same dir: echo *.cmake >>ignore.$$ echo DartTextfile.txt >>ignore.$$ svn add --force $dir svn ps svn:ignore -F ignore.$$ $dir rm ignore.$$ else if ! cmp -s temp.xml $trans_doc; then : rm -f $trans_doc mv temp.xml $trans_doc if test "`svn status $trans_doc | cut -b-6`" = '? '; then svn add --force $trans_doc fi else rm temp.xml fi fi check_xml done done fi done if [ $commit = "1" ]; then svn commit -m "SVN_SILENT made docs" $subdir/docs/$selection fi