code: func (p *defaultProvisioner) provisionPackage(ctx context.Context, paths Paths, s *ProvisionStatusPackage, m mover, name, version, pathUnzipSrc, pathDirectory string, finish func() error) (err error) {
  	// Package has already been provisioned
  	if s != nil && s.Version == version {
  		astilog.Debugf("%s has already been provisioned to version %s, moving on...", name, version)
  		return
  	}
  	astilog.Debugf("Provisioning %s...", name)
  
  	// Remove previous install
  	astilog.Debugf("Removing directory %s", pathDirectory)
  	if err = os.RemoveAll(pathDirectory); err != nil && !os.IsNotExist(err) {
  		return errors.Wrapf(err, "removing %s failed", pathDirectory)
  	}
  
  	// Move
  	if err = m(ctx, paths); err != nil {
  		return errors.Wrapf(err, "moving %s failed", name)
  	}
  
  	// Create directory
  	astilog.Debugf("Creating directory %s", pathDirectory)
  	if err = os.MkdirAll(pathDirectory, 0755); err != nil {
  		return errors.Wrapf(err, "mkdirall %s failed", pathDirectory)
  	}
  
  	// Unzip
  	if err = Unzip(ctx, pathUnzipSrc, pathDirectory); err != nil {
  		return errors.Wrapf(err, "unzipping %s into %s failed", pathUnzipSrc, pathDirectory)
  	}
  
  	// Finish
  	if finish != nil {
  		if err = finish(); err != nil {
  			return errors.Wrap(err, "finishing failed")
  		}
  	}
  	return
  }
docs: // provisionPackage provisions a package