qrpm 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 449228e498e0856af0253472dd643db07f548cccece91096ab858651facf7d77
4
- data.tar.gz: d476f3ada3fc7502a422c7a5454383e46c5a7d880020d291e71cf313c8c4929b
3
+ metadata.gz: 8e586c518e0a92575d817d0bc83c3a3d5de1355249952535ad0ab9cb3e0c980c
4
+ data.tar.gz: 7216415b387f365a3b8979904a8302de92d0b5d18ef5d2c05e1813ce4dbacba2
5
5
  SHA512:
6
- metadata.gz: '099a87257e60bbe0aa18164d1a09bc62961bc4352a2ca607ce7c9d5f8cc377560eea20398af5f8a0bfb71ad4fa84423f6a501e723cd40cad7a8e6cbdb5e391e2'
7
- data.tar.gz: cbd7563e7ebd7153f228168b87f43bc2f6af453a58642445efb03936e7ae93b0ff2fc09eb952471c824bd14c0a106fa52466eb5ee6a40c5e9bb4b6aa168d1e86
6
+ metadata.gz: cffc3d4360cabdc426ee1fc2a0e74c75faf58f04f2f9eb888738d7505550c87d7ccc37832b1e8b312b13b5fa3c8e14c65253434b7a65468335646e6c3546d3db
7
+ data.tar.gz: 111553786fc1513e752816314745bac348d7d2a0c638d71facc00c5edf39ee2ca5db36951730b7998f1afdbf001a76bdfbfd86fd33fdf3b44955b612d65191fd
data/example.yml CHANGED
@@ -1,84 +1,180 @@
1
- # QRPM configuration file. See https://github.com/clrgit/qrpm
1
+ # Example QRPM configuration file that shows all possibilities. See
2
+ # 'qrpm --help' for the full documentation
3
+ #
4
+ # A qrpm file is a YAML file with three kinds of top-level entries: RPM
5
+ # fields, variables, and directories. A line with '__END__' terminates the
6
+ # file, everything after it is ignored
2
7
 
3
- # program ::= directory...
4
- # directory ::= field... directory...
5
- # field ::= key '*' value
6
- # directory ::= array(string)
8
+ # RPM FIELDS
7
9
  #
8
- # TODO
9
- # o Use '@' instead of '$'. Yields @name and @{name} that doesn't interfere
10
- # with bash expansion
11
- #
10
+ # All fields have defaults so the shortest possible qrpm file is a single
11
+ # directory entry
12
+
13
+ name: example # Default is the name of the current directory
14
+ summary: An example package # Default 'The $name RPM package'
15
+ description: | # Default is the summary
16
+ A longer description of the package. It can span
17
+ several lines
18
+ # version: 1.2.3 # Default is extracted from the newest
19
+ # tag/branch in the git history, see
20
+ # 'qrpm --help' for the details
21
+ # version_file: lib/version.rb # Scan a file for the version instead. Can't
22
+ # be used together with version
23
+ release: 1 # Default 1
24
+ packager: Some Body <somebody@example.com> # Default is the name of the current user
25
+ license: MIT # Default GPL
26
+ require: # Required packages. A single name or a list
27
+ - bash
28
+ - ruby >= 3.0
29
+
30
+ # INCLUDE FILES
12
31
  #
13
- # ${{name}} in $(...)
14
- # QRPM dependency check variable definitions and needs to be able to detect
15
- # variable usages in $(...) constructs
16
-
17
- # @include git-project
18
- # -> version: $(cd ${{srcdir}}; git tag | tail -1 | sed 's/^v//')
19
- #
20
- # @include postgres-project prefix: pg_
21
- # -> pg_name
22
- # pg_version
23
- # pg_libdir
24
- # pg_sharedir
32
+ # Other qrpm files can be included. Their entries are merged into this file
33
+ # and later definitions win. './file' is relative to the directory of the
34
+ # qrpm file and '../file' to its parent, '/file' is an absolute path, and a
35
+ # bare name is searched for in the directories given with the -I option
25
36
  #
26
- # @include postgres-project git@github.com:... commit-id
37
+ # include: ./common.yml
38
+ # include:
39
+ # - ./common.yml
40
+ # - site-defaults.yml
41
+
42
+ # VARIABLES
27
43
  #
