Visitar URL original
Main.scala (OpenWhisk admin tool) contains MIT-licensed code from Scallop without attribution · Issue #264 · apache/openserverless · GitHub
Skip to content

Main.scala (OpenWhisk admin tool) contains MIT-licensed code from Scallop without attribution #264

Description

@pjfanning

build/openwhisk/tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala (vendored from Apache OpenWhisk, shipped in the 0.9.0-incubating-RC7 source release) contains code copied from Scallop, which is MIT-licensed:

  private def printErr(message: String): Unit = {
    //Taken from ScallopConf
    if (overrideColorOutput.value.getOrElse(System.console() != null)) {
      Console.err.println("[\u001b[31m%s\u001b[0m] Error: %s" format (printedName, message))
    } else {
      // no colors on output
      Console.err.println("[%s] Error: %s" format (printedName, message))
    }
  }

This is the default errorMessageHandler from Scallop 3.3.2 (the version the admin tool depends on), jvm/src/main/scala/org.rogach.scallop/ScallopConf.scala lines 77-85, minus the final sys.exit(1):

  errorMessageHandler = { message =>
    if (overrideColorOutput.value.getOrElse(System.console() != null)) {
      Console.err.println("[\u001b[31m%s\u001b[0m] Error: %s" format (printedName, message))
    } else {
      // no colors on output
      Console.err.println("[%s] Error: %s" format (printedName, message))
    }
    sys.exit(1)
  }

Scallop is licensed under the MIT License, Copyright (C) 2012 Platon Pronko and Chris Hodapp. MIT is Category A, so it can be included, but the MIT licence requires its copyright and permission notice to be kept with the copied code. Currently the file only carries the ASF header, and the top-level LICENSE does not mention Scallop.

Suggested fix, either:

  1. Rewrite printErr independently (it is a few lines of error printing), and drop the "Taken from ScallopConf" comment; or
  2. Keep it and add a LICENSE entry for Scallop (MIT, with its copyright line and licence text), noting the file it is used in.

The same code is in upstream Apache OpenWhisk (tools/admin/src/main/scala/org/apache/openwhisk/core/cli/Main.scala). Related: #259, #260.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions