Skip to content

Commit

Permalink
Ensure we don't pass a blank PBI_PROGNAME
Browse files Browse the repository at this point in the history
  • Loading branch information
jim-p committed Jun 20, 2012
1 parent 085836d commit 9c86e6b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builder_scripts/rebuild_package_binaries_pbi.php
Expand Up @@ -83,6 +83,11 @@
function create_pbi_conf($port_path,$MAKEOPTS="") {

$PROGNAME=trim(`grep ^PORTNAME= /usr/ports/$port_path/Makefile | cut -d'=' -f2`);
// $port_path Format should be, e.g. www/squid so we can grab the port name there if the makefile is empty.
$PROGNAME = empty($PROGNAME) ? substr($port_path, strpos($port_path, '/')+1) : $PROGNAME;
// If it's still empty, comment it out
$usepn = empty($PROGNAME) ? "#" : "";

$MAINTAINER=trim(`grep ^MAINTAINER= /usr/ports/$port_path/Makefile | cut -d'=' -f2`);
// $PROGWEB=trim(`grep ^MASTER_SITES= /usr/ports/$port_path/Makefile | cut -d'=' -f2`);

Expand All @@ -91,7 +96,7 @@ function create_pbi_conf($port_path,$MAKEOPTS="") {
$PBI_CONF = <<<EOF
# Format of this file changed, new example: http://wiki.pcbsd.org/index.php/PBI_Module_Builder_Guide
# Program Name
PBI_PROGNAME="$PROGNAME"
{$usepn}PBI_PROGNAME="$PROGNAME"
# Program Website
# PBI_PROGWEB="$PROGWEB"
Expand Down

0 comments on commit 9c86e6b

Please sign in to comment.