Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
otb
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sébastien Peillet
otb
Commits
cab84a56
There was an error fetching the commit references. Please try again later.
Commit
cab84a56
authored
8 years ago
by
Rashad Kanavath
Browse files
Options
Downloads
Patches
Plain Diff
SuperBuild: update script
parent
c33863ba
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Utilities/Maintenance/SuperbuildDownloadList.sh
+34
-27
34 additions, 27 deletions
Utilities/Maintenance/SuperbuildDownloadList.sh
with
34 additions
and
27 deletions
Utilities/Maintenance/SuperbuildDownloadList.sh
+
34
−
27
View file @
cab84a56
#/bin/bash
#
!
/bin/bash
export
LC_ALL
=
C
if
[
$#
-eq
2
]
;
then
...
...
@@ -9,9 +9,21 @@ echo 'Usage: '$0' <download_directory> <archive_output_directory>'
exit
1
fi
WGET
=
"wget -nv -q --show-progress --progress=bar"
SB_CMAKE_DIR_REL
=
$(
dirname
$0
)
/../../SuperBuild/CMake
SB_CMAKE_DIR
=
$(
readlink
-f
${
SB_CMAKE_DIR_REL
}
)
cd
$(
dirname
$0
)
/../../
GIT_BRANCH
=
$(
git branch |
sed
-n
-e
's/^\* \(.*\)/\1/p'
)
#if a branch contains release-X.Y then xdk is taken from packages/xdk/OTB-X.Y
if
[[
"
$GIT_BRANCH
"
=
~ release-
*
]]
;
then
VERSION
=
$(
echo
${
GIT_BRANCH
}
|
sed
's/.*release-//'
|
cut
-d
'-'
-f
1
)
else
VERSION
=
"develop"
fi
DOWNLOAD_LIST
=
$(
grep
-h
-E
"^[^#]*
\"
https?://.*(
\.
tar
\.
gz|
\.
tar
\.
bz2|
\.
tgz|
\.
tar
\.
xz|
\.
zip|export=download).*
\"
"
${
SB_CMAKE_DIR
}
/
*
.cmake |
grep
-o
-E
"https?://[^
\"
]*"
|
sed
"s/
\/\(
download
\)\?
$/
/"
|
sort
|
uniq
)
DOWNLOAD_NAMES
=
...
...
@@ -19,51 +31,46 @@ DOWNLOAD_NAMES=
mkdir
-p
${
DOWNLOAD_DIR
}
cd
${
DOWNLOAD_DIR
}
echo
"
Start downloads...
"
echo
"
Downloading files to
${
DOWNLOAD_DIR
}
/
"
for
url
in
${
DOWNLOAD_LIST
}
;
do
# clean log file
echo
""
>
download.log
file_name
=
$(
echo
"
${
url
}
"
|
grep
-o
-E
"[^
\/
]+$"
)
docs_google
=
$(
echo
"
${
file_name
}
"
|
grep
-F
"export=download"
)
if
[
"
${
docs_google
}
"
=
""
]
;
then
echo
"Download
${
file_name
}
..."
wget
-N
${
url
}
-o
download.log
if
[
-f
"
$file_name
"
]
;
then
echo
"
$file_name
exists, skipping"
fi
;
$WGET
-N
${
url
}
ret
=
"
$?
"
if
[
$ret
-gt
0
-a
$ret
-ne
8
]
;
then
echo
"Download failed for URL: '
${
url
}
'. wget finished with exit status '
$ret
'."
exit
1
;
fi
else
# look into the original file for a valid download name
file_name
=
$(
grep
-h
-A
3
-B
3
-F
"
${
url
}
"
${
SB_CMAKE_DIR
}
/
*
.cmake |
grep
-E
"^[^#]*DOWNLOAD_NAME"
|
grep
-o
-E
"[^ ]*
\.
(tar
\.
gz|tar
\.
bz2|tar
\.
xz|zip)"
|
uniq
)
if
[
-z
"
$file_name
"
]
;
then
echo
"Can't find correct filename for url
${
url
}
: skip download"
echo
"Can't find correct filename for url
${
url
}
: skip download"
exit
1
;
else
echo
"Download
${
file_name
}
..."
wget
-O
${
file_name
}
${
url
}
-o
download.log
#
echo "Download ${file_name}..."
$WGET
${
url
}
-O
${
file_name
}
fi
fi
download_errors
=
$(
grep
"ERROR"
download.log
)
if
[
"
$download_errors
"
!=
""
]
;
then
echo
"[OTB] Error downloading
${
file_name
}
"
echo
"[OTB] Check your internet connectivity first!."
echo
"[OTB] Check your firewall or proxy settings and then try again."
echo
"[OTB] If you find that
${
url
}
is unavailable,"
echo
" please file a bug immediately on bugs.orfeo-toolbox.org."
echo
" "
cat
download.log
exit
1
else
if
[
"
$file_name
"
!=
""
]
;
then
if
[
"
$file_name
"
!=
""
]
;
then
DOWNLOAD_NAMES
=
"
${
DOWNLOAD_NAMES
}
${
file_name
}
"
fi
fi
done
rm
download.log
done
echo
"Create archive..."
ARCHIVE_NAME
=
"SuperBuild-archives-
$VERSION
"
echo
"Creating archive
${
OUTPUT_DIR
}
/
$ARCHIVE_NAME
.tar.bz2"
cd
${
OUTPUT_DIR
}
tar
-cjf
SuperBuild-archives
.tar.bz2
-C
${
DOWNLOAD_DIR
}
${
DOWNLOAD_NAMES
}
tar
-cjf
$ARCHIVE_NAME
.tar.bz2
-C
${
DOWNLOAD_DIR
}
${
DOWNLOAD_NAMES
}
echo
"
Compute md5sum...
"
md5sum
SuperBuild-archives.tar.bz2
>
SuperBuild-archives
.md5
echo
"
Saving md5sum to
${
OUTPUT_DIR
}
/
$ARCHIVE_NAME
.md5
"
md5sum
$ARCHIVE_NAME
.tar.bz2
>
$ARCHIVE_NAME
.md5
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment