[PC-BSD Commits] r8036 - in pcbsd/current/src-sh/pbi-manager: . man port-files

svn at pcbsd.org svn at pcbsd.org
Tue Nov 16 10:37:29 PST 2010


Author: kris
Date: 2010-11-16 10:37:29 -0800 (Tue, 16 Nov 2010)
New Revision: 8036

Added:
   pcbsd/current/src-sh/pbi-manager/man/pbi_makerepo.1
Modified:
   pcbsd/current/src-sh/pbi-manager/install.sh
   pcbsd/current/src-sh/pbi-manager/pbi-manager
   pcbsd/current/src-sh/pbi-manager/port-files/Makefile
   pcbsd/current/src-sh/pbi-manager/port-files/pkg-plist
Log:

Added new pbi_makerepo command, which is the start of our repo management
functionality



Modified: pcbsd/current/src-sh/pbi-manager/install.sh
===================================================================
--- pcbsd/current/src-sh/pbi-manager/install.sh	2010-11-16 16:16:20 UTC (rev 8035)
+++ pcbsd/current/src-sh/pbi-manager/install.sh	2010-11-16 18:37:29 UTC (rev 8036)
@@ -19,6 +19,7 @@
 ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_autobuild
 ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_makepatch
 ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_makeport
+ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_makerepo
 ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_delete
 ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_icon
 ln -f ${LB}/sbin/pbi_create ${LB}/sbin/pbi_info

Modified: pcbsd/current/src-sh/pbi-manager/pbi-manager
===================================================================
--- pcbsd/current/src-sh/pbi-manager/pbi-manager	2010-11-16 16:16:20 UTC (rev 8035)
+++ pcbsd/current/src-sh/pbi-manager/pbi-manager	2010-11-16 18:37:29 UTC (rev 8036)
@@ -161,6 +161,19 @@
         exit_trap
 }
 
+usage_makerepo_pbi() {
+        cat <<EOF
+usage: `basename $0` [options] [outdir]
+                
+Options:
+  --desc description   	-- Description for this new repo
+  --key key    		-- Path to the public key file for this repo
+  --url url    		-- Base URL for fetching the INDEX files
+
+EOF
+        exit_trap
+}
+
 usage_patch_pbi() {
         cat <<EOF
 usage: `basename $0` [options] pbp
@@ -302,6 +315,34 @@
         load_info_from_header
 }
 
+# Parse the command line for making a new repo file
+parse_makerepo_pbi_cmdline() {
+        while [ $# -gt 0 ]; do
+                case "$1" in
+             --key)     if [ $# -eq 1 ]; then usage_makerepo_pbi; fi
+                        shift; PBI_MKREPO_KEY="$1"
+                        ;;
+             --url)     if [ $# -eq 1 ]; then usage_makerepo_pbi; fi
+                        shift; PBI_MKREPO_URL="$1"
+                        ;;
+            --desc)     if [ $# -eq 1 ]; then usage_makerepo_pbi; fi
+                        shift; PBI_MKREPO_DESC="$1"
+                        ;;
+                 *)	if [ $# -gt 1  ]; then usage_makerepo_pbi; fi
+                       	PBI_MKREPO_OUTDIR="$1"
+                        ;;
+                esac
+                shift
+        done
+
+        if [ -z "${PBI_MKREPO_KEY}" ]; then usage_makerepo_pbi ; fi
+        if [ -z "${PBI_MKREPO_URL}" ]; then usage_makerepo_pbi ; fi
+        if [ -z "${PBI_MKREPO_DESC}" ]; 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
+
+}
+
 # Parse the command line for patching
 parse_patch_pbi_cmdline() {
         while [ $# -gt 0 ]; do
@@ -1044,7 +1085,7 @@
   fi 
 }
 
-# Star the make patch process
+# Start the make patch process
 pbi_makepatch_init() {
   	require_root
 	init_tmpdir
@@ -1054,6 +1095,29 @@
 	make_pbi_patchfile "${PBI_FILENAME}" "${PBI_OLDFILENAME}" "${PBI_PATCHOUTDIR}"
 }
 
+# Start the make patch process
+pbi_makerepo_init() {
+  	require_root
+	parse_makerepo_pbi_cmdline "$@"
+
+	# Create a new repo file
+	make_pbi_repo
+}
+
+# Create the repo .rpo file
+make_pbi_repo() {
+	init_tmpdir
+
+	mkdir ${PBI_TMPDIR}/.mkrepo
+	cp ${PBI_MKREPO_KEY} ${PBI_TMPDIR}/.mkrepo/repokey.ssl
+	echo "${PBI_MKREPO_URL}" >  ${PBI_TMPDIR}/.mkrepo/repo-url
+	echo "${PBI_MKREPO_DESC}" >  ${PBI_TMPDIR}/.mkrepo/repo-desc
+	tar cvzf ${PBI_MKREPO_OUTDIR}/pbi-repo.rpo -C ${PBI_TMPDIR}/.mkrepo . >/dev/null 2>/dev/null
+	echo "New PBI Repo created: ${PBI_MKREPO_OUTDIR}/pbi-repo.rpo"
+
+	rm_tmpdir
+}
+
 # Start the patch process
 pbi_patch_init() {
   	require_root
@@ -4232,6 +4296,7 @@
    pbi_info) pbi_info_init "$@" ;;
    pbi_makeport) pbi_make_init "$@" ;;
    pbi_makepatch) pbi_makepatch_init "$@" ;;
+   pbi_makerepo) pbi_makerepo_init "$@" ;;
    pbi_patch) pbi_patch_init "$@" ;;
    pbi_update) pbi_update_init "$@" ;;
    pbi-crashhandler) pbi_crash_init "$@" ;;

Modified: pcbsd/current/src-sh/pbi-manager/port-files/Makefile
===================================================================
--- pcbsd/current/src-sh/pbi-manager/port-files/Makefile	2010-11-16 16:16:20 UTC (rev 8035)
+++ pcbsd/current/src-sh/pbi-manager/port-files/Makefile	2010-11-16 18:37:29 UTC (rev 8036)
@@ -21,7 +21,7 @@
 
 MAN1=		pbi_autobuild.1 pbi_add.1 pbi_create.1 pbi_delete.1 \
 		pbi_icon.1 pbi_info.1 pbid.1 \
-		pbi_patch.1 pbi_makeport.1 pbi_makepatch.1 pbi.conf.1
+		pbi_patch.1 pbi_makeport.1 pbi_makepatch.1 pbi_makerepo.1 pbi.conf.1
 
 do-install:
 	cd ${WRKSRC} && ./install.sh ${LOCALBASE}

Modified: pcbsd/current/src-sh/pbi-manager/port-files/pkg-plist
===================================================================
--- pcbsd/current/src-sh/pbi-manager/port-files/pkg-plist	2010-11-16 16:16:20 UTC (rev 8035)
+++ pcbsd/current/src-sh/pbi-manager/port-files/pkg-plist	2010-11-16 18:37:29 UTC (rev 8036)
@@ -7,6 +7,7 @@
 sbin/pbi_info
 sbin/pbi_makepatch
 sbin/pbi_makeport
+sbin/pbi_makerepo
 sbin/pbi_update
 sbin/pbi_patch
 sbin/pbid



More information about the Commits mailing list