[PC-BSD Commits] r13444 - pcbsd/current/src-sh/pbi-manager

svn at pcbsd.org svn at pcbsd.org
Wed Oct 19 08:43:45 PDT 2011


Author: kris
Date: 2011-10-19 08:43:45 -0700 (Wed, 19 Oct 2011)
New Revision: 13444

Modified:
   pcbsd/current/src-sh/pbi-manager/pbi-manager
Log:

Add check to pbi-manager, when creating a new PBI repo, make sure we have http://, https://, or ftp:// as the URL type



Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-10-19 13:55:20 UTC (rev 13443)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2011-10-19 15:43:45 UTC (rev 13444)
@@ -776,6 +776,13 @@
         if [ -z "${PBI_MKREPO_URL}" ]; then usage_makerepo_pbi ; fi
         if [ -z "${PBI_MKREPO_OUTDIR}" ]; then PBI_MKREPO_OUTDIR="${HOME}"; fi
         if [ ! -f "${PBI_MKREPO_KEY}" ]; then exit_err "The key file ${PBI_MKREPO_KEY} does not exist." ; fi
+	
+	# Make sure we have a valid URL format
+        echo "${PBI_MKREPO_URL}" | grep -q -e "^http://" -e "^https://" -e "^ftp://"
+	if [ $? -ne 0 ] ; then
+		exit_err "Repo URL must begin with http://, https://, or ftp://"
+	fi
+	
 
 }
 



More information about the Commits mailing list