Archived
3
0

SpecParser update. New realease to match.

This commit is contained in:
Luka Vandervelden 2019-09-27 13:59:23 +02:00
parent 1b81f42366
commit a207e47ce5
10 changed files with 16 additions and 18 deletions

View File

@ -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 ' :: packaging-0.9.2'
@echo ' :: packaging-0.9.3'
@echo ''
@echo 'Generic targets:'
@echo ' - help  Prints this help message.'

View File

@ -1,6 +1,6 @@
package=packaging
version=0.9.2
version=0.9.3
variables+=(
LIBEXECDIR '$(PREFIX)/libexec'

View File

@ -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:

View File

@ -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

View File

@ -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", "."]

View File

@ -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

View File

@ -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

View File

@ -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|

View File

@ -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]

View File

@ -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"