aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcrownedgrouse <[email protected]>2020-04-13 02:10:06 +0200
committerLoïc Hoguin <[email protected]>2020-04-21 11:22:25 +0200
commit89f2eca925b3f19b2409f9d0e71cf8108e5bd5eb (patch)
tree28b8ce4c45c8c3d93bf420f0dc28729f4cc417f8
parentc17d8624dbae513a66d14a244964172341123523 (diff)
downloaderlang.mk-89f2eca925b3f19b2409f9d0e71cf8108e5bd5eb.tar.gz
erlang.mk-89f2eca925b3f19b2409f9d0e71cf8108e5bd5eb.tar.bz2
erlang.mk-89f2eca925b3f19b2409f9d0e71cf8108e5bd5eb.zip
Do minimal checks to pkg_add.sh args
-rwxr-xr-xpkg_add.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg_add.sh b/pkg_add.sh
index 7684d26..c67b775 100755
--- a/pkg_add.sh
+++ b/pkg_add.sh
@@ -1,5 +1,18 @@
#!/bin/sh
+if [ -z "$1$2$3$4$5$6" ]
+then
+ echo "Missing arguments" 1>&2
+ exit 1
+fi
+
+T=`echo "$1" | grep "\." | wc -l `
+if [ "$T" -eq "1" ]
+then
+ echo "Invalid dot character in name. Considere replace by an underscore." 1>&2
+ exit 1
+fi
+
PKG_FILE="index/$1.mk"
CONTENTS="PACKAGES += $1
pkg_$1_name = $1