From 2988e5960910196ed86cc2fdbf98be665d539a85 Mon Sep 17 00:00:00 2001 From: Fabian Wilkens Date: Sun, 12 Jun 2022 15:24:13 +0200 Subject: [PATCH] Update: Add app.src and modify install and upgrade script --- conf/app.src | 7 +++++++ scripts/install | 15 +-------------- scripts/upgrade | 18 ++---------------- 3 files changed, 10 insertions(+), 30 deletions(-) create mode 100644 conf/app.src diff --git a/conf/app.src b/conf/app.src new file mode 100644 index 0000000..5687965 --- /dev/null +++ b/conf/app.src @@ -0,0 +1,7 @@ +SOURCE_URL=https://github.com/standardnotes/app/archive/refs/tags/3.20.2.tar.gz +SOURCE_SUM=6EE98FA8CEDCC7743419ED528E0A5B5AF5253373895AEC3E87EFFCA7D150122B +SOURCE_SUM_PRG=sha256sum +SOURCE_FORMAT=tar.gz +SOURCE_IN_SUBDIR=true +SOURCE_FILENAME= +SOURCE_EXTRACT=true diff --git a/scripts/install b/scripts/install index 974fac3..2d2bf59 100644 --- a/scripts/install +++ b/scripts/install @@ -90,20 +90,7 @@ ynh_script_progression --message="Setting up source files..." --weight=16 ynh_app_setting_set --app=$app --key=final_path --value=$final_path # Download, check integrity, uncompress and patch the source from app.src -mkdir -p "$final_path/live" -git clone $SOURCE "$final_path/live" --quiet -pushd "$final_path/live" - git checkout $COMMIT --quiet - git submodule update --init --recursive --quiet -popd - -# Apply Patch -if [ -f "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" ] -then - pushd "$final_path/live" - patch --strip=1 < "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" - popd -fi +ynh_setup_source --dest_dir="$final_path/live" chmod 750 "$final_path" chmod -R o-rwx "$final_path" diff --git a/scripts/upgrade b/scripts/upgrade index 91498c6..3ddf75b 100755 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -98,22 +98,8 @@ if [ "$upgrade_type" == "UPGRADE_APP" ] then ynh_script_progression --message="Upgrading source files..." --weight=17 - # Remove destination directory - ynh_secure_remove --file=$final_path - # Download - mkdir -p "$final_path" - git clone $SOURCE "$final_path/live" --quiet - pushd "$final_path/live" - git checkout $COMMIT --quiet - git submodule update --init --recursive --quiet - popd - # Apply Patch - if [ -f "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" ] - then - pushd "$final_path/live" - patch --strip=1 < "$YNH_CWD/../sources/patches/app-00-add-path-url.patch" - popd - fi + # Download, check integrity, uncompress and patch the source from app.src + ynh_setup_source --dest_dir="$final_path/live" fi # Set permissions to app files