diff --git a/create_sources_inc b/create_sources_inc
index 32a4c73..b750b86 100755
--- a/create_sources_inc
+++ b/create_sources_inc
@@ -1,220 +1,220 @@
#!/bin/bash
-logfile=$0.log
+logfile=logs/$0.log
exec > >(tee -a $logfile)
exec 2> >(tee -a $logfile >&2)
. version
. config
# for patch-level releases.
onlyversion=$1
if [ -n "$onlyversion" ]; then
version=$onlyversion
fi
# For inqlude
export PATH=$HOME/.gem/ruby/2.3.0/bin:$PATH
export LC_ALL=en_US.UTF-8
if ! ssh-add -l >/dev/null ; then
exit 1
fi
if ! test -f changelog-$version; then
echo "Missing changelog-$version file"
exit 1
fi
if [ ! -f bugzilla-cookies.inc ]; then
echo "Missing bugzilla cookies file"
exit 1
fi
if ! command -v gem >/dev/null ; then
echo "gem not found, install ruby"
exit 1
fi
if ! command -v curl >/dev/null ; then
echo "curl not found"
exit 1
fi
failures=""
export LC_ALL=en_US.UTF-8
# E.g. 'October 06, 2014'
date=`date +'%B %d, %Y'`
# E.g. '06th October 2014'
otherdate="`date +'%d'`th `date +'%B %Y'`"
# If automatic date isn't what you want, set this instead
# Remember to comment it out afterwards
# date='October 07, 2014'
# otherdate='07th October 2014'
releasetools=$PWD
# version=x.y.z ==> dir=x.y
# Patch-level releases go into the same directory, since they are typically just one framework
dir=`echo $version | sed -e 's/\.[0-9]$//'`
output=../www/info/source-kf-$version.inc
echo > $output
process_file()
{
i=$1
filename=`basename $i`
echo '
' >> $output
l=`echo $filename | sed -e "s#.tar.xz##"`
echo ' '$l' | ' >> $output
size=`stat -c "%s" $i`
size=$(($size / 1024))
if test "$size" -lt 1024; then
size="$size"kB
else
size=$((($size * 10) / 1024))
if test "$size" -lt 100; then
size=`echo "$size"MB | sed -e "s#\(.\)MB#.\1MB#"`
else
size=`echo "$size"MB | sed -e "s#\(.\)MB#MB#"`
fi
fi
echo ' '$size' | ' >> $output
sha1=`sha1sum $i | cut -f1 -d' '`
echo ' '$sha1' | ' >> $output
echo '
' >> $output
echo '' >> $output
}
process_folder()
{
for i in $1/*.tar.xz; do
process_file $i
done
}
echo '' >> $output
echo '' >> $output
echo ' Location | ' >> $output
echo ' Size | ' >> $output
echo ' Sha1 Sum | ' >> $output
echo '
' >> $output
if [ -n "$onlyversion" ]; then
for i in sources/*-$onlyversion.tar.xz; do
process_file $i
done
else
process_folder "sources" "$onlyversion"
if [ -d "sources/kde-l10n" ]; then
process_folder "sources/kde-l10n"
fi
fi
echo '
' >> $output
cd `dirname $output`
svn add `basename $output`
if [ -n "$onlyversion" ]; then
exit 0
fi
##################
# Now create the main info page
cp kde-frameworks-template.php kde-frameworks-$version.php
perl -pi -e "s/5\.1\.0/$version/g" kde-frameworks-$version.php
svn add kde-frameworks-$version.php
#######
# Now create the announcement page
cd ../announcements
svn up
rm -f kde-frameworks-$version.php
cp kde-frameworks-template.top kde-frameworks-$version.php
sed -e 's,<,\<,g ; s,>,\>,g' $releasetools/changelog-$version | $releasetools/Markdown.pl | $releasetools/make_changelog_translatable.pl >> kde-frameworks-$version.php
cat kde-frameworks-template.bottom >> kde-frameworks-$version.php
qtver=`perl -pe 'print $1 if (/QT_VERSION (.*?)\.0\)/); $_=""' ~/src/frameworks/kcoreaddons/CMakeLists.txt`
echo "Required Qt version: $qtver"
perl -pi -e "s/\"5.2\"/\"$qtver\"/" kde-frameworks-$version.php
perl -pi -e "s/5\.1\.0/$version/g" kde-frameworks-$version.php
perl -pi -e "s/INSERT_DATE_HERE/$date/" kde-frameworks-$version.php
perl -pi -e "s/DIRECTORY/$dir/" kde-frameworks-$version.php
svn add kde-frameworks-$version.php
########
# Output lines for announcements/index.php
announcelines="
$otherdate - KDE Frameworks $version released
\\\"KDE Ships Frameworks $version.\\\"
"
perl -pi -e "\$_ .= \"$announcelines\" if (/INSERT NEW ENTRIES BELOW THIS LINE/);" index.php
oldpwd=$PWD
#####
# Take care of the inqlude data
gem install --user-install --no-rdoc --no-ri inqlude
inqludedata=$HOME/.local/share/inqlude/manifests
cd $inqludedata
git pull
inqlude create_kde_frameworks $srcdir/frameworks $inqludedata
inqlude release_kde_frameworks `date --iso` $version
git add .
git commit -a -m "Update inqlude-data for KDE Frameworks $version"
git push
########
# Make release announcement translatable
cd ~/l10n-kde4-scripts
svn up
l10nentry=" release_files[\"$version\"] = [\"kde-frameworks-$version.php\"]";
perl -pi -e "\$_ = '$l10nentry' . \"\\n\" . \$_ if (/NEW_FRAMEWORK_RELEASE/);" generate_release_data.py
svn ci -m "add frameworks-$version to generate_release_data.py"
#######
# Add versions in bugzilla
cd $releasetools
./create_bugzilla_versions.sh || failures="bugzilla $failures"
########
# Toplevel index.php
cd $oldpwd/..
svn up index.php
mainpagelines="
KDE Releases Frameworks $version $date
This release is part of a series of planned monthly releases
making improvements available to developers in a quick and predictable
manner.
Read full announcement
"
perl -pi -e "\$_ .= \"$mainpagelines\" if (/Latest Announcements/);" index.php || failures="www/index.php $failures"
echo "TODO: edit www/index.php, and remove older entry"
echo
if [ -n "$failures" ]; then
echo "ERROR: the following steps failed: $failures"
fi
diff --git a/make_rc_tag.sh b/make_rc_tag.sh
index ace41c0..ae84184 100755
--- a/make_rc_tag.sh
+++ b/make_rc_tag.sh
@@ -1,168 +1,168 @@
#!/bin/bash
-logfile=$0.log
+logfile=logs/$0.log
exec > >(tee -a $logfile)
exec 2> >(tee -a $logfile >&2)
. utils.sh
repo_to_pack=$1
if [ "$release_l10n_separately" = "1" ]; then
echo "Only makes sense with bundled translations"
exit
fi
if ! command -v msgattrib >/dev/null ; then
echo "msgattrib not found, install the gettext package"
exit 1
fi
# Usage: grabTranslations $repo $branch $l10n
# Copy .po files from $l10n (full path) into $repo (branch $branch) and git add them into local_release
function grabTranslations()
{
local repo=$1
local branch=$2
local l10n=$3
pofiles=`find . -name Messages.sh | xargs grep -- '-o \$podir' | sed -e 's,.*podir/,,' | sed -e 's/pot$/po/'`
mkdir -p po
# Copy po files and translated docbooks
has_po=0
local subdir
for subdir in $l10n/*; do
local lang=`basename $subdir`
if [ "$lang" = "x-test" ]; then
continue
fi
local destdir=$checkout/po/$lang
$cmd rm -rf $destdir/docs
local podir=$subdir/messages/$l10n_module
if test -d $podir; then
local hasdestdir=0;
test -d $destdir && hasdestdir=1 || mkdir -p $destdir
for pofile in $pofiles; do
if [ -f "$podir/$pofile" ] && $cmd cp -f "$podir/$pofile" $destdir; then
has_po=1
fi
done
if [ "$has_po" -eq 1 ]; then
# Copy kf5_entry.desktop into kconfigwidgets
if [ ${repo} = "kconfigwidgets" ]; then
local entryfile=$podir/kf5_entry.desktop
if [ -f $entryfile ]; then
$cmd cp -f $entryfile $destdir
fi
fi
# Copy the scripts subdir
local scriptdir=$subdir/scripts/$l10n_module
$cmd rm -rf $destdir/scripts
for pofile in $pofiles; do
scriptmod=`echo $pofile | sed 's/\.po$//'`
if test -d $scriptdir/$scriptmod; then
$cmd test -d $destdir/scripts || $cmd mkdir $destdir/scripts
$cmd cp -rf $scriptdir/$scriptmod $destdir/scripts/ 2>/dev/null
$cmd rm -rf $destdir/scripts/$scriptmod/.svn
fi
done
elif [ $hasdestdir -eq 0 ]; then
$cmd rm -r $destdir
fi
fi
# Look for translated docbooks
local docdir=$subdir/docs/$l10n_module
# We look at the sources to find out the name of the docbooks we want for this framework
if [ -d "$checkout/docs" ]; then
local docfile
pushd $checkout/docs >/dev/null
for docfile in `find . -name '*.docbook'`; do
local docsubdir=`dirname $docfile` # example: kioslave5/ftp
if test -d $docdir/$docsubdir; then
local destsubdir="$destdir/docs/$docsubdir" # example: /home/pkgframeworks/src/frameworks/kio/po/it/docs/kioslave5/ftp
$cmd mkdir -p `dirname $destsubdir` # ensure the parent (kioslave5) exists
test -d $destsubdir && $cmd rm -rf $destsubdir # ensure the subdir (ftp) does not exist (to avoid ftp/ftp)
$cmd cp -a $docdir/$docsubdir $destsubdir # COPY!
$cmd find $destsubdir -name .svn -print0 | xargs -0 rm -rf
has_po=1
fi
done
popd >/dev/null
fi
done
if [ $has_po -eq 1 ]; then
# Strip unused strings, to keep things small
cd po
for f in */*.po ; do msgattrib --output-file=$f --no-obsolete $f ; done
cd ..
$cmd git add po
$cmd git commit po -m "GIT_SILENT Commit translations from `basename $l10n_repo`"
fi
if [ `ls po | wc -l` -eq 0 ]; then $cmd rm -r po ; fi
}
cat modules.git | while read repo branch; do
if [ -z "$repo_to_pack" -o "$repo_to_pack" = "$repo" ]; then
echo $repo
. version
basename=$repo-$version
oldpwd=$PWD
# Go to the local checkout, ensure clean, update
checkout=$(findCheckout $repo)
test -d $checkout || exit 1
cd $checkout
status=`git status --porcelain --untracked-files=no`
if [ -n "$status" ]; then
echo "$checkout doesn't seem clean:"
echo "$status"
exit 2
fi
basetag="v$version-rc"
# This check so that running make_rc_tag.sh twice (because of flaky wifi) doesn't create a rc2 everywhere
# Passing an explicit repo name forces a retag
if [ -n "`git tag -l ${basetag}1`" -a -z "$repo_to_pack" ]; then
# make sure the tag was pushed
git push origin tag ${basetag}1
cd $oldpwd
continue;
fi
git checkout $branch || exit 2
git pull || exit 3
# Always make a local_release branch, even if we have no translations to commit.
# It's also useful for updating tarballs with a cherry-pick.
$cmd git branch -D local_release 2>/dev/null
$cmd git checkout -b local_release
grabTranslations "$repo" "$branch" "$oldpwd/l10n"
tagModule "$repo" "$basetag"
$cmd git checkout $branch
cd $oldpwd
fi
done
if [ -z "$repo_to_pack" ]; then
if [ `wc -l modules.git | cut -f1 -d' '` -ne `wc -l tags.git | cut -f1 -d' '` ]; then
echo "ERROR: only `wc -l tags.git` entries in tags.git, while modules.git has `wc -l modules.git`"
gawk '{print $1}' tags.git > /tmp/t
gawk '{print $1}' modules.git > /tmp/m
diff /tmp/t /tmp/m
fi
fi
diff --git a/tag_all.sh b/tag_all.sh
index afbc5d5..141731a 100755
--- a/tag_all.sh
+++ b/tag_all.sh
@@ -1,79 +1,79 @@
#!/bin/bash
-logfile=$0.log
+logfile=logs/$0.log
exec > >(tee -a $logfile)
exec 2> >(tee -a $logfile >&2)
unset CDPATH
here=$PWD
. config
. utils.sh
# Make sure gpg-remote is running
gpg2 --digest-algo SHA512 --armor --detach-sign -o /dev/null -s config || exit 2
if [ ! -d $srcdir ]; then
echo "$srcdir does not exist, please fix srcdir variable"
exit
fi
if [ `wc -l modules.git | sed -e 's/ .*//'` -lt 70 ]; then
echo "modules.git looks incomplete, please check"
exit
fi
cat $here/modules.git | while read repo branch; do
echo $repo
. $here/version
tagname=v$version
versionfile=$here/versions/$repo
if [ ! -f $versionfile ]; then echo "$versionfile not found"; exit 1; fi
b=`sed '2q;d' $versionfile`
echo $b
checkout=$(findCheckout $repo)
cd $checkout || exit 2
echo $PWD
$cmd git fetch --tags || exit 2
$cmd git config gpg.program gpg2
$cmd git tag -u 53E6B47B45CEA3E0D5B7457758D0EE648A48B3BB $tagname $b -m "Create tag for $version" # ignore error ("already exists")
$cmd git push --tags || exit 5
done
if [ "$release_l10n_separately" = 1 ]; then
. $here/version
$cmd svn mkdir svn+ssh://svn@svn.kde.org/home/kde/tags/KDE/$version -m "Create tag for $version" || exit 7
cat $here/modules.svn | while read repo branch; do
echo $repo
. $here/version
tagname=v$version
versionfile=$here/versions/$repo
if [ ! -f $versionfile ]; then echo "$versionfile not found"; exit 6; fi
b=`sed '2q;d' $versionfile`
echo $b
branch=`echo $branch | sed 's#svn://anonsvn.kde.org#svn+ssh://svn@svn.kde.org#g'`
$cmd svn cp $branch/$repo@$b svn+ssh://svn@svn.kde.org/home/kde/tags/KDE/$version/ -m "Create tag for $version" || exit 8
done
l10n_repo=`echo $l10n_repo | sed 's#svn://anonsvn.kde.org#svn+ssh://svn@svn.kde.org#g'`
$cmd svn mkdir svn+ssh://svn@svn.kde.org/home/kde/tags/KDE/$version/kde-l10n -m "Create tag for $version" || exit 9
for lang in `cat language_list`; do
echo $lang
. $here/version
versionfile=$here/versions/kde-l10n-$lang
if [ ! -f $versionfile ]; then echo "$versionfile not found"; exit 10; fi
b=`sed '2q;d' $versionfile`
echo $b
echo $l10n_repo
$cmd svn cp $l10n_repo/$lang@$b svn+ssh://svn@svn.kde.org/home/kde/tags/KDE/$version/kde-l10n -m "Create tag for $version" || exit 11
variants=`svn cat svn+ssh://svn@svn.kde.org/home/kde/tags/KDE/$version/kde-l10n/$lang/pack-with-variants 2> /dev/null` || continue
for variant in $variants; do
echo $variant
$cmd svn cp $l10n_repo/$variant@$b svn+ssh://svn@svn.kde.org/home/kde/tags/KDE/$version/kde-l10n -m "Create tag for $version" || exit 12
done
done
fi
exit 0