From 51fdef0c537f1239d105539bb19bbc66484d7b27 Mon Sep 17 00:00:00 2001 From: Josue-T Date: Sat, 5 May 2018 10:32:43 +0200 Subject: [PATCH 1/2] Helper - Add no_extract_option --- data/helpers.d/utils | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index cc057eb0b..1cbc7d23c 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -109,6 +109,10 @@ ynh_backup_before_upgrade () { # # (Optionnal) Name of the local archive (offline setup support) # # default: ${src_id}.${src_format} # SOURCE_FILENAME=example.tar.gz +# # (Optional) If it set as false don't extract the source. +# # (Usefull to get a debian package of a python wheel.) +# # default: true +# SOURCE_EXTRACT=(true|false) # # Details: # This helper downloads sources from SOURCE_URL if there is no local source @@ -137,6 +141,7 @@ ynh_setup_source () { local src_sum=$(grep 'SOURCE_SUM=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) local src_sumprg=$(grep 'SOURCE_SUM_PRG=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) local src_format=$(grep 'SOURCE_FORMAT=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) + local src_extract=$(grep 'SOURCE_EXTRACT=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) local src_in_subdir=$(grep 'SOURCE_IN_SUBDIR=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) local src_filename=$(grep 'SOURCE_FILENAME=' "$YNH_CWD/../conf/${src_id}.src" | cut -d= -f2-) @@ -145,6 +150,7 @@ ynh_setup_source () { src_in_subdir=${src_in_subdir:-true} src_format=${src_format:-tar.gz} src_format=$(echo "$src_format" | tr '[:upper:]' '[:lower:]') + src_extract=${src_extract:-true} if [ "$src_filename" = "" ] ; then src_filename="${src_id}.${src_format}" fi @@ -163,7 +169,11 @@ ynh_setup_source () { # Extract source into the app dir mkdir -p "$dest_dir" - if [ "$src_format" = "zip" ] + + if ! "$src_extract" + then + mv $src_filename $dest_dir + elif [ "$src_format" = "zip" ] then # Zip format # Using of a temp directory, because unzip doesn't manage --strip-components From a3c6cc2ca8aaa322d8667ea54edb3ab63abd4922 Mon Sep 17 00:00:00 2001 From: JimboJoe Date: Tue, 8 May 2018 18:21:52 +0200 Subject: [PATCH 2/2] Typo fix --- data/helpers.d/utils | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/helpers.d/utils b/data/helpers.d/utils index 1cbc7d23c..51edf45f0 100644 --- a/data/helpers.d/utils +++ b/data/helpers.d/utils @@ -110,7 +110,7 @@ ynh_backup_before_upgrade () { # # default: ${src_id}.${src_format} # SOURCE_FILENAME=example.tar.gz # # (Optional) If it set as false don't extract the source. -# # (Usefull to get a debian package of a python wheel.) +# # (Useful to get a debian package or a python wheel.) # # default: true # SOURCE_EXTRACT=(true|false) #