Package br.com.objectos.rio.eto.os

Source Code of br.com.objectos.rio.eto.os.EtoOsPrepareOptions

/*
* Copyright 2013 Objectos, Fábrica de Software LTDA.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
* use this file except in compliance with the License. You may obtain a copy of
* the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations under
* the License.
*/
package br.com.objectos.rio.eto.os;

import static br.com.objectos.rio.RioVersion.VERSION;
import br.com.objectos.rio.HttpServer;
import br.com.objectos.rio.OsDirs;
import br.com.objectos.rio.eto.EtoDirs;
import br.com.objectos.way.base.io.Directory;

import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

/**
* @author marcio.endo@objectos.com.br (Marcio Endo)
*/
@Parameters
class EtoOsPrepareOptions {

  String version = VERSION.get();

  @Parameter(names = { "--stage", "-s" })
  boolean stage = false;

  @Parameter(names = { "--objectos", "-o" })
  boolean objectos = false;

  @Parameter(names = { "--ekernel", "-k" })
  boolean ekernel = false;

  @Parameter(names = { "--realtek" })
  boolean realtek = false;

  @Parameter(names = { "--eworld", "-w" })
  boolean eworld = false;

  @Parameter(names = { "--usepkg" })
  boolean usepkg = false;

  @Parameter(names = { "--revdep" })
  boolean revdep = false;

  @Parameter(names = { "--grub", "-g" })
  boolean grub = false;

  @Parameter(names = { "--rio", "-r" })
  boolean rio = false;

  @Parameter(names = { "--bdo", "-b" })
  boolean bdo = false;

  @Parameter(names = { "--extras", "-x" })
  boolean extras = false;

  @Parameter(names = "--server")
  String server = "rio.objectos.com.br";

  public HttpServer fileServer() {
    String base = String.format("%s/%s/os/%s", server, getCode(), version);
    return HttpServer.at(base);
  }

  public HttpServer distfilesServer() {
    String base = String.format("%s/gentoo/distfiles", server);
    return HttpServer.at(base);
  }

  public String resourcesDir() {
    return String.format("/%s/os/src", getCode());
  }

  public String resourcesList() {
    return String.format("/%s/os/files.txt", getCode());
  }

  public String resourcesMap() {
    return String.format("/%s/os/map.txt", getCode());
  }

  public String userHome() {
    return String.format("/%s", getCode());
  }

  public String user() {
    return getCode();
  }

  public String sshKeyScriptName() {
    return String.format("/etc/local.d/00-%s-ssh-key.start", getCode());
  }

  public OsDirs dirs(EtoDirs xtoDirs) {
    Directory var = xtoDirs.var(getCode());
    return new OsDirs(var);
  }

  private String getCode() {
    return "eto";
  }

}
TOP

Related Classes of br.com.objectos.rio.eto.os.EtoOsPrepareOptions

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.