3 # Copyright 2013, Intel Inc.
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; version 2 of the License.
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU Library General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write to the Free Software
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19 #Created on 05 fevr. 2013
21 #@author: ronan@fridu.net
24 PROTODIR=$(spec2yocto working_dir)
29 mkdir -p specfile-initial
31 GIT_CLONE="git cclone"
36 local gitName=$1 gitPath=$2 gitTag=$3 gitServer=$4
38 if [ -d ${gitName}/.git ]; then
41 sed -e 's@+refs/heads/\*@+refs/\*@' .git/config -i
42 git remote prune origin
44 if [ $? == 0 ] ; then ERROR_FETCH_LIST=${ERROR_FETCH_LIST}${gitName}' ' ; fi
47 echo ${GIT_CLONE} $gitServer:$gitPath ${gitName}
48 ${GIT_CLONE} $gitServer:$gitPath ${gitName}
50 sed -e 's@+refs/heads/\*@+refs/\*@' .git/config -i
51 git remote prune origin
53 if [ $? == 0 ] ; then ERROR_CLONE_LIST=${ERROR_CLONE_LIST}${gitName}' ' ; fi
58 spec2yocto manifestToList > /tmp/manifestToList.txt
60 spec2yocto manifestToList | grep $1 > /tmp/manifestToList.txt
65 TOTALPKG=$(cat /tmp/manifestToList.txt | wc -l)
74 cat /tmp/manifestToList.txt |
75 while read gitName gitPath gitTag gitServer; do
78 echo "--------------------------------------------------------------" ${CURPKG}/${TOTALPKG}
79 echo gitName ${gitName}
80 getgit $gitName $gitPath $gitTag $gitServer
83 echo git reset --hard "$gitTag"
84 git reset --hard "$gitTag"
85 if [ $? == 0 ] ; then ERROR_RESET_LIST=${ERROR_RESET_LIST}${gitName}' ' ; fi
88 rm -fr ../specfile-initial/${gitName}/*
89 mkdir -p ../specfile-initial/${gitName}/packaging/
91 SPEC_FILE=$(spec2yocto findBestSpecFile ${gitName}/packaging --package_pn=${gitName})
92 cp ${SPEC_FILE} ../specfile-initial/${gitName}/packaging/
93 if [ $? == 0 ] ; then ERROR_COPYSPEC_LIST=${ERROR_COPYSPEC_LIST}${gitName}' ' ; fi
95 CURPKG=$(( ${CURPKG} +1 ))
98 rm /tmp/manifestToList.txt
102 echo ________________________________________________________________________________
103 echo package git fetch error:
104 for package_error in ${ERROR_FETCH_LIST}; do
105 echo ' '${package_error}
107 echo ________________________________________________________________________________
108 echo package git clone error:
109 for package_error in ${ERROR_CLONE_LIST}; do
110 echo ' '${package_error}
112 echo ________________________________________________________________________________
113 echo package git reset error:
114 for package_error in ${ERROR_RESET_LIST}; do
115 echo ' '${package_error}
117 echo ________________________________________________________________________________
118 echo package copy spec file error:
119 for package_error in ${ERROR_COPYSPEC_LIST}; do
120 echo ' '${package_error}