Skip to content

Commit 4eb1c6d

Browse files
committed
merge code
1 parent d2c8fa5 commit 4eb1c6d

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

sapi/src/builder/extension/swoole.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -102,36 +102,36 @@
102102
$p->withExportVariable('ZSTD_LIBS', '$(pkg-config --libs --static libzstd)');
103103

104104
/*
105-
$p->withBeforeConfigureScript('swoole', function () use ($p) {
106-
$workDir = $p->getWorkDir();
107-
$shell = "set -x ;cd {$workDir} ; WORKDIR={$workDir} ;" . PHP_EOL;
108-
$shell .= <<<'EOF'
109-
110-
SWOOLE_VERSION=$(awk 'NR==1{ print $1 }' "sapi/SWOOLE-VERSION.conf")
111-
CURRENT_SWOOLE_VERSION=''
112-
113-
if [ -f "ext/swoole/CMakeLists.txt" ] ;then
114-
CURRENT_SWOOLE_VERSION=$(grep 'set(SWOOLE_VERSION' ext/swoole/CMakeLists.txt | awk '{ print $2 }' | sed 's/)//')
115-
if [[ "${CURRENT_SWOOLE_VERSION}" =~ "-dev" ]]; then
116-
echo 'swoole version master'
105+
$p->withBeforeConfigureScript('swoole', function () use ($p) {
106+
$workDir = $p->getWorkDir();
107+
$shell = "set -x ;cd {$workDir} ; WORKDIR={$workDir} ;" . PHP_EOL;
108+
$shell .= <<<'EOF'
109+
110+
SWOOLE_VERSION=$(awk 'NR==1{ print $1 }' "sapi/SWOOLE-VERSION.conf")
111+
CURRENT_SWOOLE_VERSION=''
112+
113+
if [ -f "ext/swoole/CMakeLists.txt" ] ;then
114+
CURRENT_SWOOLE_VERSION=$(grep 'set(SWOOLE_VERSION' ext/swoole/CMakeLists.txt | awk '{ print $2 }' | sed 's/)//')
115+
if [[ "${CURRENT_SWOOLE_VERSION}" =~ "-dev" ]]; then
116+
echo 'swoole version master'
117+
fi
117118
fi
118-
fi
119-
120-
if [ "${SWOOLE_VERSION}" != "${CURRENT_SWOOLE_VERSION}" ] ;then
121-
test -d ext/swoole && rm -rf ext/swoole
122-
if [ ! -f ${WORKDIR}/pool/ext/swoole-${SWOOLE_VERSION}.tgz ] ;then
123-
test -d /tmp/swoole && rm -rf /tmp/swoole
124-
git clone -b "${SWOOLE_VERSION}" https://github.com/swoole/swoole-src.git /tmp/swoole
125-
cd /tmp/swoole
126-
tar -czvf ${WORKDIR}/pool/ext/swoole-${SWOOLE_VERSION}.tgz .
119+
120+
if [ "${SWOOLE_VERSION}" != "${CURRENT_SWOOLE_VERSION}" ] ;then
121+
test -d ext/swoole && rm -rf ext/swoole
122+
if [ ! -f ${WORKDIR}/pool/ext/swoole-${SWOOLE_VERSION}.tgz ] ;then
123+
test -d /tmp/swoole && rm -rf /tmp/swoole
124+
git clone -b "${SWOOLE_VERSION}" https://github.com/swoole/swoole-src.git /tmp/swoole
125+
cd /tmp/swoole
126+
tar -czvf ${WORKDIR}/pool/ext/swoole-${SWOOLE_VERSION}.tgz .
127+
fi
128+
mkdir -p ${WORKDIR}/ext/swoole/
129+
tar --strip-components=1 -C ${WORKDIR}/ext/swoole/ -xf ${WORKDIR}/pool/ext/swoole-${SWOOLE_VERSION}.tgz
127130
fi
128-
mkdir -p ${WORKDIR}/ext/swoole/
129-
tar --strip-components=1 -C ${WORKDIR}/ext/swoole/ -xf ${WORKDIR}/pool/ext/swoole-${SWOOLE_VERSION}.tgz
130-
fi
131-
# swoole extension hook
132-
EOF;
131+
# swoole extension hook
132+
EOF;
133133
134-
return $shell;
135-
});
134+
return $shell;
135+
});
136136
*/
137137
};

0 commit comments

Comments
 (0)