code: def _add_var(var, value):
      '''
      Add a new var to the make.conf. If using layman, the source line
      for the layman make.conf needs to be at the very end of the
      config. This ensures that the new var will be above the source
      line.
      '''
      makeconf = _get_makeconf()
      layman = 'source /var/lib/layman/make.conf'
      fullvar = '{0}="{1}"'.format(var, value)
      if __salt__['file.contains'](makeconf, layman):
          # TODO perhaps make this a function in the file module?
          cmd = ['sed', '-i', r'/{0}/ i\{1}'.format(
                      layman.replace('/', '\\/'),
                      fullvar),
                 makeconf]
          __salt__['cmd.run'](cmd)
      else:
          __salt__['file.append'](makeconf, fullvarf _add_var(var, value):
      '''
      Add a new var to the make.conf. If using layman, the source line
      for the layman make.conf needs to be at the very end of the
      config. This ensures that the new var will be above the source
      line.
      '''
      makeconf = _get_makeconf()
      layman = 'source /var/lib/layman/make.conf'
      fullvar = '{0}="{1}"'.format(var, value)
      if __salt__['file.contains'](makeconf, layman):
          # TODO perhaps make this a function in the file module?
          cmd = ['sed', '-i', r'/{0}/ i\{1}'.format(
                      layman.replace('/', '\\/'),
                      fullvar),
                 makeconf]
          __salt__['cmd.run'](cmd)
      else:
          __salt__['file.append'](makeconf, fullvar)
docs: Add a new var to the make.conf. If using layman, the source line
      for the layman make.conf needs to be at the very end of the
      config. This ensures that the new var will be above the source
      line.