diff --git a/create_log.py b/create_log.py
index df1caca..5d37dd2 100755
--- a/create_log.py
+++ b/create_log.py
@@ -1,149 +1,149 @@
#!/usr/bin/env python2
import os
import subprocess
def getVersionFrom(repo):
f = open(versionsDir + '/' + repo)
return f.readlines()[1].strip()
f = open('modules.git')
#srcdir="/d/kde/src/5/"
srcdir="/data/devel/kde/release/"
repos=[]
for line in f:
line = line[:line.find(" ")]
repos.append(line)
repos.sort()
versionsDir = os.getcwd() + "/versions"
print ""
for repo in repos:
toVersion = getVersionFrom(repo)
os.chdir(srcdir+repo)
- fromVersion = "v17.08.3"
+ fromVersion = "v17.12.1"
p = subprocess.Popen('git fetch', shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
retval = p.wait()
if retval != 0:
raise NameError('git fetch failed')
p = subprocess.Popen('git rev-parse '+fromVersion, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
retval = p.wait()
if retval != 0:
print "
"
print ""
continue
p = subprocess.Popen('git diff '+fromVersion+'..'+toVersion, shell=True, stdout=subprocess.PIPE)
diffOutput = p.stdout.readlines()
retval = p.wait()
if retval != 0:
raise NameError('git diff failed', repo, fromVersion, toVersion)
if len(diffOutput):
p = subprocess.Popen('git log '+fromVersion+'..'+toVersion, shell=True, stdout=subprocess.PIPE)
commit = []
commits = []
for line in p.stdout.readlines():
if line.startswith("commit"):
if len(commit) > 1 and not ignoreCommit:
commits.append(commit)
commitHash = line[7:].strip()
ignoreCommit = False
commit = [commitHash]
elif line.startswith("Author"):
pass
elif line.startswith("Date"):
pass
elif line.startswith("Merge"):
pass
else:
line = line.strip()
if line.startswith("Merge remote-tracking branch"):
ignoreCommit = True
elif line.startswith("SVN_SILENT"):
ignoreCommit = True
elif line.startswith("GIT_SILENT"):
ignoreCommit = True
elif line.startswith("Merge branch"):
ignoreCommit = True
elif line:
commit.append(line)
# Add the last commit
if len(commit) > 1 and not ignoreCommit:
commits.append(commit)
if len(commits):
print ""
print ""
for commit in commits:
extra = ""
clog = ""
changelog = commit[1]
for line in commit:
if line.startswith("BUGS:"):
bugNumbers = line[line.find(":") + 1:].strip()
for bugNumber in bugNumbers.split(","):
if bugNumber.isdigit():
if extra:
extra += ". "
extra += "Fixes bug #" + bugNumber + ""
elif line.startswith("BUG:"):
bugNumber = line[line.find(":") + 1:].strip()
if bugNumber.isdigit():
if extra:
extra += ". "
extra += "Fixes bug #" + bugNumber + ""
elif line.startswith("REVIEW:"):
if extra:
extra += ". "
reviewNumber = line[line.find(":") + 1:].strip()
extra += "Code review #" + reviewNumber + ""
elif line.startswith("CCBUG:"):
if extra:
extra += ". "
bugNumber = line[line.find(":") + 1:].strip()
extra += "See bug #" + bugNumber + ""
elif line.startswith("FEATURE:"):
feature = line[line.find(":") + 1:].strip()
if feature.isdigit():
if extra:
extra += ". "
extra += "Implements feature #" + feature + ""
else:
if feature and not clog:
changelog = feature
elif line.startswith("CHANGELOG:"):
clog = line[line.find(":") + 1:].strip()
if clog:
changelog = clog
commitHash = commit[0]
if not changelog.endswith("."):
changelog = changelog + "."
capitalizedChangelog = changelog[0].capitalize() + changelog[1:]
print "- " + capitalizedChangelog + " Commit. " + extra + "
"
print "
"
retval = p.wait()
if retval != 0:
raise NameError('git log failed', repo, fromVersion, toVersion)
diff --git a/no_lang_macros.txt b/no_lang_macros.txt
index 6f310a1..da5b870 100644
--- a/no_lang_macros.txt
+++ b/no_lang_macros.txt
@@ -1,4 +1,5 @@
ark
+kdenlive
ksystemlog
marble
umbrello
diff --git a/remote-gpg b/remote-gpg
index 9725848..3667567 100755
--- a/remote-gpg
+++ b/remote-gpg
@@ -1,28 +1,38 @@
#! /bin/bash
# remote-gpg
# original author: Dustin J. Mitchell
# modified at https://www.isi.edu/~calvin/gpgagent.htm
# NOTE: this requires OpenSSH 6.7 or later !
# For OpenSuSE Tumbleweed I had to install http://download.opensuse.org/repositories/home:/dubkat/openSUSE_42.1/x86_64/openssh-7.2p2-134.1.x86_64.rpm
# (found at http://software.opensuse.org/package/openssh), and then follow https://www.gentoo.org/support/news-items/2015-08-13-openssh-weak-keys.html to re-enable DSA!
set -e
remote_user=pkgapplications
host=lxr.kde.org
REMOTE_HOME=/home/pkgapplications
-LOCAL_HOME=$HOME
+
+SYSTEMD_SOCKET=/var/run/user/1000/gnupg/S.gpg-agent.extra
+HOME_SOCKET=$HOME/S.gpg-agent.extra
+if [ -S $SYSTEMD_SOCKET ]; then
+ EXTRASOCKET=$SYSTEMD_SOCKET
+elif [ -S $HOME_SOCKET ]; then
+ EXTRASOCKET=$HOME_SOCKET
+else
+ echo "No extra socket found"
+ exit 1
+fi
# remove any existing agent socket (in theory `StreamLocalBindUnlink yes`
# does this, but in practice, not so much)
ssh $remote_user@$host rm -f $REMOTE_HOME/.gnupg/S.gpg-agent
-ssh -v -t -R $REMOTE_HOME/.gnupg/S.gpg-agent:$LOCAL_HOME/.gnupg/S.gpg-agent-extra \
+ssh -v -t -R $REMOTE_HOME/.gnupg/S.gpg-agent:$EXTRASOCKET \
$remote_user@$host \
sh -c "echo; echo \"Perform remote GPG operations and hit enter\"; \
read; \
sleep 2; \
rm -f $REMOTE_HOME/.gnupg/S.gpg-agent";
diff --git a/utils.sh b/utils.sh
index 546f9a0..bbe6bbc 100644
--- a/utils.sh
+++ b/utils.sh
@@ -1,257 +1,257 @@
#!/bin/bash
function get_git_rev()
{
echo `git ls-remote kde:$repo $branch | cut -f 1`
}
function get_svn_rev()
{
echo `svn info $1 | grep "Last Changed Rev: " | cut -f 4 -d ' '`
}
function checkDownloadUptodate()
{
local finalDestination=$1
local result=0
if [ "x$force" != "x-f" ]; then
if [ -f $finalDestination ]; then
if [ -f $versionFilePath ]; then
fileRepoLine=`sed -n '1p' < $versionFilePath`
if [ "$repoLine" = "$fileRepoLine" ]; then
rev=`get_git_rev`
fileRev=`sed -n '2p' < $versionFilePath`
if [ "$rev" = "$fileRev" ]; then
fileSha=`sed -n '3p' < $versionFilePath`
realFileSha=`sha256sum $finalDestination`
if [ "$fileSha" = "$realFileSha" ]; then
result=1
fi
fi
fi
fi
fi
fi
return $result
}
function no_macros_injection()
{
# return true if the module is in the exclude list, which mean
# that it already calls the macros which deploy the translations.
local searched_module="$1"
grep -q "^${searched_module}$" ../no_lang_macros.txt
return $?
}
function grabTranslations()
{
local basename=$1
mkdir $basename/po
local repo=$2
local subdir
for subdir in ../l10n/*; do
local podir=$subdir/messages/$l10n_module
if test -d $podir; then
local lang=`basename $subdir`
cp $podir/${repo}5.po $basename/po/$lang.po 2>/dev/null
cp $podir/${repo}5_*.po $basename/po/$lang.po 2>/dev/null
fi
done
}
function getTranslationFileList()
{
local basedir="$1"
local po_list=""
# grab the generated pot files (including also temporary ones, but
# they should not matter) for the module
po_list=$(find $basedir -name 'Messages.sh' | while read messagefile; do
cat $messagefile | grep 'podir.*\.pot[[:space:]]*\\\?$' | sed 's,.\+podir.*\/\(.\+\.po\)t[[:space:]]*\\\?$,\1,' | sort -f | uniq
done)
echo $po_list
}
function setupGUITranslations()
{
local basedir="$1"
local basel10n="$2"
local module="$3"
local language_list="$4"
local found_qm=0
local found_po=0
MATCH_QM='^.*_qt.po$'
all_po_files=$(getTranslationFileList "${basedir}")
while read lang; do
for po_file in ${all_po_files}; do
po_location=$(find "${basel10n}/${lang}/messages/" -name "${po_file}")
if [ -z "${po_location}" ]; then
continue
fi
if [[ "${po_file}" =~ ${MATCH_QM} ]]; then
# files like *_qt.po are QM in disguise
destdir=${basedir}/poqm/${lang}
found_qm=1
else
destdir=${basedir}/po/${lang}
found_po=1
fi
mkdir -p "${destdir}"
cp -f "${po_location}" "${destdir}"
done
done < <(cat "${language_list}")
if no_macros_injection "${module}"; then
# the functions have been added to the source code
found_qm=0
found_po=0
fi
if [ ${found_qm} -eq 1 ]; then
echo "ecm_install_po_files_as_qm(poqm)" >>${basedir}/CMakeLists.txt
fi
if [ ${found_po} -eq 1 ]; then
# special cases:
# - ktp-desktop-applets since it doesn't "need" k18n since it's all qml
# but has po files to install so needs ki18n for ki18n_install
# - kajongg has its own implementation if KI18n, waiting for the
# proper binding
if [ "${module}" = "ktp-desktop-applets" ] || [ "${module}" = "kajongg" ]; then
echo "find_package(KF5 REQUIRED COMPONENTS I18n)" >>${basedir}/CMakeLists.txt
fi
echo "ki18n_install(po)" >>${basedir}/CMakeLists.txt
fi
}
function setupDOCTranslations()
{
local basedir="$1"
local basel10n="$2"
local module="$3"
local language_list="$4"
local doc_dirs=""
local man_files=""
#echo "DIR SCRIPT: $(readlink -f $0) - $(dirname $(readlink -f $0))"
all_doc_dirs=$(find ${basedir} -name CMakeLists.txt | \
xargs -n1 awk -f ../list_doc_subdirs.awk | sort -f)
all_man_files=$(grep -ir kdoctools_create_manpage ${basedir} | \
sed 's/.*kdoctools_create_manpage(\(man-.\+\.docbook\) .\+$/\1/' | sort -f)
# exception (difficult to handle in the regular way)
if [ "${module}" = "kwave" ]; then
all_doc_dirs="kwave"
fi
local translated_doc_found=0
while read lang; do
# set -x
local lang_doc_dir="${basel10n}/${lang}/docs"
if [ ! -d "${lang_doc_dir}" ]; then
continue
fi
local all_lang_docs=$(cd "${lang_doc_dir}/"; find . -type d)
for doc_dir in ${all_doc_dirs}; do
local doc_dir_found=$(echo "${all_lang_docs}" | grep -w "${doc_dir}")
# exceptions (difficult to generalize)
if [ "${doc_dir}" == "khelpcenter/glossary" ]; then
- doc_dir_found="./applications/glossary"
+ doc_dir_found=$(echo "${all_lang_docs}" | grep -w "applications/glossary")
fi
if [ -n "${doc_dir_found}" ]; then
# is the directory empty? If it is, skip it
local is_doc_empty=$(find "${lang_doc_dir}/${doc_dir_found}" -maxdepth 0 -type d -empty 2>/dev/null)
if [ -z "${is_doc_empty}" ]; then
local dest_dir="${basedir}/po/${lang}/docs/${doc_dir}"
mkdir -p "${dest_dir}"
cp -r "${lang_doc_dir}/${doc_dir_found}/"* "${dest_dir}"
translated_doc_found=1
fi
fi
done
for man_file in ${all_man_files}; do
man_file_found=$(cd "${lang_doc_dir}"; find . -name "${man_file}")
local dest_dir="${basedir}/po/${lang}/docs"
if [ -n "${man_file_found}" ]; then
mkdir -p "${dest_dir}"
cp -r "${lang_doc_dir}/${man_file_found}" "${dest_dir}"
translated_doc_found=1
fi
done
# set +x
done < <(cat "${language_list}")
if no_macros_injection "${module}"; then
# the function has been added to the source code
translated_doc_found=0
fi
if [ ${translated_doc_found} -eq 1 ]; then
local main_cmakelists="${basedir}/CMakeLists.txt"
echo -e "if (KF5DocTools_FOUND)\n kdoctools_install(po)\nendif()" >>${main_cmakelists}
fi
}
function copyDataArtifacts()
{
# Copy the element of a special directory with translated
# artifacts (data or scripts)
# It is an helper function for setupDataTranslations()
local basedir="$1"
local basel10n="$2"
local module="$3"
local lang="$4"
local artifacts_dir="$5"
local out_dest_dir_var="$6"
local lang_artifacts_dir="${basel10n}/${lang}/${artifacts_dir}"
[ -d "${lang_artifacts_dir}" ] || return 1
# assume that ${module} is unique
local artifacts_dir_full=$(cd "${lang_artifacts_dir}/"; find . -type d -name "${module}" | head -n 1)
[ -n "${artifacts_dir_full}" ] || return 1
local artifacts_dir_base=$(basename ${artifacts_dir_full})
local relative_dest_dir="${lang}/${artifacts_dir}/${artifacts_dir_base}"
local dest_dir="${basedir}/po/${relative_dest_dir}"
if [ ! -d "${dest_dir}" ]; then
mkdir -p "${dest_dir}"
fi
cp -r "${lang_artifacts_dir}/${artifacts_dir_full}/"* "${dest_dir}"
eval ${out_dest_dir_var}="${relative_dest_dir}"
return 0
}
function setupDataTranslations()
{
# Takes care of both data/ and scripts/
local basedir="$1"
local basel10n="$2"
local module="$3"
local language_list="$4"
local rel_dest_dir=""
while read lang; do
# process the data/ directories (and cmake_modules, if available)
if copyDataArtifacts "${basedir}" "${basel10n}" "${module}" "${lang}" \
"data" "rel_dest_dir"; then
echo "add_subdirectory(${rel_dest_dir})" >>"${basedir}/po/CMakeLists.txt"
# copy the content of cmake_modules is available
local cmake_modules_dir="${basel10n}/${lang}/cmake_modules"
if [ -d "${cmake_modules_dir}" ]; then
local cmake_dest_dir="${basedir}/po/cmake_modules"
mkdir -p "${cmake_dest_dir}"
cp -r "${cmake_modules_dir}/"* "${cmake_dest_dir}"
fi
fi
# process the scripts/ directories (and cmake_modules, if available)
# WARNING: this requires KI18n <=5.33 or >=5.36, or with the
# fix which restores ki18n_install_ts_files
if copyDataArtifacts "${basedir}" "${basel10n}" "${module}" "${lang}" \
"scripts" "rel_dest_dir"; then
echo "ki18n_install_ts_files(${lang} ${rel_dest_dir})" >>"${basedir}/po/CMakeLists.txt"
fi
done < <(cat "${language_list}")
if [ -e "${basedir}/po/CMakeLists.txt" ]; then
echo -e "include(ECMOptionalAddSubdirectory)\necm_optional_add_subdirectory(po)" >>${basedir}/CMakeLists.txt
fi
}