Change which pkg should be installed if this one can't.

 @param new_val[String] the name of an existing package or "Do Not Install"

 @return [void]
961592
def switch_with_package=(new_val)
      return nil if new_val == @switch_with_package
      new_val = nil if new_val.to_s.empty?

      raise JSS::NoSuchItemError, "No package named '#{new_val}' exists in the JSS" if new_val && (!self.class.all_names(api: @api).include? new_val)

      new_val ||= DO_NOT_INSTALL
      @switch_with_package = new_val
      @need_to_update = true
    end
132996
def assign_vpp_device_based_licenses=(new_val)
      return nil if new_val == @assign_vpp_device_based_licenses
      raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
      @assign_vpp_device_based_licenses = new_val
      @need_to_update = true
    end
836415
def updateitem(self, key, new_val):
        
        if key not in self._position:
            raise KeyError(key)
        self[key] = new_val
586123
def _rmv_pkg(self, package):
        
        removes = []
        if GetFromInstalled(package).name() and package not in self.skip:
            ver = GetFromInstalled(package).version()
            removes.append(package + ver)
            self._removepkg(package)
        return removes
1031609
def offline=(new_val)
      raise JSS::InvalidDataError, 'New value must be boolean true or false' unless JSS::TRUE_FALSE.include? new_val
      @offline = new_val
      @need_to_update = true
    end
1150390
def change_env(name, val):
    
    oldval = os.environ.get(name, None)
    os.environ[name] = val
    yield
    if oldval is None:
        del os.environ[name]
    else:
        os.environ[name] = oldval
1246392
def new_value(*args, &block)
      value = value_from_args(args, &block)

      value = if incremental
                incremental_value(value)
              else
                filter_value(transformed_value(value))
              end

      if value_valid?(value)
        self.custom_value = value
      elsif invalid.to_s == 'default' && !incremental
        default_value
      else
        fail ArgumentError, "The value #{value.inspect} is not valid."
      end
    end
271760
def install_dir(pkgpath, install_path, register_func, delete_after_install=False):
    
    logger.debug("%s is a directory, attempting to validate", pkgpath)
    plugin = register_func(pkgpath)
    logger.debug("%s looks good, copying to %s", pkgpath, install_path)
    try:
        copy_tree(pkgpath, os.path.join(install_path, plugin.name))
        if delete_after_install:
            logger.debug("deleting %s", pkgpath)
            shutil.rmtree(pkgpath)
        pkgpath = os.path.join(install_path, plugin.name)
    except (OSError, CTError) as exc:
        # TODO: handle package name exists (upgrade? overwrite?)
        logger.debug(str(exc), exc_info=True)
        raise exceptions.PluginAlreadyInstalled(plugin.name)

    return install_deps(pkgpath)
1154059
def checksum=(new_val)
      return if new_val == @checksum
      raise JSS::InvalidDataError, 'Checksum must be a String or nil' unless new_val.is_a?(String) || new_val.nil?

      @checksum = new_val
      @need_to_update = true
    end
449005
def _pfp__set_value(self, new_val):
        
        if self._pfp__frozen:
            raise errors.UnmodifiableConst()
        self._pfp__value = self._pfp__get_root_value(new_val)
        self._pfp__notify_parent()
751252
def self_service_force_users_to_view_description=(new_val)
      return nil if @self_service_force_users_to_view_description == new_val
      raise JSS::InvalidDataError, 'Only macOS Self Service Items can force users to view description' unless self_service_targets.include? :macos
      raise JSS::InvalidDataError, 'New value must be true or false' unless new_val.jss_boolean?
      @self_service_force_users_to_view_description = new_val
      @need_to_update = true
    end
33825
def required_processor=(new_val)
      return nil if new_val == @required_processor

      new_val = DEFAULT_PROCESSOR if new_val.to_s.empty?
      raise JSS::InvalidDataError, "Required_processor must be one of: #{CPU_TYPES.join ', '}" unless CPU_TYPES.include? new_val

      @required_processor = new_val
      @need_to_update = true
    end
936778
def init(name, version)
      @name = name
      @version = version
      @package_files = Rake::FileList.new
      @package_dir = 'pkg'
      @need_tar = false
      @need_tar_gz = false
      @need_tar_bz2 = false
      @need_zip = false
      @tar_command = 'tar'
      @zip_command = 'zip'
    end
98199
def add_pkg(pkgs, name, pkgver):
    '''
    
    '''
    try:
        pkgs.setdefault(name, []).append(pkgver)
    except AttributeError as exc:
        log.exception(exc)
550797
def override_buildings=(newval)
      raise JSS::InvalidDataError, 'New value must be boolean true or false' unless JSS::TRUE_FALSE.include? newval
      @override_buildings = newval
      @need_to_update = true
    end
987731
def package_install(name, **kwargs):
    '''
    
    '''
    cmd = 'pkg_install ' + name
    if kwargs.get('version', False):
        cmd += ' ' + kwargs['version']

    # Send the command to execute
    out, err = DETAILS['server'].sendline(cmd)

    # "scrape" the output and return the right fields as a dict
    return parse(out)
1151608
function updateExternalDependencies(oldName, newName) {
      sourcePackages.forEach(function(p) {
        var index = p.dependencies.indexOf(oldName);
        if (index !== -1) {
          if (p.name === newName || p.dependencies.indexOf(newName) !== -1) {
            // If the package has the same name as the one we are trying to
            // update to, then we are trying to update the package to point
            // to itself as a dependency, which isn't possible so just remove
            // the old dependency. Alternatively, if the package already has
            // the new name, then we can simply remove the old one and move on.
            p.dependencies.splice(index, 1);
          } else {
            // If the package is NOT trying to update to itself and does NOT
            // have the new dependency already, then add it in place of the
            // old one.
            p.dependencies.splice(index, 1, newName);
          }
        }
      });
    }