Merge branch 'dev' into fix-#1886

This commit is contained in:
OniriCorpe 2024-07-02 21:52:10 +02:00 committed by GitHub
commit 2edb6ad625
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 7 deletions

7
debian/changelog vendored
View file

@ -1,3 +1,10 @@
yunohost (11.2.20.1) stable; urgency=low
- helpers2.1: typo (1ed56952e)
- helpers2.1: add unit tests (92807afb1)
-- Alexandre Aubin <alex.aubin@mailoo.org> Mon, 01 Jul 2024 23:38:29 +0200
yunohost (11.2.20) stable; urgency=low yunohost (11.2.20) stable; urgency=low
- helpers2.1: fix automigration of phpversion to php_version (3f973669) - helpers2.1: fix automigration of phpversion to php_version (3f973669)

View file

@ -130,7 +130,7 @@ EOF
! _read_py "$file" "NONEXISTENT" ! _read_py "$file" "NONEXISTENT"
test "$(ynh_read_var_in_file --file="$file" --key="NONEXISTENT")" == "YNH_NULL" test "$(ynh_read_var_in_file --file="$file" --key="NONEXISTENT")" == "YNH_NULL"
! ynh_write_var_in_file --file="$file" --key="ENABLE" -value="foobar" ! ynh_write_var_in_file --file="$file" --key="ENABLE" --value="foobar"
! _read_py "$file" "ENABLE" ! _read_py "$file" "ENABLE"
test "$(ynh_read_var_in_file --file="$file" --key="ENABLE")" == "YNH_NULL" test "$(ynh_read_var_in_file --file="$file" --key="ENABLE")" == "YNH_NULL"

View file

@ -1,17 +1,17 @@
_make_dummy_manifest() { _make_dummy_manifest() {
if [ ! -e $HTTPSERVER_DIR/dummy.tar.gz ] if [ ! -e $HTTPSERVER_DIR/dummy.tar.gz ]
then then
pushd "$HTTPSERVER_DIR" pushd "$HTTPSERVER_DIR" >/dev/null
mkdir dummy mkdir dummy
pushd dummy pushd dummy >/dev/null
echo "Lorem Ipsum" > index.html echo "Lorem Ipsum" > index.html
echo '{"foo": "bar"}' > conf.json echo '{"foo": "bar"}' > conf.json
mkdir assets mkdir assets
echo '.some.css { }' > assets/main.css echo '.some.css { }' > assets/main.css
echo 'var some="js";' > assets/main.js echo 'var some="js";' > assets/main.js
popd popd >/dev/null
tar -czf dummy.tar.gz dummy tar -czf dummy.tar.gz dummy >/dev/null
popd popd >/dev/null
fi fi
cat << EOF cat << EOF
@ -38,16 +38,17 @@ ynhtest_setup_source_nominal() {
test -e "$install_dir" test -e "$install_dir"
test -e "$install_dir/index.html" test -e "$install_dir/index.html"
test -e "$install_dir/assets"
ls -ld "$install_dir" | grep -q "drwxr-x--- . $app www-data" ls -ld "$install_dir" | grep -q "drwxr-x--- . $app www-data"
ls -l "$install_dir/index.html" | grep -q "\-rw-r----- . $app www-data" ls -l "$install_dir/index.html" | grep -q "\-rw-r----- . $app www-data"
ls -ld "$install_dir/assets" | grep -q "drwxr-x--- . $app www-data"
} }
ynhtest_setup_source_no_group_in_manifest() { ynhtest_setup_source_no_group_in_manifest() {
install_dir="$(mktemp -d -p $VAR_WWW)" install_dir="$(mktemp -d -p $VAR_WWW)"
_make_dummy_manifest > ../manifest.toml _make_dummy_manifest > ../manifest.toml
sed '/www-data/d' -i ../manifest.toml sed '/www-data/d' -i ../manifest.toml
cat ../manifest.toml # debug
ynh_setup_source --dest_dir="$install_dir" --source_id="dummy" ynh_setup_source --dest_dir="$install_dir" --source_id="dummy"
@ -56,6 +57,7 @@ ynhtest_setup_source_no_group_in_manifest() {
ls -ld "$install_dir" | grep -q "drwxr-x--- . $app $app" ls -ld "$install_dir" | grep -q "drwxr-x--- . $app $app"
ls -l "$install_dir/index.html" | grep -q "\-rw-r----- . $app $app" ls -l "$install_dir/index.html" | grep -q "\-rw-r----- . $app $app"
ls -ld "$install_dir/assets" | grep -q "drwxr-x--- . $app $app"
} }