Skip to content

Commit 55340e7

Browse files
committed
[build] Allow forward slashes in hst_autocompile.sh and v-update-sys-hestia-git
1 parent 2df36e2 commit 55340e7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

bin/v-update-sys-hestia-git

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ download_file() {
5353
BUILD_DIR='/tmp/hestiacp-src/'
5454
DEB_DIR="$BUILD_DIR/debs/"
5555
INSTALL_DIR='/usr/local/hestia'
56+
ARCHIVE_DIR="${BUILD_DIR}/archive/"
5657

5758
# Set command variables
5859
branch=$1
@@ -71,6 +72,7 @@ PHP_V='7.3.4'
7172
# Create build directories
7273
rm -rf $BUILD_DIR
7374
mkdir -p $DEB_DIR
75+
mkdir -p $ARCHIVE_DIR
7476

7577
# Set package dependencies for compiling
7678
SOFTWARE='build-essential libxml2-dev libz-dev libcurl4-gnutls-dev unzip openssl libssl-dev pkg-config'
@@ -126,13 +128,15 @@ HESTIA_B='true'
126128
GIT_REP='https://raw.githubusercontent.com/hestiacp/hestiacp/'$branch'/src/deb'
127129

128130
# Generate Links for sourcecode
129-
HESTIA_ARCHIVE_LINK='https://github.com/hestiacp/hestiacp/archive/'$branch'.zip'
131+
HESTIA_ARCHIVE_LINK='https://github.com/hestiacp/hestiacp/archive/'$branch'.tar.gz'
130132
NGINX='https://nginx.org/download/nginx-'$NGINX_V'.tar.gz'
131133
OPENSSL='https://www.openssl.org/source/openssl-'$OPENSSL_V'.tar.gz'
132134
PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
133135
ZLIB='https://www.zlib.net/zlib-'$ZLIB_V'.tar.gz'
134136
PHP='http://de2.php.net/distributions/php-'$PHP_V'.tar.gz'
135137

138+
# Forward slashes in branchname are replaced with dashes to match foldername in github archive.
139+
branch=$(echo "$branch" |sed 's/\//-/g');
136140

137141
#################################################################################
138142
#
@@ -327,9 +331,7 @@ if [ "$HESTIA_B" = true ] ; then
327331
mkdir $BUILD_DIR/hestia_$HESTIA_V
328332

329333
# Download and unpack source files
330-
download_file $HESTIA_ARCHIVE_LINK
331-
unzip -q $branch.zip
332-
rm $branch.zip
334+
download_file $HESTIA_ARCHIVE_LINK '-' 'fresh' | tar xz
333335

334336
# Prepare Deb Package Folder Structure
335337
cd hestia_$HESTIA_V/
@@ -345,7 +347,7 @@ if [ "$HESTIA_B" = true ] ; then
345347
chmod +x postinst
346348

347349
# Move needed directories
348-
cd ../../hestiacp-$branch
350+
cd $BUILD_DIR/hestiacp-$branch
349351
mv bin func install web ../hestia_$HESTIA_V/usr/local/hestia/
350352

351353
# Set permission

src/hst_autocompile.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,8 @@ PCRE='https://ftp.pcre.org/pub/pcre/pcre-'$PCRE_V'.tar.gz'
182182
ZLIB='https://www.zlib.net/zlib-'$ZLIB_V'.tar.gz'
183183
PHP='http://de2.php.net/distributions/php-'$PHP_V'.tar.gz'
184184

185+
# Forward slashes in branchname are replaced with dashes to match foldername in github archive.
186+
branch=$(echo "$branch" |sed 's/\//-/g');
185187

186188
#################################################################################
187189
#

0 commit comments

Comments
 (0)