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
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Julien Cabieces
otb
Commits
d76c61b8
Commit
d76c61b8
authored
9 years ago
by
Guillaume Pasero
Browse files
Options
Downloads
Plain Diff
Merge branch 'superbuild_archive' into develop
parents
f0a3d85d
3ed890ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+11
-0
11 additions, 0 deletions
CMakeLists.txt
Utilities/Maintenance/SuperbuildDownloadList.sh
+61
-1
61 additions, 1 deletion
Utilities/Maintenance/SuperbuildDownloadList.sh
with
72 additions
and
1 deletion
CMakeLists.txt
+
11
−
0
View file @
d76c61b8
...
...
@@ -392,6 +392,17 @@ endif()
# Provide an option for generating documentation.
add_subdirectory
(
Utilities/Doxygen
)
#----------------------------------------------------------------------
# Provide a target to generate the SuperBuild archive (only for Unix)
if
(
UNIX
)
add_custom_target
(
SuperBuild-archive
COMMAND ./SuperbuildDownloadList.sh
${
OTB_BINARY_DIR
}
/Download
${
OTB_BINARY_DIR
}
WORKING_DIRECTORY
${
OTB_SOURCE_DIR
}
/Utilities/Maintenance
)
endif
()
# TODO cleanup
# Create target to download data from the OTBData group. This must come after
# all tests have been added that reference the group, so we put it last.
...
...
This diff is collapsed.
Click to expand it.
Utilities/Maintenance/SuperbuildDownloadList.sh
+
61
−
1
View file @
d76c61b8
#/bin/bash
grep
-h
-E
"^[^#]*
\"
https?://.*(
\.
tar
\.
gz|
\.
tar
\.
bz2|
\.
tgz|
\.
tar
\.
xz|
\.
zip|export=download).*
\"
"
../../SuperBuild/CMake/
*
.cmake |
grep
-o
-E
"https?://[^
\"
]*"
|
sed
"s/
\/
download
$/
/"
|
sort
|
uniq
if
[
$#
-eq
2
]
;
then
DOWNLOAD_DIR
=
$(
readlink
-f
$1
)
OUTPUT_DIR
=
$(
readlink
-f
$2
)
else
echo
'Usage: '
$0
' <download_directory> <archive_output_directory>'
exit
1
fi
SB_CMAKE_DIR_REL
=
$(
dirname
$0
)
/../../SuperBuild/CMake
SB_CMAKE_DIR
=
$(
readlink
-f
${
SB_CMAKE_DIR_REL
}
)
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
=
mkdir
-p
${
DOWNLOAD_DIR
}
cd
${
DOWNLOAD_DIR
}
echo
"Start downloads..."
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
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"
else
echo
"Download
${
file_name
}
..."
wget
-O
${
file_name
}
${
url
}
-o
download.log
fi
fi
download_errors
=
$(
grep
"ERROR"
download.log
)
if
[
"
$download_errors
"
!=
""
]
;
then
echo
"=== Error downloading
${
file_name
}
==="
cat
download.log
else
if
[
"
$file_name
"
!=
""
]
;
then
DOWNLOAD_NAMES
=
"
${
DOWNLOAD_NAMES
}
${
file_name
}
"
fi
fi
done
rm
download.log
echo
"Create archive..."
cd
${
OUTPUT_DIR
}
tar
-cjf
SuperBuild-archives.tar.bz2
-C
${
DOWNLOAD_DIR
}
${
DOWNLOAD_NAMES
}
echo
"Compute md5sum..."
md5sum
SuperBuild-archives.tar.bz2
>
SuperBuild-archives.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