28
- # @include redhat/httpd
29
- # @include redhat/pg
30
- # @include pgdg
44
+ # Any other key is a variable. Values can refer to other variables with $name
45
+ # or ${name}, and to members of nested variables with $pg.version. Use ${name}
46
+ # when the variable is followed by a letter, a digit, or a dot as in
47
+ # ${name}.conf. Variables can be overridden on the command line:
31
48
  #
32
- # pg.version: 14
33
- # pg: pgdg[14]
34
-
35
- name: $pg_name-url_encode
36
- summary: Adds the 'url_encode' extension to postgres ${pg.version}
37
- description: RPM wrapper for the postgres url_encode extension (https://github.com/okbob/url_encode)
38
- version: $(cd ${{srcdir}}; git tag | tail -1 | sed 's/^v//')
39
- # ^Oops, hardcoded FIXME: Have a dependency graph and use some standard algorithm
40
-
41
- include:
42
- - ./qrpm.includes
43
-
44
- requires:
45
- - $pg_name-server
46
- - $pg_name-libs
47
-
48
- a: $b
49
- b: $c
50
- c: $a
51
- # Idea
52
- #submod: url_encode
53
- #subdir: url_encode
54
- #patches:
55
- # - patch/patch1.patch
56
- srcdir: url_encode
57
-
58
- root: ""
49
+ # qrpm prefix=/opt/other example.yml
59
50
 
51
+ prefix: /opt/$name
60
52
  pg:
61
- name: $(rpm -q --qf '%{NAME}\n' -f $(readlink -f $(which pg_config)))
62
- version: $(pg_config --version | sed 's/^[^0-9]* \([0-9]\+\).*$/\1/')
63
- major: $version
64
- libdir: $(pg_config --libdir)
65
- sharedir: $(pg_config --sharedir)
53
+ version: 15
54
+ libdir: /usr/pgsql-$pg.version/lib
55
+
56
+ # $(command) runs the command with bash when the qrpm file is compiled and
57
+ # uses its output as the value. Variables inside the command are written
58
+ # ${{name}}. Everything from '$(' to the last ')' on the line is the command
59
+ year: $(date +%Y)
60
+ tarname: $(basename ${{prefix}})
61
+
62
+ # A backslash escapes '$'
63
+ price: \$5
66
64
 
67
- #init: # FIXME Doesn't work atm
68
- # - git submodule init
69
- # - git submodule update
65
+ # The source directory. File paths in the directory entries below are
66
+ # relative to it and the build routine runs in it. Default '.'
67
+ srcdir: example
70
68
 
69
+ # ROUTINES
70
+ #
71
+ # Routines are shell scripts. They are not interpolated, instead the qrpm
72
+ # variables they refer to are defined as shell variables at the top of the
73
+ # script. Shell variables, positional parameters, and $(...) work as usual.
74
+ # 'make' runs in the source directory on the build host when the package is
75
+ # built. Nothing is built if it is left out
71
76
  make: |
72
- cd $srcdir; make
77
+ echo "Built in $year on $(hostname)" > bin/another_file
78
+
79
+ # 'pre' and 'post' run on the installation host before and after the package
80
+ # is installed, 'pre_uninstall' and 'post_uninstall' before and after it is
81
+ # uninstalled. $1 is 1 on install and 2 on upgrade
82
+ post: |
83
+ if [ $1 -eq 1 ]; then
84
+ echo "$name $version installed in $prefix"
85
+ fi
86
+
87
+ post_uninstall: |
88
+ echo "$name uninstalled"
89
+
90
+ # DIRECTORIES
91
+ #
92
+ # A directory entry is a key that is a path or starts with a variable, with a
93
+ # list of files as value. The standard directories are
94
+ #
95
+ # $etcdir $bindir $sbindir $libdir $libexecdir $sharedir $docdir $vardir
96
+ # $spooldir $rundir $lockdir $cachedir $logdir $tmpdir
97
+ #
98
+ # A standard directory resolves to the system directory (eg. /etc) when it is
99
+ # the only directory in the package and otherwise to a package subdirectory
100
+ # (eg. /etc/$name). Use the explicit variants when it matters: $sysetcdir is
101
+ # always /etc and $pcketcdir is always /etc/$name. There is no package
102
+ # subdirectory for bin and sbin. See 'qrpm --help' for the full list
103
+
104
+ # A plain list of files. The destination name is the basename of the source
105
+ $bindir:
106
+ - bin/a_file
107
+ - bin/another_file
108
+
109
+ # A file can also be a hash with the following keys
110
+ #
111
+ # file Path to the source file, relative to $srcdir
112
+ # name Destination file name. Default is the basename of the source
113
+ # perm Permissions in octal (0640) or symbolic chmod(1) notation
114
+ # (u=rw,g=r,o=). Default is the permissions of the source
115
+ # symlink Path on the target system that the destination links to
116
+ # reflink Path on the target system that the destination hard links to
117
+ # owner Owner in user.group notation, eg. apache.apache, apache, or
118
+ # .apache
119
+ # config Configuration file: true, false, or noreplace. Files in /etc
120
+ # default to noreplace, so they are kept on upgrade and the new
121
+ # file is saved next to them
122
+ # dir Name of a directory that is created on the target system. It
123
+ # is initially empty but other entries can add files to it, which
124
+ # makes it possible to set the permissions and owner of a
125
+ # directory
126
+ #
127
+ # Exactly one of file, symlink, reflink, and dir must be given. perm, owner,
128
+ # and config can't be used with links, and name and config can't be used
129
+ # with dir
130
+ $sbindir:
131
+ - name: example-admin
132
+ file: bin/a_file
133
+ perm: u=rwx,g=rx,o=
134
+ - symlink: /usr/bin/a_file # Creates /usr/sbin/a_file -> /usr/bin/a_file
135
+ - name: a_link
136
+ reflink: /usr/bin/another_file
137
+
138
+ # The package subdirectory /usr/share/example
139
+ $pcksharedir:
140
+ - share/some_data
141
+
142
+ # Paths can be extended and can contain variables
143
+ $pcksharedir/data:
144
+ - share/some_other_data
145
+
146
+ # A directory can also be a variable. $pg.libdir is the libdir member of the
147
+ # pg variable defined above, so this is /usr/pgsql-15/lib
148
+ $pg.libdir:
149
+ - share/some_data
150
+
151
+ $prefix/etc:
152
+ - name: ${name}.conf
153
+ file: share/some_data
154
+ perm: 0640
155
+ config: noreplace # Not under /etc, so it must be given
73
156
 
74
- ${pg.sharedir}/extension:
75
- - $srcdir/url_encode.control
76
- - $srcdir/sql/url_encode--1.2.sql
157
+ # Files in /etc are configuration files by default
158
+ $pcketcdir:
159
+ - name: settings
160
+ file: share/some_data
161
+ - name: generated # Overwritten on upgrade, old file saved as .rpmsave
162
+ file: share/some_other_data
163
+ config: true
77
164
 
78
- ${pg.libdir}:
79
- - $srcdir/src/url_encode.so
80
- - $srcdir/postgresql$version
165
+ # A directory entry creates a directory with the given owner and permissions.
166
+ # It is initially empty, but other entries can add files to it. Here the
167
+ # store directory belongs to nobody and holds a file owned by the nobody group
168
+ $pckvardir:
169
+ - dir: store
170
+ owner: nobody.nobody
171
+ perm: 0750
172
+ - dir: cache # An empty directory with default owner and permissions
81
173
 
82
- $root/somedir:
83
- - $srcdir/somefile
174
+ $pckvardir/store:
175
+ - name: data
176
+ file: share/some_data
177
+ owner: .nobody
84
178
 
179
+ __END__
180
+ Everything after __END__ is ignored
data/exe/qrpm CHANGED
@@ -35,7 +35,6 @@ begin
35
35
  in git (which needs to be present). Other defaults are detailed below
36
36
 
37
37
  SETUP
38
-
39
38
  Use qrpm -t to generate a template qrpm.yml file:
40
39
 
41
40
  qrpm -t [TEMPLATE-FILE]
@@ -43,124 +42,202 @@ begin
43
42
  Then customize as needed
44
43
 
45
44
  VARIABLES
45
+ The configuration file can define and use variables. They are defined by
46
+ key/value definitions and the value can refer to values of other
47
+ variables using $NAME or ${NAME}. Variables can also be given on the
48
+ command line in <variable>=<value> format
46
49
 
47
- The configuration file can define and use variables. They are defined by
48
- key/value definitions and the value can refer to values of other
49
- variables using $NAME or ${NAME}. Variables can also be given on the
50
- command line in <variable>=<value> format
50
+ $(...) constructs are commands that are executed by bash(1). The parser
51
+ considers everything from the opening '$(' to the last ')' on the line as
52
+ part of the command so only one command is allowed. This restriction keeps
53
+ the parser simple, it may change in the future
51
54
 
52
- $(...) constructs are commands that are executed by bash(1). The parser
53
- considers everything from the opening '$(' to the last ')' on the line as
54
- part of the command so only one command is allowed. This restriction keeps
55
- the parser simple, it may change in the future
55
+ STANDARD VARIABLES
56
+ The following RPM variables are recognized. They all have defaults:
56
57
 
57
- The special 'make' variable takes a string and executes it before packaing
58
- the project
58
+ name
59
+ Name of the package. Default is the name of the current directory
59
60
 
60
- STANDARD VARIABLES
61
+ version
62
+ Version number. The default is extracted from the newest tag/branch
63
+ in the git history. See VERSIONS below
61
64
 
62
- The following RPM variables are recognized:
65
+ version_file
66
+ File that is scanned for the version. An alternative to 'version'
63
67
 
64
- name
65
- summary
66
- description
67
- version
68
- release
69
- packager
70
- requires
68
+ summary
69
+ A short one-line text. Default 'The <name> RPM package'
71
70
 
72
- INCLUDE FILES
71
+ description
72
+ A longer multiline text. Default is the summary
73
73
 
74
- The qrpm file can include other files that are searched for in a list of
75
- directories. Relative paths are relative to the directory of the qrpm file
76
- (but see the -C option). The search directories can be set on the command
77
- line using the -I option
74
+ release
75
+ Build number of this version of the package. It is appended to the
76
+ version in the package name (eg. 1.2.3-1) and is incremented when the
77
+ package is rebuilt without changing the version. Default 1
78
78
 
79
- BUILT-IN VARIABLES
79
+ packager
80
+ Packager name. Default the current user
81
+
82
+ license
83
+ License of the package. Default GPL
84
+
85
+ require
86
+ List of required RPM packages
87
+
88
+ ROUTINES
89
+ Routines are shell scripts that run when the package is built or when
90
+ it is installed or uninstalled. They are not interpolated. Instead the
91
+ qrpm variables they refer to as $name or ${name} are defined as shell
92
+ variables at the top of the script, so shell variables like $HOME,
93
+ positional parameters like $1, and $(...) constructs work as usual.
94
+ Variable names can't start with a digit for that reason:
95
+
96
+ make
97
+ Runs on the build host in the source directory when the package is
98
+ built
80
99
 
81
- There are the following built-in variables. They are listed below with their
82
- default values:
83
-
84
- rootdir /
85
- rootconfdir /etc
86
- rootexecdir /usr
87
- rootlibdir /usr
88
- rootconstdir /usr/share
89
- rootdocdir /usr/share
90
- rootdatadir /var
91
-
92
- sysetcdir /etc
93
- sysbindir /usr/bin
94
- syssbindir /usr/sbin
95
- syslibdir /usr/lib64
96
- syslibexecdir /usr/libexec
97
- syssharedir /usr/share
98
- sysdocdir /usr/share/doc
99
- sysvardir /var/lib
100
- sysspooldir /var/spool
101
- sysrundir /var/run
102
- syslockdir /var/lock
103
- syscachedir /var/cache
104
- syslogdir /var/log
105
- systmpdir /tmp
106
-
107
- pcketcdir /etc/NAME
108
- pckbindir /usr/bin
109
- pcksbindir /usr/sbin
110
- pcklibdir /usr/lib64/NAME
111
- pcklibexecdir /usr/libexec/NAME
112
- pcksharedir /usr/share/NAME
113
- pckdocdir /usr/share/doc/NAME
114
- pckvardir /var/NAME
115
- pckspooldir /var/spool/NAME
116
- pckrundir /var/run/NAME
117
- pcklockdir /var/lock/NAME
118
- pckcachedir /var/cache/NAME
119
- pcklogdir /var/log/NAME
120
- pcktmpdir /tmp/NAME
121
-
122
- Note that there are no package specific directories for bin and sbin
100
+ pre
101
+ Runs on the installation host before the package is installed
102
+
103
+ post
104
+ Runs on the installation host after the package is installed
105
+
106
+ pre_uninstall
107
+ Runs on the installation host before the package is uninstalled
108
+
109
+ post_uninstall
110
+ Runs on the installation host after the package is uninstalled
111
+
112
+ BUILT-IN VARIABLES
113
+ There are the following built-in variables. They are listed below with their
114
+ default values. Note that rootdir is a prefix of all other directories and
115
+ not a directory in itself, it is empty by default
116
+
117
+ rootdir
118
+ rootconfdir /etc
119
+ rootexecdir /usr
120
+ rootbindir /bin
121
+ rootsbindir /sbin
122
+ rootlibdir /usr
123
+ rootconstdir /usr/share
124
+ rootdocdir /usr/share
125
+ rootdatadir /var
126
+
127
+ The system directories are the standard directories of the system:
128
+
129
+ sysetcdir /etc
130
+ sysbindir /bin
131
+ syssbindir /sbin
132
+ syslibdir /usr/lib64
133
+ syslibexecdir /usr/libexec
134
+ syssharedir /usr/share
135
+ sysdocdir /usr/share/doc
136
+ sysvardir /var/lib
137
+ sysspooldir /var/spool
138
+ sysrundir /var/run
139
+ syslockdir /var/lock
140
+ syscachedir /var/cache
141
+ syslogdir /var/log
142
+ systmpdir /tmp
143
+
144
+ The package directories are subdirectories of the system directories
145
+ named after the package. There are no package specific directories for
146
+ bin and sbin:
147
+
148
+ pcketcdir /etc/NAME
149
+ pckbindir /bin
150
+ pcksbindir /sbin
151
+ pcklibdir /usr/lib64/NAME
152
+ pcklibexecdir /usr/libexec/NAME
153
+ pcksharedir /usr/share/NAME
154
+ pckdocdir /usr/share/doc/NAME
155
+ pckvardir /var/lib/NAME
156
+ pckspooldir /var/spool/NAME
157
+ pckrundir /var/run/NAME
158
+ pcklockdir /var/lock/NAME
159
+ pckcachedir /var/cache/NAME
160
+ pcklogdir /var/log/NAME
161
+ pcktmpdir /tmp/NAME
162
+
163
+ VERSIONS
164
+ The version is searched for in the git history of the source directory
165
+ when the qrpm file has no 'version' field. The highest version among
166
+ the tags reachable from HEAD wins. If there is none, the name of the
167
+ current branch is used. It is an error if no version is found, add a
168
+ 'version' field in that case
169
+
170
+ A tag or branch looks like a version if it is a semantic version with
171
+ the usual quirks: an optional prefix like 'release-' or 'release/', an
172
+ optional 'v', a pre-release suffix like '-rc1' or '.beta2', and build
173
+ metadata after '+'. Only the version and the pre-release suffix are
174
+ used and the suffix is separated with '~' so that rpm orders it before
175
+ the final version, eg. 'v2.0.0-rc1' becomes '2.0.0~rc1'
176
+
177
+ 'version_file' names a file relative to the source directory that is
178
+ scanned for a version instead of searching the git history. The first
179
+ version that follows the word 'version' wins, as in VERSION = "1.2.3"
180
+ or __version__ = '1.2.3', so that other dotted numbers in the file are
181
+ skipped. If there is none, the first version-like token (with at least
182
+ one dot) in the file is used. It can't be used together with
183
+ 'version':
184
+
185
+ version_file: lib/mypackage/version.rb
123
186
 
124
187
  INSTALLATION DIRECTORIES
188
+ The root directories are the prefixes that the system directories are
189
+ derived from. They correspond to the prefix variables of autoconf:
190
+ rootconfdir is sysconfdir, rootexecdir is exec_prefix (the root of the
191
+ architecture dependent files bin, sbin, lib and libexec), rootconstdir
192
+ is datarootdir, and rootdatadir is localstatedir. rootdir is a prefix
193
+ of all other directories and not a directory in itself. It is empty by
194
+ default. rootbindir and rootsbindir are /bin and /sbin, but on systems
195
+ where those are symbolic links (merged /usr) they are the directories
196
+ the links point to, typically /usr/bin and /usr/sbin:
125
197
 
126
- OPTIONS
198
+ INCLUDE FILES
199
+ The qrpm file can include other files that are searched for in a list of
200
+ directories. Relative paths are relative to the directory of the qrpm file
201
+ (but see the -C option). The search directories can be set on the command
202
+ line using the -I option
127
203
 
128
- -f,force
129
- Create package even if repository is dirty. Normally qrpm checks if the
130
- current (git) directory is clean
204
+ OPTIONS
205
+ -f,force
206
+ Create package even if repository is dirty. Normally qrpm checks if the
207
+ current (git) directory is clean
131
208
 
132
- -C,directory=EDIR
133
- Change to directory before doing anything else but include the current
134
- directory in the search path. This makes it possible to override parts of
135
- a spec file
209
+ -C,directory=EDIR
210
+ Change to directory before doing anything else but include the current
211
+ directory in the search path. This makes it possible to override parts of
212
+ a spec file
136
213
 
137
- +I,include=EDIR
138
- Include directory, later definitions are searched first
214
+ +I,include=EDIR
215
+ Include directory, later definitions are searched first
139
216
 
140
- -s,spec=OFILE?
141
- Only create the spec file and not the RPM package. Use this option to
142
- inspect what RPM is going to do
217
+ -s,spec=OFILE?
218
+ Only create the spec file and not the RPM package. Use this option to
219
+ inspect what RPM is going to do
143
220
 
144
- -S,source
145
- Create a source RPM file instead of a regular RPM file
221
+ -S,source
222
+ Create a source RPM file instead of a regular RPM file
146
223
 
147
- -t,template=OFILE?
148
- Generate a QRPM template. It is in YAML format with the extension that a
149
- single '__END__' terminates the file immediately. The name of the file
150
- defaults to 'qrpm.yml'. It is an error if the file exists
224
+ -t,template=OFILE?
225
+ Generate a QRPM template. It is in YAML format with the extension that a
226
+ single '__END__' terminates the file immediately. The name of the file
227
+ defaults to 'qrpm.yml'. It is an error if the file exists
151
228
 
152
- -T,force-template=OFILE?
153
- Like --template but overwrites file if it exists
229
+ -T,force-template=OFILE?
230
+ Like --template but overwrites file if it exists
154
231
 
155
- -b,builddir=NPATH?
156
- Use the given path as the RPM build dir, default is 'builddir'. Doesn't
157
- remove the directory afterwards. It it is an error if the directory exists
232
+ -b,builddir=NPATH?
233
+ Use the given path as the RPM build dir, default is 'builddir'. Doesn't
234
+ remove the directory afterwards. It it is an error if the directory exists
158
235
 
159
- -B,force-builddir=PATH?
160
- Like --builddir but overwrites the directory if it exists beforehand
236
+ -B,force-builddir=PATH?
237
+ Like --builddir but overwrites the directory if it exists beforehand
161
238
 
162
- -d,dump
163
- Dump internal data and exit. For debug
239
+ -d,dump
240
+ Dump internal data and exit. For debug
164
241
 
165
242
  COMMANDS
166
243
  show! -- QRPM-FILE VARIABLE...
@@ -172,7 +249,7 @@ begin
172
249
 
173
250
  if opts.template? || opts.force_template?
174
251
  outfile = opts.template || opts.force_template || Qrpm::QRPM_CONFIG_FILE
175
- opts.force_template? || !File.exists?(outfile) or ShellOpts.error "Won't overwrite existing file: #{outfile}"
252
+ opts.force_template? || !File.exist?(outfile) or ShellOpts.error "Won't overwrite existing file: #{outfile}"
176
253
  FileUtils::cp Qrpm::QRPM_CONFIG_FILE_TEMPLATE, outfile
177
254
  puts "Generated #{outfile}" if !opts.quiet?
178
255
  exit
@@ -216,9 +293,8 @@ begin
216
293
  builddir = nil
217
294
  end
218
295
 
219
- # Check if repository is clean
220
- opts.force? || opts.dump? || `cd #{qrpmdir}; git status --porcelain | grep -v '??' 2>/dev/null` == "" or
221
- ShellOpts.error "Repository is dirty"
296
+ # Check if repository is clean. Only changes below the qrpm directory count
297
+ opts.force? || opts.dump? || !Qrpm.dirty?(qrpmdir) or ShellOpts.error "Repository is dirty"
222
298
 
223
299
  # Create lexer
224
300
  lexer = Qrpm::Lexer.new([currdir, qrpmdir].uniq, opts.include.reverse)
@@ -242,7 +318,7 @@ begin
242
318
 
243
319
  if opts.subcommand == :show!
244
320
  for variable in show
245
- puts qrpm[variable].sub(/^\/\//, "/")
321
+ puts qrpm[variable]
246
322
  end
247
323
  exit
248
324
  end
@@ -271,7 +347,7 @@ begin
271
347
 
272
348
  puts "Built #{files.map { |f| File.basename(f) }.join(" ")}" if !opts.quiet?
273
349
 
274
- rescue RuntimeError => ex
350
+ rescue RuntimeError, Qrpm::CompileError => ex
275
351
  ShellOpts.failure ex.message
276
352
  end
277
353