Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/nextcloudpi.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornachoparker <nacho@ownyourbits.com>2017-12-05 14:35:25 +0300
committernachoparker <nacho@ownyourbits.com>2017-12-05 14:35:25 +0300
commit89f77e7e02b95534972fdb4eb0af2e7e6af3ecb5 (patch)
tree64085d160c1e0d4ab6f2c37059ea112a25407919
parent30c34d8162f48c976b896141586174e916378369 (diff)
build: cleanup all extras
-rw-r--r--armbian.sh7
-rw-r--r--docker-armhf/nextcloudpi/Dockerfile38
-rwxr-xr-xetc/library.sh14
-rw-r--r--etc/nextcloudpi-config.d/letsencrypt.sh37
-rw-r--r--raspbian-cleanup.sh7
5 files changed, 69 insertions, 34 deletions
diff --git a/armbian.sh b/armbian.sh
index c63773f2..1dffa1d9 100644
--- a/armbian.sh
+++ b/armbian.sh
@@ -49,6 +49,13 @@ Main() {
rm /var/lib/apt/lists/* -r
rm /.ncp-image
+ # cleanup all NCP options
+ source /usr/local/etc/library.sh
+ cd /usr/local/etc/nextcloudpi-config.d/
+ for script in *.sh; do
+ cleanup_script $script
+ done
+
;;
esac
} # Main
diff --git a/docker-armhf/nextcloudpi/Dockerfile b/docker-armhf/nextcloudpi/Dockerfile
index f62ceec5..c3b58663 100644
--- a/docker-armhf/nextcloudpi/Dockerfile
+++ b/docker-armhf/nextcloudpi/Dockerfile
@@ -31,40 +31,10 @@ rm /.ncp-image; \
# remove wizard for now
rm -r /var/www/ncp-web/wizard; \
-# letsencrypt build artifacts cleanup
-apt-get purge -y \
- make \
- git \
- augeas-lenses \
- binutils \
- cpp \
- cpp-6 \
- gcc \
- gcc-6 \
- libasan3 \
- libaugeas0 \
- libc-dev-bin \
- libc6-dev \
- libcc1-0 \
- libexpat1-dev \
- libffi-dev \
- libgcc-6-dev \
- libgomp1 \
- libisl15 \
- libmpc3 \
- libpython-dev \
- libpython2.7-dev \
- libssl-dev \
- libubsan0 \
- linux-libc-dev \
- python-dev \
- python-virtualenv \
- python2.7-dev \
- python-pkg-resources \
- python3-pkg-resources \
- python3-virtualenv \
- virtualenv \
- python-pip-whl; \
+# cleanup all NCP extras
+source /usr/local/etc/library.sh; \
+cd /usr/local/etc/nextcloudpi-config.d/; \
+for script in *.sh; do cleanup_script $script done; \
# package clean up
apt-get autoremove -y; \
diff --git a/etc/library.sh b/etc/library.sh
index a577c2f1..06e19650 100755
--- a/etc/library.sh
+++ b/etc/library.sh
@@ -144,6 +144,20 @@ function configure_script()
)
}
+function cleanup_script()
+{
+ (
+ local SCRIPT=$1
+ cd /usr/local/etc/nextcloudpi-config.d/ || return 1
+ unset cleanup
+ source ./"$SCRIPT"
+ [[ $( type -t cleanup ) == function ]] && {
+ cleanup
+ return $?
+ }
+ )
+}
+
function persistent_cfg()
{
local SRC="$1"
diff --git a/etc/nextcloudpi-config.d/letsencrypt.sh b/etc/nextcloudpi-config.d/letsencrypt.sh
index 0c7d3fa7..7fcd0697 100644
--- a/etc/nextcloudpi-config.d/letsencrypt.sh
+++ b/etc/nextcloudpi-config.d/letsencrypt.sh
@@ -86,6 +86,43 @@ configure()
return 1
}
+cleanup()
+{
+ apt-get purge -y \
+ make \
+ git \
+ augeas-lenses \
+ binutils \
+ cpp \
+ cpp-6 \
+ gcc \
+ gcc-6 \
+ libasan3 \
+ libaugeas0 \
+ libc-dev-bin \
+ libc6-dev \
+ libcc1-0 \
+ libexpat1-dev \
+ libffi-dev \
+ libgcc-6-dev \
+ libgomp1 \
+ libisl15 \
+ libmpc3 \
+ libpython-dev \
+ libpython2.7-dev \
+ libssl-dev \
+ libubsan0 \
+ linux-libc-dev \
+ python-dev \
+ python-virtualenv \
+ python2.7-dev \
+ python-pkg-resources \
+ python3-pkg-resources \
+ python3-virtualenv \
+ virtualenv \
+ python-pip-whl
+}
+
# License
#
# This script is free software; you can redistribute it and/or modify it
diff --git a/raspbian-cleanup.sh b/raspbian-cleanup.sh
index 77a66247..c030f8a4 100644
--- a/raspbian-cleanup.sh
+++ b/raspbian-cleanup.sh
@@ -19,6 +19,13 @@ configure() { :; }
cleanup()
{
+ # cleanup all NCP extras
+ source /usr/local/etc/library.sh
+ cd /usr/local/etc/nextcloudpi-config.d/
+ for script in *.sh; do
+ cleanup_script $script
+ done
+
# clean packages
apt-get autoremove -y
apt-get clean