blob: 292a6a4c5b1c9c9fe382b0dfe8ad53a1e38bc199 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Package genkey is deprecated
package genkey
import (
"flag"
"fmt"
"os"
"path/filepath"
"go.fuchsia.dev/fuchsia/src/sys/pkg/bin/pm/build"
)
const usage = `Usage: %s genkey
deprecated without replacement
`
// Run performs a null action due to deprecation
func Run(cfg *build.Config, args []string) error {
fs := flag.NewFlagSet("genkey", flag.ExitOnError)
fs.Usage = func() {
fmt.Fprintf(os.Stderr, usage, filepath.Base(os.Args[0]))
fmt.Fprintln(os.Stderr)
fs.PrintDefaults()
}
if err := fs.Parse(args); err != nil {
return err
}
if len(fs.Args()) != 0 {
fmt.Fprintf(os.Stderr, "WARNING: unused arguments: %s\n", fs.Args())
}
fmt.Fprintln(os.Stderr, "package signing is deprecated")
if cfg.KeyPath == "" {
return fmt.Errorf("error: signing key flag is required")
}
f, err := os.Create(cfg.KeyPath)
if err != nil {
return err
}
defer f.Close()
return nil
}