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-06-13 12:17:13 +0300
committernachoparker <nacho@ownyourbits.com>2017-06-28 08:15:40 +0300
commitecedf913065834e0d00fa3dc2ab73d1a66d4d572 (patch)
tree75937826ccf1595ca3f2ebd09354d3831f1875ac
parent338adfb1e3aac67f7de423ab962b84ac1aad3265 (diff)
check version formatv0.12.18
-rwxr-xr-xbin/ncp-check-version7
-rwxr-xr-xbin/ncp-update10
-rw-r--r--nextcloudpi.sh10
-rw-r--r--test-devel.sh8
4 files changed, 22 insertions, 13 deletions
diff --git a/bin/ncp-check-version b/bin/ncp-check-version
index 2db1abe7..cc0936f0 100755
--- a/bin/ncp-check-version
+++ b/bin/ncp-check-version
@@ -6,10 +6,13 @@
ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }
-git clone -q --depth 1 https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1
+git clone -q --bare https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-check-tmp || exit 1
cd /tmp/ncp-check-tmp
-git describe --always --tags > /var/run/.ncp-latest-version
+VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
+grep -qP "v\d+\.\d+\.\d+" <<< $VER && { # check format
+ echo $VER > /var/run/.ncp-latest-version
+}
cd /
rm -rf /tmp/ncp-check-tmp
diff --git a/bin/ncp-update b/bin/ncp-update
index 3d21709f..8330cf06 100755
--- a/bin/ncp-update
+++ b/bin/ncp-update
@@ -7,15 +7,17 @@
ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }
echo -e "Downloading updates"
rm -rf /tmp/ncp-update-tmp
- git clone -q --depth 1 https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1
+ git clone -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1
cd /tmp/ncp-update-tmp
echo -e "Performing updates"
./update.sh
- VER=$( git describe --always --tags )
- echo $VER > /usr/local/etc/ncp-version
- echo $VER > /var/run/.ncp-latest-version
+ VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
+ grep -qP "v\d+\.\d+\.\d+" <<< $VER && { # check format
+ echo $VER > /usr/local/etc/ncp-version
+ echo $VER > /var/run/.ncp-latest-version
+ }
cd /
rm -rf /tmp/ncp-update-tmp
diff --git a/nextcloudpi.sh b/nextcloudpi.sh
index d56b3133..bdfb36fd 100644
--- a/nextcloudpi.sh
+++ b/nextcloudpi.sh
@@ -96,15 +96,17 @@ cat > /usr/local/bin/ncp-update <<'EOF'
ping -W 2 -w 1 -q github.com &>/dev/null || { echo "No internet connectivity"; exit 1; }
echo -e "Downloading updates"
rm -rf /tmp/ncp-update-tmp
-git clone -q --depth 1 https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1
+git clone -q https://github.com/nextcloud/nextcloudpi.git /tmp/ncp-update-tmp || exit 1
cd /tmp/ncp-update-tmp
echo -e "Performing updates"
./update.sh
-VER=$( git describe --always --tags )
-echo $VER > /usr/local/etc/ncp-version
-echo $VER > /var/run/.ncp-latest-version
+VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
+grep -qP "v\d+\.\d+\.\d+" <<< $VER && { # check format
+ echo $VER > /usr/local/etc/ncp-version
+ echo $VER > /var/run/.ncp-latest-version
+}
cd /
rm -rf /tmp/ncp-update-tmp
diff --git a/test-devel.sh b/test-devel.sh
index f193ec9b..a844a8f6 100644
--- a/test-devel.sh
+++ b/test-devel.sh
@@ -26,9 +26,11 @@ install()
echo -e "Performing updates"
./update.sh
- VER=$( git describe --always --tags )
- echo $VER > /usr/local/etc/ncp-version
- echo $VER > /var/run/.ncp-latest-version
+ VER=$( git describe --always --tags | grep -oP "v\d+\.\d+\.\d+" )
+ grep -qP "v\d+\.\d+\.\d+" <<< $VER && { # check format
+ echo $VER > /usr/local/etc/ncp-version
+ echo $VER > /var/run/.ncp-latest-version
+ }
cd /
rm -rf /tmp/ncp-update-tmp