include all source not just GPL

Signed-off-by: Justin Cormack <justin.cormack@docker.com>
This commit is contained in:
Justin Cormack 2016-03-22 11:23:55 +00:00
parent e734661558
commit dfd70a1d1d
4 changed files with 22 additions and 24 deletions

View File

@ -4,6 +4,6 @@ RUN apk update && apk add lua git
RUN git clone https://github.com/alpinelinux/aports.git
ADD license.sh gpl.lua /usr/bin/
ADD license.sh packages.lua /usr/bin/
CMD license.sh

View File

@ -1,12 +1,9 @@
Extract GPL source from Moby
Extract source from Moby
WORK IN PROGRESS SOME ISSUES STILL
This container runs on a Pinata system and dumps out the GPL code it is running
This container runs on a Pinata system and dumps out the source code for the
kernel and packages
```
docker build -t license .
docker run -it -v /etc:/hostetc -v /lib:/lib -v $PWD/output:/output license
```
TODO add kernel to this, there is now a patch to get the metadata in.

View File

@ -1,5 +1,5 @@
#!/bin/sh
set -x
cat /hostetc/issue | grep -q Moby || ( printf "You must run this script with -v /etc:/hostetc -v /lib:/lib\n" && exit 1 )
apk info | grep -q fuse || ( printf "You must run this script with -v /etc:/etc -v /lib:/lib\n" && exit 1 )
@ -29,7 +29,7 @@ rm -rf .git
cd /aports
git pull
gpl.lua | while read l
packages.lua | while read l
do
echo $l
APORT_PACKAGE=$(echo $l | sed 's/ .*//')
@ -42,17 +42,20 @@ do
export srcdir=/output
cd main/${APORT_ORIGIN}
. ./APKBUILD
mkdir -p "$srcdir"/$pkgname-$pkgver
for f in $source
do
if [ -f $f ]
then
cp -a $f "$srcdir"/$pkgname-$pkgver/
else
( cd "$srcdir"/$pkgname-$pkgver && \
wget $f || ( printf "Cannot retrieve $f\n" && exit )
)
fi
done
if [ ! -d "$srcdir"/$pkgname-$pkgver ]
then
mkdir -p "$srcdir"/$pkgname-$pkgver
for f in $source
do
if [ -f $f ]
then
cp -a $f "$srcdir"/$pkgname-$pkgver/
else
cd "$srcdir"/$pkgname-$pkgver && \
wget $f || ( printf "Cannot retrieve $f\n" && exit ) && \
cd -
fi
done
fi
)
done

View File

@ -5,9 +5,7 @@ f = io.open("/lib/apk/db/installed")
for line in f:lines() do
if line == "" then
if p.L:match("[Gg][Pg][Ll]") then
print(p.P, p.L, p.c)
end
print(p.P, p.L, p.c)
p = {}
else
k, v = line:match("(%a):(.*)")