diff --git a/make_rc_tag.sh b/make_rc_tag.sh index 68c03f7..074bb1a 100755 --- a/make_rc_tag.sh +++ b/make_rc_tag.sh @@ -1,136 +1,138 @@ #!/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 "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" + # Passing "RESUME" so that running make_rc_tag.sh twice (because of flaky wifi) doesn't create a rc2 everywhere + # TODO make configurable if needed + tagModule "$repo" "v$version-rc" "RESUME" $cmd git checkout $branch cd $oldpwd fi done diff --git a/make_updated_tarball.sh b/make_updated_tarball.sh index d8b84b5..3c09271 100755 --- a/make_updated_tarball.sh +++ b/make_updated_tarball.sh @@ -1,56 +1,56 @@ #!/bin/bash set -e # Make sure gpg-remote is running gpg2 --digest-algo SHA512 --armor --detach-sign -o /dev/null -s config || exit 2 repo=$1 strategy=$2 # either newrc (v5.22.0-rc2) or patchrelease (v5.22.1), we could even autodetect this based on the presence of the final tag (v5.22.0) if [ "$strategy" != "newrc" -a "$strategy" != "patchrelease" ]; then echo "Usage: $0 newrc|patchrelease " exit 1 fi shift shift sha=$* releasetools=$PWD . ./version . ./utils.sh branch=master if [ "$strategy" = "patchrelease" ]; then basetag=`echo v$previousversion | sed -e 's/0$//'` echo "Base tag is $basetag, which assumes version numbers were updated already, please confirm (or abort with Ctrl+C)" read else basetag="v$version-rc" fi checkout=$(findCheckout $repo) cd $checkout $cmd git checkout local_release || $cmd git checkout -b local_release $cmd git fetch if [ "$sha" = "merge" ]; then $cmd git merge origin/master else for s in $sha; do $cmd git cherry-pick -x $s done fi -tagModule "$repo" "$basetag" +tagModule "$repo" "$basetag" "NEW" $cmd git checkout $branch cd $releasetools $cmd ./pack.sh $repo $cmd ./upload_all.sh $cmd cat versions/$repo diff --git a/utils.sh b/utils.sh index 24622e5..7c48e5e 100644 --- a/utils.sh +++ b/utils.sh @@ -1,103 +1,110 @@ #!/bin/bash unset CDPATH releasetools=$PWD . ./config cmd= if [ "$dry_run" = "1" ]; then cmd=echo fi function get_git_rev() { branch_or_tag=$1 echo `git ls-remote kde:$repo $branch_or_tag | cut -f 1` } function get_svn_rev() { echo `svn info $branch/$repo | grep "Last Changed Rev: " | cut -f 4 -d ' '` } function checkDownloadUptodate() { local isGit="true" if [ "$1" = "svn" ]; then isGit="false" fi local finalDestination=$2 local branch_or_tag=$3 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 if [ $isGit = "true" ]; then rev=`get_git_rev $branch_or_tag` else rev=`get_svn_rev` fi 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 findCheckout() { local repo=$1 cd $srcdir || exit 1 if [ -d frameworks/$repo ]; then echo $srcdir/frameworks/$repo elif [ -d kdesupport/$repo ]; then echo $srcdir/kdesupport/$repo || exit 2 elif [ -d $repo ]; then echo $srcdir/$repo else echo "NOT FOUND: $repo" 1>&2 exit 3 fi } function readYamlEntry() { local metainfo=$1 local key=$2 grep ^$key: $metainfo | sed -e "s/$key: //" } function tagModule() { local repo=$1 local basetag=$2 # example "v5.22-rc" (where 5.22 is $version) or "v5.22." (where 5.22 is $previousversion) + local resume=$3 # RESUME (skip if tag exists) or NEW (create new tag) + + if [ "$resume" = "RESUME" ]; then + if [ -n "`git tag -l ${basetag}1`" ]; then + return; + fi + fi # Determine first available tag name local i=1 while [ -n "`git tag -l $basetag$i`" ]; do i=$((i+1)) done local tagname=$basetag$i # Tag the current directory with $tagname $cmd git tag -a $tagname -m "Tag $tagname created by release scripts" || exit 4 $cmd git push origin tag $tagname || exit 5 # Tell pack.sh which tag to use [ -f $releasetools/tags.git ] && sed -i "/^$repo /d" $releasetools/tags.git echo "$repo $tagname" >> $releasetools/tags.git return 0 } diff --git a/version b/version index 799af9e..7c3cf10 100644 --- a/version +++ b/version @@ -1,5 +1,6 @@ # Feb 2017: 5.31 # Mar 2017: 5.32 # Apr 2017: 5.33 -previousversion=5.32.0 -version=5.33.0 +# May 2017: 5.34 +previousversion=5.33.0 +version=5.34.0