pkg

package
v0.0.0-...-9bec091 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 24, 2018 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Copyright © 2017 Daniel Jay Haskin <djhaskin987@gmail.com>

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.

Index

Constants

View Source
const ControlDirectory = "pask"

Name of the directory relative to the root where control files will be installed. Also the name of the directory relative to the root of package archives where control files will be looked for.

Variables

This section is empty.

Functions

This section is empty.

Types

type Package

type Package struct {
	Name     string `yaml:"name"`
	Version  string `yaml:"version"`
	Location string `yaml:"location"`
}

func (*Package) Install

func (p *Package) Install(root string) error

Accepts a UTF-8 encoded archive name. Name must be a valid URL. It currently supports URLS which point to files with the suffix ".tar.xz". This function will not override previously existing files. If it encounters one, it will stop processing and return an error. Runs the `postinst` task, if it exists, after installation is complete. TODO: add logging

func (*Package) Run

func (p *Package) Run(root string, task string) error

Locates a file called <root>/<ControlDirectory>/packages/<name>/<version>/tasks/<task>. If it is executable, run it. If it is not, return an error. Return any errors along the way.

type Pask

type Pask interface {
	Install(root string) error
	Run(root string, task string) error
}

type Spec

type Spec struct {
	Packages []Package `yaml:"packages"`
}

func ReadSpec

func ReadSpec(sfile string) (*Spec, error)

func (*Spec) Install

func (s *Spec) Install(root string) error

func (*Spec) Run

func (s *Spec) Run(root string, task string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL