qrpm 0.3.4 → 0.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/exe/qrpm +59 -1
  3. data/lib/qrpm/version.rb +1 -1
  4. data/lib/qrpm.rb +4 -5
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 69442a72ca837b3c52ffbda68a8859a7591cb626ce919f583bf7e39f116cc4ef
4
- data.tar.gz: 6d08a9ed16af1b3c8f9a6afe9d1d31958a78dc8d7ce19638039abac01ef9642f
3
+ metadata.gz: 9d468f2efcb7fffda8a4dad3e2476857ab62fa2b00def58c9ffbe8d59f7cc867
4
+ data.tar.gz: 91973e0057876141ede7bb1b1f7b3c5432ff320a25532b47736154c6be2c87a8
5
5
  SHA512:
6
- metadata.gz: 45fafccf06fb93ff1933ab932022421ad1952df731b7133bb831f8a3cedd303787fc46d82222f98c2b9845c3d5ed090ae8afdb075f24a4eb376b8f675580ad37
7
- data.tar.gz: c4a3d9c6f372de9e4fccb67af861aea6bc2529dccced89bd3028e2a46dcf122b16f01a9075c0981a7543e456fe90d2ed5504be02c7da532af78923bf744608fa
6
+ metadata.gz: 2158c236484f1e83f7a77cf53299d675413059be03939a7cd7a7577931c8af0ad56e71bcd07f08541d3e2fe24e2806ef3cc8708a8132b33e36c8176a6a07a2b3
7
+ data.tar.gz: e057e5818b904e1aa4526e66627d6d09f18180ba9185a151926954abf84e5235a21415dd6028c08617bc119cfb4d32a8ea35cdb058a7e718052ceb6165221b08
data/exe/qrpm CHANGED
@@ -55,6 +55,49 @@ begin
55
55
 
56
56
  BUILT-IN VARIABLES
57
57
 
58
+ There are the following built-in variables. They are listed below with their
59
+ default values:
60
+
61
+ rootdir /
62
+ rootconfdir /etc
63
+ rootexecdir /usr
64
+ rootlibdir /usr
65
+ rootconstdir /usr/share
66
+ rootdocdir /usr/share
67
+ rootdatadir /var
68
+
69
+ sysetcdir /etc
70
+ sysbindir /usr/bin
71
+ syssbindir /usr/sbin
72
+ syslibdir /usr/lib64
73
+ syslibexecdir /usr/libexec
74
+ syssharedir /usr/share
75
+ sysdocdir /usr/share/doc
76
+ sysvardir /var/lib
77
+ sysspooldir /var/spool
78
+ sysrundir /var/run
79
+ syslockdir /var/lock
80
+ syscachedir /var/cache
81
+ syslogdir /var/log
82
+ systmpdir /tmp
83
+
84
+ pcketcdir /etc/NAME
85
+ pckbindir /usr/bin
86
+ pcksbindir /usr/sbin
87
+ pcklibdir /usr/lib64/NAME
88
+ pcklibexecdir /usr/libexec/NAME
89
+ pcksharedir /usr/share/NAME
90
+ pckdocdir /usr/share/doc/NAME
91
+ pckvardir /var/NAME
92
+ pckspooldir /var/spool/NAME
93
+ pckrundir /var/run/NAME
94
+ pcklockdir /var/lock/NAME
95
+ pckcachedir /var/cache/NAME
96
+ pcklogdir /var/log/NAME
97
+ pcktmpdir /tmp/NAME
98
+
99
+ Note that there are no package specific directories for bin and sbin
100
+
58
101
  INSTALLATION DIRECTORIES
59
102
 
60
103
  OPTIONS
@@ -95,6 +138,11 @@ begin
95
138
 
96
139
  -d,dump
97
140
  Dump internal data and exit. For debug
141
+
142
+ COMMANDS
143
+ show! -- QRPM-FILE VARIABLE...
144
+ Output the value of a variable. Typically used to extract the version
145
+ number from a qrpm.yml file
98
146
  )
99
147
 
100
148
  opts, args = ShellOpts.process(SPEC, ARGV, verbose: true, quiet: true)
@@ -111,11 +159,14 @@ begin
111
159
  # on the command line
112
160
  overrides = {}
113
161
  file = nil
162
+ show = []
114
163
  while arg = args.extract(0..1)
115
164
  if arg =~ /^(.*?)=(.*)$/
116
165
  overrides[$1] = $2
117
166
  elsif file.nil?
118
167
  file = arg
168
+ elsif opts.subcommand == :show!
169
+ show << arg
119
170
  else
120
171
  args.expect(-1, "More than one file argument")
121
172
  end
@@ -131,7 +182,7 @@ begin
131
182
  File.directory?(qrpmdir) or error "Can't find '#{qrpmdir}'"
132
183
 
133
184
  # Compute builddir
134
- if opts.builddir? && opts.force_builddir?
185
+ if opts.builddir? && opts.force_builddir?
135
186
  ShellOpts.error "Can't use both --builddir and --force-builddir"
136
187
  elsif opts.builddir? || opts.force_builddir?
137
188
  builddir = opts.builddir || opts.force_builddir || "builddir"
@@ -166,6 +217,13 @@ begin
166
217
  qrpm = compiler.compile(conf)
167
218
  rpm = qrpm.rpm
168
219
 
220
+ if opts.subcommand == :show!
221
+ for variable in show
222
+ puts qrpm[variable].sub(/^\/\//, "/")
223
+ end
224
+ exit
225
+ end
226
+
169
227
  if opts.dump?
170
228
  puts "Compiler"
171
229
  indent { compiler.dump }
data/lib/qrpm/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Qrpm
4
- VERSION = "0.3.4"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/qrpm.rb CHANGED
@@ -68,8 +68,8 @@ module Qrpm
68
68
  syssbindir: "$rootexecdir/sbin",
69
69
  syslibdir: "$rootlibdir/lib64",
70
70
  syslibexecdir: "$rootexecdir/libexec",
71
- syssharedir: "$rootconstdir/$pckdir", # Always a subdir of /usr/share
72
- sysdocdir: "$syssharedir",
71
+ syssharedir: "$rootconstdir",
72
+ sysdocdir: "$syssharedir/doc",
73
73
  sysvardir: "$rootdatadir/lib",
74
74
  sysspooldir: "$rootdatadir/spool",
75
75
  sysrundir: "$rootdatadir/run",
@@ -79,11 +79,10 @@ module Qrpm
79
79
  systmpdir: "/tmp" # Always /tmp because of security
80
80
  }
81
81
 
82
- # There are no package-specific versions of bindir and sbindir
83
82
  PACKAGE_DIRS = {
84
83
  pcketcdir: "$sysetcdir/$pckdir",
85
- pckbindir: "$sysbindir", # No subdir
86
- pcksbindir: "$syssbindir", # No subdir
84
+ pckbindir: "$sysbindir", # No package-specific directory
85
+ pcksbindir: "$syssbindir", # No package-specific directory
87
86
  pcklibdir: "$syslibdir/$pckdir",
88
87
  pcklibexecdir: "$syslibexecdir/$pckdir",
89
88
  pcksharedir: "$syssharedir/$pckdir",
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: qrpm
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Claus Rasmussen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-15 00:00:00.000000000 Z
11
+ date: 2024-01-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: shellopts