Print this page
buildctl should honor opts and pass them to build.sh scripts

Split Close
Expand all
Collapse all
          --- old/build/buildctl
          +++ new/build/buildctl
   1    1  #!/usr/bin/bash
   2    2  
   3    3  NOBANNER=1
   4    4  batch_flag=""
        5 +lint_flag=""
   5    6  if [ "${BATCH}" = 1 ]; then
   6    7      echo "Enabling batch mode."
   7    8      batch_flag="-b"
   8    9  fi
   9   10  . ../lib/functions.sh
  10   11  
  11   12  [ "${1}" == "licenses" ] && AUDIT_LICENSE=1
  12   13  
  13   14  # targets maps any valid package name to its build script.
  14   15  declare -A targets
↓ open down ↓ 96 lines elided ↑ open up ↑
 111  112                  pkgsend -s $PKGSRVR publish -d $PKGROOT $SCRIPT.final || \
 112  113                      bail "pkgsend failed"
 113  114              # Else we just have a manifest to import
 114  115              else
 115  116                  echo "Simple manifest to import... importing to $PKGSRVR"
 116  117                  pkgsend -s $PKGSRVR publish $SCRIPT.final || \
 117  118                      bail "pkgsend failed"
 118  119                  rm $SCRIPT.final
 119  120              fi
 120  121          else
 121      -            PATH=$PATH:. $SCRIPT -r $PKGSRVR $batch_flag || \
      122 +            PATH=$PATH:. $SCRIPT -r $PKGSRVR $batch_flag $lint_flag || \
 122  123                  logerr "Unable to run $SCRIPT"
 123  124          fi
 124  125      popd >/dev/null
 125  126  }
 126  127  
 127  128  licenses() {
 128  129      LCNT=0
 129  130      for target in "${!licenses[@]}"
 130  131      do
 131  132          if [[ -n "${licenses[$target]}" ]]; then
↓ open down ↓ 9 lines elided ↑ open up ↑
 141  142              if [[ -z "${licenses[$target]}" ]]; then
 142  143                  echo " * $target"
 143  144              fi
 144  145          done | sort
 145  146      fi
 146  147  }
 147  148  
 148  149  DEFAULT_PKGSRVR=$PKGSRVR
 149  150  DEFAULT_PKGPUBLISHER=$PKGPUBLISHER
 150  151  
      152 +# When we get here, honor any -l or -b flags from the buildctl command line,
      153 +# or even the environment.
      154 +
      155 +if [ "${BATCH}" = 1 ]; then
      156 +    logmsg "Enabling batch mode."
      157 +    batch_flag="-b"
      158 +fi
      159 +if [ "${SKIP_PKGLINT}" = 1 ]; then
      160 +    logmsg "Disabling pkglint."
      161 +    lint_flag="-l"
      162 +fi
      163 +
 151  164  case "$1" in
 152  165      list)
 153  166          list $2
 154  167          exit
 155  168          ;;
 156  169  
 157  170      licenses)
 158  171          licenses
 159  172          exit
 160  173          ;;
↓ open down ↓ 26 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX