@@ -93,7 +93,6 @@ o:tegra/v4l2-src/v4l2_libs:nv-tegra.nvidia.com/tegra/v4l2-src/v4l2_libs.git:
9393"
9494
9595# exit on error on sync
96- EOE=0
9796# after processing SOURCE_INFO
9897NSOURCES=0
9998declare -a SOURCE_INFO_PROCESSED
@@ -111,9 +110,8 @@ function Usages {
111110 echo " Use: $1 [options]"
112111 echo " Available general options are,"
113112 echo " -h : help"
114- echo " -e : exit on sync error"
115113 echo " -d [DIR] : root of source is DIR"
116- echo " -t [TAG] : Git tag that will be used to sync all the sources"
114+ echo " -t [TAG] : git tag that will be used to sync all the sources"
117115 echo " "
118116 echo " By default, all sources are downloaded."
119117 echo " Only specified sources are downloaded, if one or more of the following options are mentioned."
@@ -184,21 +182,17 @@ function DownloadAndSync {
184182 if ! git status 2>&1 > /dev/null; then
185183 echo " But the directory is not a git repository -- clean it up first"
186184 echo " "
187- echo " "
188185 popd > /dev/null
189- return 1
186+ return 2
190187 fi
191188 git fetch --all 2>&1 > /dev/null
192189 popd > /dev/null
193190 else
194- echo " Downloading default $WHAT source ..."
191+ echo " Downloading default $WHAT source3 ..."
195192
196- git clone " $REPO_URL " -n ${LDK_SOURCE_DIR} 2>&1 > /dev/null
197- if [ $? -ne 0 ]; then
198- echo " $2 source sync failed!"
199- echo " "
200- echo " "
201- return 2
193+ if ! git clone " $REPO_URL " -n ${LDK_SOURCE_DIR} > /dev/null; then
194+ echo " $2 source sync failed"
195+ return 1
202196 fi
203197
204198 echo " The default $WHAT source is downloaded in: ${LDK_SOURCE_DIR} "
@@ -212,19 +206,19 @@ function DownloadAndSync {
212206 UpdateTags $OPT $TAG
213207 fi
214208
215- if [ ! -z " $TAG " ]; then
216- if [ -z $( git -C $LDK_SOURCE_DIR tag -l " ^$TAG \$ " ) ]; then
209+ if [[ -n " $TAG " ] ]; then
210+ if [ -n $( git -C $LDK_SOURCE_DIR tag -l " ^$TAG \$ " ) ]; then
217211 echo " Syncing up with tag $TAG ..."
218212 if git -C $LDK_SOURCE_DIR checkout -b mybranch_$( date +%Y-%m-%d-%s) $TAG ; then
219- echo " $2 source sync'ed to tag $TAG successfully!"
220- else
221- echo " $2 could not sync to tag $TAG !"
222- return 3
223- fi
213+ echo " $2 source sync'ed to tag $TAG successfully!"
214+ else
215+ echo " $2 could not sync to tag $TAG !"
216+ return 3
217+ fi
224218 else
225219 echo " Couldn't find tag $TAG "
226220 echo " $2 source sync to tag $TAG failed!"
227- return 4
221+ return 4
228222 fi
229223 fi
230224 echo " "
@@ -259,9 +253,6 @@ while getopts "$GETOPT" opt; do
259253 ;;
260254 esac
261255 ;;
262- e)
263- EOE=1
264- ;;
265256 h)
266257 Usages " $SCRIPT_NAME "
267258 exit 1
@@ -327,10 +318,13 @@ for ((i=0; i < NSOURCES; i++)); do
327318 DNLOAD=$( echo " ${SOURCE_INFO_PROCESSED[i]} " | cut -f 5 -d ' :' )
328319
329320 if [ $DALL -eq 1 -o " x${DNLOAD} " == " xy" ]; then
330- DownloadAndSync " $WHAT " " ${LDK_DIR} /${WHAT} " " https://${REPO} " " ${TAG} " " ${OPT} "
321+ if ! DownloadAndSync " $WHAT " " ${LDK_DIR} /${WHAT} " " https://${REPO} " " ${TAG} " " ${OPT} " ; then
322+ if [[ $? == 1 ]]; then
323+ echo " Trying git protocol"
324+ DownloadAndSync " $WHAT " " ${LDK_DIR} /${WHAT} " " git://${REPO} " " ${TAG} " " ${OPT} "
325+ fi
326+ fi
331327 fi
332328done
333329
334330ln -sf ../../../../../../nvethernetrm ${LDK_DIR} /nvidia-oot/drivers/net/ethernet/nvidia/nvethernet/nvethernetrm
335-
336- exit 0
0 commit comments