Browse Source

SpecParser update. New realease to match.

master
Luka Vandervelden 3 years ago
parent
commit
a207e47ce5
  1. 6
      Makefile
  2. 2
      project.zsh
  3. 4
      shard.yml
  4. 2
      src/backends/apk.cr
  5. 2
      src/backends/pkgutils.cr
  6. 2
      src/backends/weird.cr
  7. 4
      src/context.cr
  8. 2
      src/main.cr
  9. 4
      src/package.cr
  10. 6
      src/recipe.cr

6
Makefile

@ -1,5 +1,5 @@ @@ -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 @@ -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 @@ -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.'

2
project.zsh

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

4
shard.yml

@ -1,5 +1,5 @@ @@ -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 @@ -8,7 +8,7 @@ version: 0.9.2
# Short description of package
dependencies:
specfileparser:
specparser:
git: https://git.karchnu.fr/WeirdOS/recipes-parser
# dependencies:

2
src/backends/apk.cr

@ -36,7 +36,7 @@ class ApkBackend < Package::Backend::Packaging @@ -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

2
src/backends/pkgutils.cr

@ -5,7 +5,7 @@ class PkgutilsBackend < Package::Backend::Packaging @@ -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", "."]

2
src/backends/weird.cr

@ -8,7 +8,7 @@ class WeirdBackend < Package::Backend::Packaging @@ -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

4
src/context.cr

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
require "colorize"
require "specfileparser"
require "specparser"
require "./exception.cr"
@ -250,7 +250,7 @@ class Package::Context @@ -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

2
src/main.cr

@ -21,7 +21,7 @@ skip_build_dependencies = false @@ -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|

4
src/package.cr

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
require "specfileparser"
require "specparser"
class Package::Package
getter recipe : Recipe
@ -7,7 +7,7 @@ class Package::Package @@ -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]

6
src/recipe.cr

@ -2,7 +2,7 @@ require "uuid" @@ -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 @@ -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 @@ -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"