SpecParser update. New realease to match.
This commit is contained in:
parent
1b81f42366
commit
a207e47ce5
6
Makefile
6
Makefile
@ -1,5 +1,5 @@
|
||||
PACKAGE = 'packaging'
|
||||
VERSION = '0.9.2'
|
||||
VERSION = '0.9.3'
|
||||
|
||||
PREFIX := /usr/local
|
||||
BINDIR := $(PREFIX)/bin
|
||||
@ -9,7 +9,7 @@ INCLUDEDIR := $(PREFIX)/include
|
||||
MANDIR := $(SHAREDIR)/man
|
||||
LIBEXECDIR := $(PREFIX)/libexec
|
||||
SYSCONFDIR := $(PREFIX)/etc
|
||||
VERSION := 0.9.2
|
||||
VERSION := 0.9.3
|
||||
|
||||
CC := cc
|
||||
AR := ar
|
||||
@ -162,7 +162,7 @@ $(PACKAGE)-$(VERSION).tar.bz2: distdir
|
||||
$(PACKAGE)-$(VERSION)/src/config.cr
|
||||
|
||||
help:
|
||||
@echo '[01;37m :: packaging-0.9.2[00m'
|
||||
@echo '[01;37m :: packaging-0.9.3[00m'
|
||||
@echo ''
|
||||
@echo '[01;37mGeneric targets:[00m'
|
||||
@echo '[00m - [01;32mhelp [37m Prints this help message.[00m'
|
||||
|
@ -1,6 +1,6 @@
|
||||
|
||||
package=packaging
|
||||
version=0.9.2
|
||||
version=0.9.3
|
||||
|
||||
variables+=(
|
||||
LIBEXECDIR '$(PREFIX)/libexec'
|
||||
|
@ -1,5 +1,5 @@
|
||||
name: packaging
|
||||
version: 0.9.2
|
||||
version: 0.9.3
|
||||
|
||||
# authors:
|
||||
# - name <email@example.com>
|
||||
@ -8,7 +8,7 @@ version: 0.9.2
|
||||
# Short description of package
|
||||
|
||||
dependencies:
|
||||
specfileparser:
|
||||
specparser:
|
||||
git: https://git.karchnu.fr/WeirdOS/recipes-parser
|
||||
|
||||
# dependencies:
|
||||
|
@ -36,7 +36,7 @@ class ApkBackend < Package::Backend::Packaging
|
||||
@name = "apk"
|
||||
end
|
||||
|
||||
def package(context : Package::Context, package : Package::Package)
|
||||
def package(context : Package::Context, package : Package::Package) : Bool
|
||||
# FIXME: This needs to have access to architecture (from Context?)
|
||||
# to work properly.
|
||||
old_cwd = Dir.current
|
||||
|
@ -5,7 +5,7 @@ class PkgutilsBackend < Package::Backend::Packaging
|
||||
@name = "pkgutils"
|
||||
end
|
||||
|
||||
def package(context : Package::Context, package : Package::Package)
|
||||
def package(context : Package::Context, package : Package::Package) : Bool
|
||||
puts "#{package.fake_root_directory} -> #{context.packages_directory}/#{package.name}##{package.version}-#{package.release}.pkg.tar.xz"
|
||||
pp! r = context.run package.fake_root_directory, "tar", ["cJf", "#{context.packages_directory}/#{package.name}##{package.version}.pkg.tar.xz", "."]
|
||||
|
||||
|
@ -8,7 +8,7 @@ class WeirdBackend < Package::Backend::Packaging
|
||||
@name = "weird"
|
||||
end
|
||||
|
||||
def package(context : Package::Context, package : Package::Package)
|
||||
def package(context : Package::Context, package : Package::Package) : Bool
|
||||
destination_package_file = "#{context.packages_directory}/#{package.name}-#{package.version}-#{package.release}.weird"
|
||||
|
||||
tmpdir = package.recipe.working_directory
|
||||
|
@ -1,6 +1,6 @@
|
||||
require "colorize"
|
||||
|
||||
require "specfileparser"
|
||||
require "specparser"
|
||||
|
||||
require "./exception.cr"
|
||||
|
||||
@ -250,7 +250,7 @@ class Package::Context
|
||||
end
|
||||
|
||||
def read_configuration(filename : String)
|
||||
specs = SpecFileParser.parse(filename).not_nil!
|
||||
specs = SpecParser.parse(filename)
|
||||
|
||||
specs.assignments.each do |key, value|
|
||||
case key
|
||||
|
@ -21,7 +21,7 @@ skip_build_dependencies = false
|
||||
print_deps = false
|
||||
|
||||
used_X = false
|
||||
OptionParser.parse! do |parser|
|
||||
OptionParser.parse do |parser|
|
||||
parser.banner = "Usage: package [options] <port <port <…>>>"
|
||||
|
||||
parser.on("-X DIR", "--repository DIR", "Sets a ports repository for finding dependencies (default=.).") { |dir|
|
||||
|
@ -1,4 +1,4 @@
|
||||
require "specfileparser"
|
||||
require "specparser"
|
||||
|
||||
class Package::Package
|
||||
getter recipe : Recipe
|
||||
@ -7,7 +7,7 @@ class Package::Package
|
||||
def initialize(@recipe, @automatic = false, @fake_root_directory = nil)
|
||||
end
|
||||
|
||||
def initialize(@recipe, section : SpecFileParser::Section)
|
||||
def initialize(@recipe, section : SpecParser::Section)
|
||||
@automatic = false
|
||||
|
||||
@name = section.options[0]
|
||||
|
@ -2,7 +2,7 @@ require "uuid"
|
||||
require "uri"
|
||||
require "file_utils"
|
||||
|
||||
require "specfileparser"
|
||||
require "specparser"
|
||||
|
||||
require "./context.cr"
|
||||
require "./package.cr"
|
||||
@ -91,7 +91,7 @@ class Package::Recipe
|
||||
end
|
||||
|
||||
def initialize(@context, filename : String)
|
||||
specs = SpecFileParser.parse filename, {
|
||||
specs = SpecParser.parse filename, {
|
||||
"pkg" => fake_root_directory,
|
||||
"prefix" => prefix
|
||||
}
|
||||
@ -101,8 +101,6 @@ class Package::Recipe
|
||||
|
||||
@recipe_directory = File.dirname filename
|
||||
|
||||
raise "Could not parse `#{filename}`" if specs.nil?
|
||||
|
||||
specs.assignments.each do |key, value|
|
||||
case key
|
||||
when "name"
|
||||
|
Reference in New Issue
Block a user