Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=b9045e4110f4cc6db16b0748f6e46d9ab6a10196

commit b9045e4110f4cc6db16b0748f6e46d9ab6a10196
Author: Michel Hermier <[email protected]>
Date:   Mon Apr 9 09:02:03 2012 +0200

util.sh

* Introduce Fsanitizename. It will produce a pkgname compatible name
from a real package name (lower case, replace white space with _).

diff --git a/source/include/util.sh b/source/include/util.sh
index fa592ba..fa9e790 100644
--- a/source/include/util.sh
+++ b/source/include/util.sh
@@ -1175,9 +1175,22 @@ Fautogen() {
}

###
+# * Fsanitizename: Clear/fix some common package name string common problems on
+# an automated package name retrival/usage (remove duplicate name assignation 
in
+# scripts). Parameters: 1) name (optional) to clean, else stdin if not present.
+###
+Fsanitizename() {
+       if [ $# -gt 0 ]; then
+               echo "$1" | Fsanitizename
+       else
+               sed "s/\(.*\)/\L\1/g;s/ /_/g"
+       fi
+}
+
+###
# * Fsanitizeversion: Clear/fix some common version string common problems on
-# an automatized version output (also remove pkgextraver ending). Parameters:
-# 1) version (optional) to clean, else stdin if not present
+# an automated version output (also remove pkgextraver ending). Parameters:
+# 1) version (optional) to clean, else stdin if not present.
###
Fsanitizeversion() {
if [ $# -gt 0 ]; then
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to