-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsvnbr2e.sh
executable file
·50 lines (39 loc) · 1.04 KB
/
svnbr2e.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/sh
# first check if we're running from a current checkout.
if [ -d .svn ] && [ $# = 0 ]; then
URL=$(svn info | awk '/^URL: /{print $2}')
if echo $URL | grep -q '/unstable/' ; then
BRANCHU="$URL"
BRANCHEXP=$(echo $URL | sed -e 's#/unstable/#/experimental/#')
DOSWITCH=1
fi
fi
# ./svnbr2e.sh [desktop|packages] <package>
gnomesuite=desktop
if [ $# -gt 1 ]
then
if [ "$1" = "packages" ] || [ "$1" = "desktop" ]; then
gnomesuite=$1
shift
fi
fi
if [ $# != 1 ]
then
if [ -z $BRANCHU ] || [ -z $BRANCHEXP ]; then
echo "Usage: $0 [desktop|packages] <package>" >&2
exit 1
fi
fi
package=${1:-current}
BRANCHU=${BRANCHU:-"svn+ssh://svn.debian.org/svn/pkg-gnome/$gnomesuite/unstable/$package"}
BRANCHEXP=${BRANCHEXP:-"svn+ssh://svn.debian.org/svn/pkg-gnome/$gnomesuite/experimental/$package"}
if svn ls "$BRANCHEXP" --depth empty > /dev/null 2>&1 ; then
echo "ERROR: experimental branch already exists!" >&2
exit 1
fi
svn cp -m "Branch $package to experimental" \
$BRANCHU \
$BRANCHEXP
if [ -n $DOSWITCH ]; then
svn switch $BRANCHEXP
fi