Skip to content

rspm create blocklist-rule#

Command to create blocklist rules Supports remote use with API tokens when enabled.

rspm create blocklist-rule [flags]

Examples#

  rspm create blocklist-rule --package-name=[package name] --description=[text]
  rspm create blocklist-rule --package-name=[package name] --version=[version]
  rspm create blocklist-rule --package-name=[package name] --source=pypi --description=[text]
  rspm create blocklist-rule --source=[source name] --exception --description=[text]

  # Block all 'ggplot2' package versions less than 1.0.0.
  # Note that special characters like '<' and '>' must be escaped in quotes.
  rspm create blocklist-rule --package-name=ggplot2 --version='<1.0.0' --description="Block 'ggplot2' versions <1.0.0"

  # Test the blocklist rules for package 'ggplot2' with version 0.9.0 in the 'cran' repo
  rspm test blocklist-rules --repo=cran --package-name=ggplot2 --version=0.9.0

  # Block all versions of the 'Django' package in the 'pypi' source
  rspm create blocklist-rule  --source=pypi --package-name=Django --description="Block 'Django' from PyPI"

  # Block the 'a4' package across all Bioconductor versions, including future versions
  rspm create blocklist-rule --bioconductor --package-name=a4 --description="Block 'a4' across all Bioconductor versions"

  # List all license types for package blocking
  rspm list license-types

  # Block all packages licensed under AGPL v3 or later
  rspm create blocklist-rule --license-types=AGPL-3.0-only,AGPL-3.0-or-later --description="Block all packages licensed under AGPL v3 or later"

  # Block all packages with an unknown or missing license
  rspm create blocklist-rule --license-types=Unknown --description="Block all packages with an unknown or missing license"

  # Make an exception for the 'guesser' PyPI package, which has an unknown license
  rspm create blocklist-rule --source=pypi --package-name=guesser --exception --description="Allow 'guesser' PyPI package with an unknown license"

Options#

  -a, --address string             The address of the remote server. If not specified, the PACKAGEMANAGER_ADDRESS environment variable is used.
      --bioconductor               Block in all Bioconductor sources
      --description string         Description text. Optional.
      --exception                  Allow package if any of the rules match
  -h, --help                       help for blocklist-rule
      --insecure-ssl-skip-verify   If true, skip SSL certificate validation. This reduces the security that SSL normally provides.
      --license string             Case-insensitive substring for matching package licenses
      --license-types string       A comma-separated list of package license types. License types are either a license identifier in the SPDX License List (non-deprecated), or "Unknown" for an unknown or missing license. Use the 'rspm list license-types' command to display available license types, or see https://spdx.org/licenses/ for a detailed list of SPDX license identifiers.
      --package-name string        The name of the package
      --priority uint              Execution priority, lower is executed earlier (default 100)
      --source string              The name of the source.
      --succeed-on-existing        Do not return an error if rule already exists
      --version string             Version string with optional operator for matching like '<1.0.0'. Valid operators include: >, >=, <, and <=

Options inherited from parent commands#

  -c, --config string          Path to config file
  -o, --output-format string   Specify the output format 'human' for human-readable output or 'json' for JSON-encoded output. (default "human")
  -v, --verbose                Provide additional output