Newer
Older
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/bin/bash
# This file is part of nexdatas - Tango Server for NeXus data writer
#
# Copyright (C) 2017-2017 DESY, Jan Kotanski <jkotan@mail.desy.de>
#
# nexdatas is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# nexdatas is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with nexdatas. If not, see <http://www.gnu.org/licenses/>.
#
for i in "${@:1}"
do
if [[ $i == -* ]] ; then
case $i in
-h=*|--help=*)
HELP=YES
;;
-e=*|--email=*)
EMAIL="${i#*=}"
;;
-f=*|--fullname=*)
FULLNAME="${i#*=}"
;;
-u=*|--user=*)
export USER="${i#*=}"
;;
-r=*|--release=*)
export RELEASE="${i#*=}"
;;
-ne|--nodebenv)
export NODEBENV=YES
;;
-p|--patch)
export PATCH=YES
;;
*)
# unknown option
;;
esac
else
export PACKAGE=$1
fi
done
DEFRELEASE=jessie
if [[ ! -z $HELP ]] && [[ -z $PACKAGE ]] ; then
echo "Error: PACKAGE variable is not defined"
fi
if [[ ! -z $HELP ]] || [[ -z $PACKAGE ]] ; then
echo "usage: pidpclone <DEB-PACKAGE-NAME> [-p|--patch] [-u=<USER>] [-h|--help]"
echo " [-e=<DEBEMAIL>] [-f=<DEBFULLNAME>] [-ne|--nodebenv] "
echo ""
echo "clone the debian package repository from stash into the local directory"
echo "and start the patching procedure if the --patch option is given"
echo "(see also pidpbuild)"
echo ""
echo "possible arguments:"
echo " DEB-PACKAGE-NAME debian package name (mandatory)"
echo ""
echo "optional arguments:"
echo " -h, --help show this help message and exit"
echo " -p, --patch start the patching procedure"
echo " -u=, --user= stash user name"
echo " (default: the local user name)"
echo " -ne, --nodebenv don't set default DEBFULLNAME and DEBEMAIL"
echo " -f=, --fullname= debian fullname of the gpg signature,"
echo " i.e. DEBFULLNAME"
echo " -e=, --email= debian email of the gpg signature,"
echo " i.e. DEBEMAIL"
echo ""
echo "examples:"
echo " pidpclone python-nxstools-extras-p09 --patch"
echo " pidpclone python-nxstools-extras-p06"
echo ""
else
if [ -z $NODEBENV ] ; then
export DEBEMAIL="jankotan@gmail.com"
export DEBFULLNAME="Jan Kotanski (jkotan)"
fi
if [[ ! -z $FULLNAME ]] ; then
export DEBFULLNAME=$FULLNAME
fi
if [[ ! -z $EMAIL ]] ; then
export DEBEMAIL=$EMAIL
fi
if [ -z $USER ] ; then
export USER=$(whoami)
fi
if [ -z $RELEASE ] ; then
export RELEASE=$DEFRELEASE
fi
git clone https://$USER@stash.desy.de/scm/pidp/$PACKAGE.git
cd $PACKAGE
git fetch --all
git checkout -b upstream/$RELEASE origin/upstream/$RELEASE
git checkout -b pristine-tar origin/pristine-tar
git checkout debian/$RELEASE 2> /dev/null
if ! [[ $? -eq 0 ]]; then
git checkout -b debian/$RELEASE origin/debian/$RELEASE
fi
export PIDTOKILL=$$
if [ -z $PATCH ] ; then
echo ""
echo "1) Edit the debian/ configuration"
echo "2) Commit your changes"
echo "3) Execute pidpbuild"
else
gbp pq import
export IMPORT=YES
export PIDTOKILL=$$
echo ""
echo "1) Edit the source files"
echo "2) Commit your changes"
echo "3) Execute pidpbuild"
fi
exec bash
fi