forked from cms-sw/cms-bot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import-stitched.sh
executable file
·48 lines (42 loc) · 1.17 KB
/
import-stitched.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
#!/bin/bash -ex
CMSSW_TAG=$1
GIT_RELEASE=$2
DRY_RUN=$3
if [ "X$CMSSW_TAG" = "X" ] ; then
echo "Usage: 0 CMSSW_version"
exit 1
fi
if [ "X$GIT_RELEASE" != "X" ] ; then
scram p $GIT_RELEASE
pushd $GIT_RELEASE
eval `scram runtime -sh`
popd
fi
STITCHED_TAG=$(echo $CMSSW_TAG | sed 's|CMSSW_|STITCHED_|')
git clone [email protected]:cms-sw/Stitched.git
pushd Stitched
HAS_TAG=$(git tag | grep "^$STITCHED_TAG"'$' | wc -l)
if [ $HAS_TAG -gt 0 ] ; then
echo "CMSSW tag $CMSSW_TAG is already ported to stitched repo as $STITCHED_TAG"
exit 0
fi
git checkout --orphan cmssw-tag
git rm -rf .
popd
wget -O ${CMSSW_TAG}.tar.gz https://github.com/cms-sw/cmssw/archive/${CMSSW_TAG}.tar.gz
tar -xzf ${CMSSW_TAG}.tar.gz
rm -f ${CMSSW_TAG}.tar.gz
wget -O packages.txt https://raw.githubusercontent.com/cms-sw/Stitched/master/packages.txt
for pkg in $(cat packages.txt) ; do
mkdir -p Stitched/$(dirname $pkg)
mv cmssw-${CMSSW_TAG}/$pkg Stitched/$pkg
done
rm -rf cmssw-${CMSSW_TAG} ${GIT_RELEASE}
pushd Stitched
git add .
git commit -a -m "Imported new tag $STITCHED_TAG"
git tag $STITCHED_TAG
if [ "X$DRY_RUN" = "X" ] ; then
git push origin $STITCHED_TAG
fi
popd