translation-update-upstream/create-tlst-step2-create-gnome_svn.sh

107 lines
3.8 KiB
Bash

#!/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 SVN projects and adds other known packages.
#
set -o errexit
source ${0%create-tlst-step2-create-gnome_svn.sh}upstream-collect.conf
osc ${OSC_APIURL:+--apisrv=$OSC_APIURL} list $OSC_REPOSITORY >create-tlst-temp-osc-projects.lst
# branches tried for all apps:
KNOWN_BRANCHES="gnome-2-24"
# branches tried apps with the same name base:
APP_BRANCHES="beagle-0.2.16 dia_0_96 dia-0-96 FSPOT_0_5_0_STABLE gimp-2-6"
# 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_svn.sh." >upstream-gnome_svn.tlst
echo "# package domain method repository dir branch" >>upstream-gnome_svn.tlst
SPACES=' '
# listing of all GNOME svn projects
# FIXME: "svn list http://svn.gnome.org/svn/" returns "301 Moved Permanently".
curl http://svn.gnome.org/svn/ | sed -n 's/.*<dir name="\([^"]*\).*/\1/p' |
while read ; do
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
done
done
# Packages known to have special name in svn:
echo gnome-control-center control-center2 control-center-2.0
echo gnome-phone-manager phonemgr gnome-phone-manager
echo network-manager-applet NetworkManager NetworkManager
# For other versions than sles10:
# echo network-manager-applet NetworkManager nm-applet
) |
while read PROJECT PACKAGE DOMAIN ; 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
;;
* )
PO_DIR=po
;;
esac
echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:27-${#DOMAIN}}svn http://svn.gnome.org/svn $PROJECT/$PO_DIR${SPACES:0:26-${#PROJECT}-${#PO_DIR}}zzzz_HEAD"
for BRANCH in $KNOWN_BRANCHES ; do
if svn >/dev/null 2>&1 list http://svn.gnome.org/svn/$PROJECT/branches/$BRANCH ; then
echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:27-${#DOMAIN}}svn http://svn.gnome.org/svn $PROJECT/$PO_DIR${SPACES:0:26-${#PROJECT}-${#PO_DIR}}$BRANCH"
fi
done
for BRANCH in $APP_BRANCHES ; do
LCBRANCH=$(echo $BRANCH | tr A-Z a-z)
if test ${LCBRANCH#$PROJECT} = $LCBRANCH ; then
continue
fi
if svn >/dev/null 2>&1 list http://svn.gnome.org/svn/$PROJECT/branches/$BRANCH ; then
echo "$PACKAGE${SPACES:0:28-${#PACKAGE}}$DOMAIN${SPACES:0:27-${#DOMAIN}}svn http://svn.gnome.org/svn $PROJECT/$PO_DIR${SPACES:0:26-${#PROJECT}-${#PO_DIR}}$BRANCH"
fi
done
# Disabled for now. Final merge will happen in spec file.
# # We want to include LCN only for projects, which need merge with GNOME SVN.
# 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_svn_raw.lst |
LC_COLLATE=C LC_ALL= sort |
sed '
s/ *zzzz_HEAD//
s/zzzz_lcn/lcn/
' >>upstream-gnome_svn.tlst
# Remove temporary progress file:
rm upstream-gnome_svn_raw.lst
rm create-tlst-temp-*