translation-update-upstream/create-tlst-step2-create-gnome_gtp.sh
OBS User autobuild a725969b2a Accepting request 32330 from Base:System
Copy from Base:System/translation-update-upstream based on submit request 32330 from user coolo

OBS-URL: https://build.opensuse.org/request/show/32330
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/translation-update-upstream?expand=0&rev=6
2010-02-11 18:17:01 +00:00

136 lines
3.9 KiB
Bash
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# This program creates makes dumb guesses about relation of upstream
# projects and openSUSE packages and creates initial configuration file.
#
# It needs osc and net access.
#
# It tries to assign packages to GNOME GTP projects and adds other known packages.
#
set -o errexit
source ${0%create-tlst-step2-create-gnome_gtp.sh}upstream-collect.conf
osc ${OSC_APIURL:+--apiurl=$OSC_APIURL} list $OSC_REPOSITORY >create-tlst-temp-osc-projects.lst
# branches tried for all apps:
KNOWN_BRANCHES="gnome-2-28"
# branches tried apps with the same name base:
APP_BRANCHES="|gimp-2-6|gtk-2-18|gtk-2-90|glib-2-22"
# FIXME: support for libgda:release-3-0-branch gnome-background:gnome-2-22
echo "# This file was generated $(LANG=C LC_ALL=C date) by create-tlst-step2-create-gnome_gtp.sh." >upstream-gnome_gtp.tlst
echo "# package domain method repository dir branch" >>upstream-gnome_gtp.tlst
SPACES=' '
# listing of all GNOME GTP projects
curl http://l10n.gnome.org/POT/ | sed -n 's:^.*href="\([^"]*\)/".*$:\1:p' | sed '/^$/d' |
(
while read ; do
BRANCH=${REPLY##*.}
REPLY=${REPLY%.*}
grep -i ^$REPLY'\( \|\[0-9]\|-[0-9]\|-lang\)' create-tlst-temp-all-po-projects.lst |
while read PACKAGE DOMAIN ; do
if test "${PACKAGE%-lang}/$DOMAIN" = "NetworkManager/nm-applet" ; then
continue
fi
echo $REPLY ${PACKAGE%-lang} $DOMAIN $BRANCH
done
done
# Packages known to have special name in GTP:
for LBRANCH in $KNOWN_BRANCHES master ; do
echo gconf gconf2 GConf2 $LBRANCH
done
echo glib glib2 glib20 master
echo gtk+ gtk2 gtk20 gtk-2-18
echo gtk+ gtk2 gtk20 master
echo gtk+ gtk2 gtk20-properties gtk-2-18
echo gtk+ gtk2 gtk20-properties master
echo gnome-phone-manager phonemgr gnome-phone-manager master
echo network-manager-applet NetworkManager-gnome nm-applet master
# For other versions than sles10:
# echo network-manager-applet NetworkManager nm-applet
) |
while read PROJECT PACKAGE DOMAIN BRANCH ; do
if test -z "$PACKAGE" ; then
continue
fi
# Test, whether package name is also the source name:
if ! grep -q "^$PACKAGE\$" create-tlst-temp-osc-projects.lst ; then
continue
fi
# Projects known to use special directories:
case $DOMAIN in
gimp20-libgimp )
PO_DIR=po-libgimp
;;
gimp20-script-fu )
PO_DIR=po-script-fu
;;
gimp20-python )
PO_DIR=po-python
;;
gimp20-std-plug-ins )
PO_DIR=po-plug-ins
;;
gimp20-tags )
PO_DIR=po-tags
;;
gimp20-tips )
PO_DIR=po-tips
;;
gtk20-properties )
PO_DIR=po-properties
;;
gnumeric-functions )
PO_DIR=po-functions
;;
# FIXME: Only some teams use GTP for gstreamer. Run 'find -name "*-fixes.po"' on processed downstream to find possible regressions.
gst-plugins-base-0.10 )
PROJECT=gst-plugins-base
;;
gst-plugins-good-0.10 )
PROJECT=gst-plugins-good
;;
gst-plugins-bad-0.10 )
PROJECT=gst-plugins-bad
;;
gst-plugins-ugly-0.10 )
PROJECT=gst-plugins-ugly
;;
* )
PO_DIR=po
;;
esac
USE_IT=false
eval "case \"\$BRANCH\" in
$KNOWN_BRANCHES$APP_BRANCHES|master)
USE_IT=true
;;
esac"
if $USE_IT ; then
BRANCH=${BRANCH/master/zzzz_master}
echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:27-${#DOMAIN}}gtp l10n.gnome.org/POT $PROJECT/$PO_DIR${SPACES:0:26-${#PROJECT}-${#PO_DIR}}$BRANCH"
fi
# Disabled for now. Final merge will happen in spec file.
# # We want to include LCN only for projects, which need merge with GNOME GTP.
# if test -d translation-update-lcn/$DOMAIN ; then
# echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:27-${#DOMAIN}}zzzz_lcn"
# fi
done |
tee upstream-gnome_gtp_raw.lst |
LC_COLLATE=C LC_ALL= sort |
sed '
s/ *zzzz_master//
s/zzzz_lcn/lcn/
' >>upstream-gnome_gtp.tlst
# Remove temporary progress file:
rm upstream-gnome_gtp_raw.lst
rm create-tlst-temp-*