Skip to Content.
Sympa Menu

sm-commit - [SM-Commit] GIT changes to master quill by Ismael Luceno (716b074a93ef600ce0a91fbf4d7ee1a0639d858b)

sm-commit AT lists.ibiblio.org

Subject: Source Mage code commit list

List archive

Chronological Thread  
  • From: Ismael Luceno <scm AT sourcemage.org>
  • To: sm-commit AT lists.ibiblio.org
  • Subject: [SM-Commit] GIT changes to master quill by Ismael Luceno (716b074a93ef600ce0a91fbf4d7ee1a0639d858b)
  • Date: Fri, 15 May 2020 19:22:30 +0000

GIT changes to master quill by Ismael Luceno <ismael AT sourcemage.org>:

install.sh | 6 +-----
var/lib/quill/modules/libdetails | 34 ++++++++++++++++++++--------------
2 files changed, 21 insertions(+), 19 deletions(-)

New commits:
commit 716b074a93ef600ce0a91fbf4d7ee1a0639d858b
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

libdetails: Unify and simplify URL sanitization

commit 05f34766ed2b2c7ddba0702ec62c18458388042f
Author: Ismael Luceno <ismael AT sourcemage.org>
Commit: Ismael Luceno <ismael AT sourcemage.org>

install.sh: Simplify setting INSTALL_ROOT variable

diff --git a/install.sh b/install.sh
index 4500ed6..d99a2d8 100755
--- a/install.sh
+++ b/install.sh
@@ -1,10 +1,6 @@
#!/bin/bash

-if [[ $2 ]] ; then
- INSTALL_ROOT="$2"
-else
- INSTALL_ROOT=""
-fi
+INSTALL_ROOT="$2"

if [[ "$1" == "install" ]]; then
if ! grep -q "\./install.sh$" <<< "$0"; then
diff --git a/var/lib/quill/modules/libdetails
b/var/lib/quill/modules/libdetails
index 08be920..57e3954 100644
--- a/var/lib/quill/modules/libdetails
+++ b/var/lib/quill/modules/libdetails
@@ -22,6 +22,24 @@ function query_spell_name(){
fi
}

+
+#---
+## Sanitize a SOURCE_URL
+#---
+sanitize_source_url() {
+ awk '
+ {
+ sub(/[?#].*/, "")
+ for (i in R) sub(i, R[i])
+ print
+ }
+ BEGIN {
+
R["^https?://prdownloads.sourceforge.net/"]="$SOURCEFORGE_URL/"
+ R["^https?://downloads.sourceforge.net/"]="$SOURCEFORGE_URL/"
+ }
+ '
+}
+
#---
##
## @Globals SPELL_SRC_URL
@@ -32,24 +50,12 @@ function query_spell_source_url(){
# I tested this with various URLs and it seems to work quite well
# if any other are found should be included
# possibly split the code into a separate function???
- SPELL_SRC_URL=$(sed -e
"s,http://prdownloads.sourceforge.net,$SOURCEFORGE_URL,"; \
- -e
"s,http://downloads.sourceforge.net/\(.*\)?.*,$SOURCEFORGE_URL/\1," \
- -e
"s,http://downloads.sourceforge.net/\(.*\),$SOURCEFORGE_URL/\1," \
- -e
"s,http://prdownload.berlios.de/\(.*\),http://download.berlios.de/\1,"; \
- -e
"s,http://sourceforge.net/project/showfiles.php.*,,"; \
- -e "s,^\(.*\)/\(.*\)?.*,\1/\2," \
- <<< $SPELL_SRC_URL)
+ SPELL_SRC_URL=$(sanitize_source_url <<< "$SPELL_SRC_URL")
if ! [[ $SPELL_SRC_URL ]] ||
! query "Is $SPELL_SRC_URL the proper source url?" y; then
query_msg "Please enter the url of the source:"
read "SPELL_SRC_URL"
- SPELL_SRC_URL=$(sed -e
"s,http://prdownloads.sourceforge.net,$SOURCEFORGE_URL,"; \
- -e
"s,http://downloads.sourceforge.net/\(.*\)?.*,$SOURCEFORGE_URL/\1," \
- -e
"s,http://downloads.sourceforge.net/\(.*\),$SOURCEFORGE_URL/\1," \
- -e
"s,http://prdownload.berlios.de/\(.*\),http://download.berlios.de/\1,"; \
- -e
"s,http://sourceforge.net/project/showfiles.php.*,,"; \
- -e "s,^\(.*\)/\(.*\)?.*,\1/\2," \
- <<< $SPELL_SRC_URL)
+ SPELL_SRC_URL=$(sanitize_source_url <<< "$SPELL_SRC_URL")
fi
}




  • [SM-Commit] GIT changes to master quill by Ismael Luceno (716b074a93ef600ce0a91fbf4d7ee1a0639d858b), Ismael Luceno, 05/15/2020

Archive powered by MHonArc 2.6.24.

Top of Page