[PC-BSD Commits] r4184 - pbibuild/pbibuilder/scripts

svn at pcbsd.org svn at pcbsd.org
Thu Jul 2 12:57:13 PDT 2009


Author: kris
Date: 2009-07-02 12:57:13 -0700 (Thu, 02 Jul 2009)
New Revision: 4184

Modified:
   pbibuild/pbibuilder/scripts/3.makepbi.sh
   pbibuild/pbibuilder/scripts/functions.sh
Log:

Improve the logic in detecting a ports pkgname, let the port make system do the work :)



Modified: pbibuild/pbibuilder/scripts/3.makepbi.sh
===================================================================
--- pbibuild/pbibuilder/scripts/3.makepbi.sh	2009-07-02 00:33:22 UTC (rev 4183)
+++ pbibuild/pbibuilder/scripts/3.makepbi.sh	2009-07-02 19:57:13 UTC (rev 4184)
@@ -62,6 +62,7 @@
 # Locate the port version and name for this program
 find_port_ver
 find_port_portname
+find_port_pkgname
 
 # Copy over the PBI module directory
 echo "Copying over ${module}..." >>${BLOG}
@@ -90,7 +91,7 @@
   cp ${PROGDIR}/scripts/autopopulate.sh ${PDESTDIR}/autopopulate.sh
   chmod 755 ${PDESTDIR}/autopopulate.sh
   rm -rf ${PDESTDIR}/tmp/autodupdir >/dev/null 2>/dev/null
-  export PORTNAME PORTVER
+  export PORTNAME PORTVER PKGNAME
   export PBIAUTOPOPULATE
 else
   rm ${PDESTDIR}/autopopulate.sh >/dev/null 2>/dev/null
@@ -116,12 +117,12 @@
 # Perform PBI auto-population
 if [ -e "/autopopulate.sh" ]
 then
-  echo "/autopopulate.sh ${PORTNAME}-${PORTVER} ${PBILOCALBASE} ${PBIDIR} /autopopulate.sh"
+  echo "/autopopulate.sh ${PKGNAME} ${PBILOCALBASE} ${PBIDIR} /autopopulate.sh"
   if [ "${PBIAUTOPOPULATE}" = "FULL" ]
   then
-    /autopopulate.sh "${PORTNAME}-${PORTVER}" "${PBILOCALBASE}" "${PBIDIR}" "/autopopulate.sh"
+    /autopopulate.sh "${PKGNAME}" "${PBILOCALBASE}" "${PBIDIR}" "/autopopulate.sh"
   else
-    /autopopulate.sh "${PORTNAME}-${PORTVER}" "${PBILOCALBASE}" "${PBIDIR}"
+    /autopopulate.sh "${PKGNAME}" "${PBILOCALBASE}" "${PBIDIR}"
   fi
 fi
 

Modified: pbibuild/pbibuilder/scripts/functions.sh
===================================================================
--- pbibuild/pbibuilder/scripts/functions.sh	2009-07-02 00:33:22 UTC (rev 4183)
+++ pbibuild/pbibuilder/scripts/functions.sh	2009-07-02 19:57:13 UTC (rev 4184)
@@ -48,3 +48,20 @@
   export PORTNAME
 };
 
+# Exports PKGNAME
+# Requires PDESTDIR and PBIPORT to be set
+find_port_pkgname()
+{
+  PKGNAME=""
+
+  # Get the port package version
+  PKGNAME="`chroot ${PDESTDIR} /usr/bin/make -C ${PBIPORT} -V PKGNAME`"
+
+  if [ -z "${PKGNAME}" ]
+  then
+    PKGNAME="UNKNOWN"
+  fi
+
+  export PKGNAME
+};
+



More information about the Commits mailing list