Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
aae0c90d
Commit
aae0c90d
authored
May 27, 2016
by
Tim Hockin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Abort if we can't find a license
parent
392c5dc6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
12 deletions
+14
-12
update-godep-licenses.sh
hack/update-godep-licenses.sh
+14
-12
No files found.
hack/update-godep-licenses.sh
View file @
aae0c90d
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
# Update the Godeps/LICENSES
.md
document.
# Update the Godeps/LICENSES document.
# Generates a table of Godep dependencies and their license.
# Generates a table of Godep dependencies and their license.
#
#
# Usage:
# Usage:
...
@@ -117,6 +117,7 @@ LICENSE_ROOT="${LICENSE_ROOT:-${KUBE_ROOT}}"
...
@@ -117,6 +117,7 @@ LICENSE_ROOT="${LICENSE_ROOT:-${KUBE_ROOT}}"
cd
"
${
LICENSE_ROOT
}
"
cd
"
${
LICENSE_ROOT
}
"
GODEPS_LICENSE_FILE
=
"Godeps/LICENSES"
GODEPS_LICENSE_FILE
=
"Godeps/LICENSES"
TMP_LICENSE_FILE
=
"/tmp/Godeps.LICENSES.
$$
"
DEPS_DIR
=
"vendor"
DEPS_DIR
=
"vendor"
declare
-Ag
CONTENT
declare
-Ag
CONTENT
...
@@ -129,7 +130,7 @@ cat ${LICENSE_ROOT}/LICENSE
...
@@ -129,7 +130,7 @@ cat ${LICENSE_ROOT}/LICENSE
echo
echo
echo
"= LICENSE
$(
cat
${
LICENSE_ROOT
}
/LICENSE |
md5sum
)
"
echo
"= LICENSE
$(
cat
${
LICENSE_ROOT
}
/LICENSE |
md5sum
)
"
echo
"================================================================================"
echo
"================================================================================"
)
>
${
GODEPS
_LICENSE_FILE
}
)
>
${
TMP
_LICENSE_FILE
}
# Loop through every package in Godeps.json
# Loop through every package in Godeps.json
for
PACKAGE
in
$(
cat
Godeps/Godeps.json |
\
for
PACKAGE
in
$(
cat
Godeps/Godeps.json |
\
...
@@ -144,21 +145,22 @@ for PACKAGE in $(cat Godeps/Godeps.json | \
...
@@ -144,21 +145,22 @@ for PACKAGE in $(cat Godeps/Godeps.json | \
echo
"=
${
DEPS_DIR
}
/
${
PACKAGE
}
licensed under: ="
echo
"=
${
DEPS_DIR
}
/
${
PACKAGE
}
licensed under: ="
echo
echo
content
=
""
file
=
""
if
[[
-n
"
${
CONTENT
[
${
PACKAGE
}
-LICENSE]-
}
"
]]
;
then
if
[[
-n
"
${
CONTENT
[
${
PACKAGE
}
-LICENSE]-
}
"
]]
;
then
content
=
"
${
CONTENT
[
${
PACKAGE
}
-LICENSE]-
}
"
file
=
"
${
CONTENT
[
${
PACKAGE
}
-LICENSE]-
}
"
elif
[[
-n
"
${
CONTENT
[
${
PACKAGE
}
-COPYRIGHT]-
}
"
]]
;
then
elif
[[
-n
"
${
CONTENT
[
${
PACKAGE
}
-COPYRIGHT]-
}
"
]]
;
then
content
=
"
${
CONTENT
[
${
PACKAGE
}
-COPYRIGHT]-
}
"
file
=
"
${
CONTENT
[
${
PACKAGE
}
-COPYRIGHT]-
}
"
fi
fi
if
[[
-z
"
${
content
}
"
]]
;
then
if
[[
-z
"
${
file
}
"
]]
;
then
echo
"UNKNOWN"
echo
"Could not find a license for
${
PACKAGE
}
- aborting"
>
/dev/stderr
content
=
"/dev/null"
exit
9
else
cat
"
${
content
}
"
fi
fi
cat
"
${
file
}
"
echo
echo
echo
"=
${
content
}
$(
cat
${
content
}
|
md5sum
)
"
echo
"=
${
file
}
$(
cat
${
file
}
|
md5sum
)
"
echo
"================================================================================"
echo
"================================================================================"
echo
echo
done
>>
${
GODEPS_LICENSE_FILE
}
done
>>
${
TMP_LICENSE_FILE
}
cat
${
TMP_LICENSE_FILE
}
>
${
GODEPS_LICENSE_FILE
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment