diff --git a/make_rc_tag.sh b/make_rc_tag.sh index 97463a0..68c03f7 100755 --- a/make_rc_tag.sh +++ b/make_rc_tag.sh @@ -1,136 +1,136 @@ #!/bin/bash . utils.sh repo_to_pack=$1 if [ "$release_l10n_separately" = "1" ]; then echo "Only makes sense with bundled translations" exit 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 $cmd git branch -D local_release 2>/dev/null 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 checkout -b local_release $cmd git add po - $cmd git commit po -m "Commit translations from `basename $l10n_repo`" + $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 git checkout $branch || exit 2 git pull || exit 3 grabTranslations "$repo" "$branch" "$oldpwd/l10n" tagModule "$repo" "v$version-rc" $cmd git checkout $branch cd $oldpwd fi done