Hello community,
here is the log from the commit of package installation-images-openSUSE for
openSUSE:Factory checked in at 2016-09-28 15:02:48
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/installation-images-openSUSE (Old)
and /work/SRC/openSUSE:Factory/.installation-images-openSUSE.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "installation-images-openSUSE"
Changes:
--------
---
/work/SRC/openSUSE:Factory/installation-images-openSUSE/installation-images-openSUSE.changes
2016-09-23 11:27:55.000000000 +0200
+++
/work/SRC/openSUSE:Factory/.installation-images-openSUSE.new/installation-images-openSUSE.changes
2016-09-28 15:02:50.000000000 +0200
@@ -1,0 +2,9 @@
+Fri Sep 23 11:50:28 UTC 2016 - [email protected]
+
+- adjust to release package changes
+- update documentation
+- extend file list syntax
+- adjust to obs api change
+- 14.270
+
+-------------------------------------------------------------------
Old:
----
installation-images-14.269.tar.xz
New:
----
installation-images-14.270.tar.xz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ installation-images-openSUSE.spec ++++++
--- /var/tmp/diff_new_pack.B2Zjv9/_old 2016-09-28 15:02:51.000000000 +0200
+++ /var/tmp/diff_new_pack.B2Zjv9/_new 2016-09-28 15:02:51.000000000 +0200
@@ -379,7 +379,7 @@
Summary: Installation Image Files for %theme
License: GPL-2.0+
Group: Metapackages
-Version: 14.269
+Version: 14.270
Release: 0
Provides: installation-images = %version-%release
Source: installation-images-%{version}.tar.xz
++++++ installation-images-14.269.tar.xz -> installation-images-14.270.tar.xz
++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/installation-images-14.269/VERSION
new/installation-images-14.270/VERSION
--- old/installation-images-14.269/VERSION 2016-09-22 13:35:53.000000000
+0200
+++ new/installation-images-14.270/VERSION 2016-09-23 13:48:06.000000000
+0200
@@ -1 +1 @@
-14.269
+14.270
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/installation-images-14.269/changelog
new/installation-images-14.270/changelog
--- old/installation-images-14.269/changelog 2016-09-22 13:35:53.000000000
+0200
+++ new/installation-images-14.270/changelog 2016-09-23 13:48:06.000000000
+0200
@@ -1,3 +1,9 @@
+2016-09-23: 14.270
+ - adjust to release package changes
+ - update documentation
+ - extend file list syntax
+ - adjust to obs api change
+
2016-09-21: 14.269
- update module.config to match 4.8
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/installation-images-14.269/data/initrd/initrd.file_list
new/installation-images-14.270/data/initrd/initrd.file_list
--- old/installation-images-14.269/data/initrd/initrd.file_list 2016-09-22
13:35:53.000000000 +0200
+++ new/installation-images-14.270/data/initrd/initrd.file_list 2016-09-23
13:48:06.000000000 +0200
@@ -98,15 +98,16 @@
?xen-tools-domU:
if theme eq 'SLES'
- sles-release:
+ ReleasePackage = sles-release
sles-release-MINI:
elsif theme eq 'SLED'
- sled-release:
+ ReleasePackage = sled-release
sled-release-MINI:
else
- openSUSE-release:
+ ReleasePackage = openSUSE-release
openSUSE-release-mini:
endif
+<ReleasePackage>:
linuxrc:
if linuxrc
@@ -563,7 +564,12 @@
include texts.file_list
# patch out 'Server' from product name
-R s/ Server//g etc/os-release
+# sometimes os-release is in /etc, sometimes in /usr/lib
+if exists(<ReleasePackage>, usr/lib/os-release)
+ R s/ Server//g usr/lib/os-release
+else
+ R s/ Server//g etc/os-release
+endif
R s/ Server//g etc/issue
# remove files we don't want to show up at all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/installation-images-14.269/data/rescue/rescue.file_list
new/installation-images-14.270/data/rescue/rescue.file_list
--- old/installation-images-14.269/data/rescue/rescue.file_list 2016-09-22
13:35:53.000000000 +0200
+++ new/installation-images-14.270/data/rescue/rescue.file_list 2016-09-23
13:48:06.000000000 +0200
@@ -172,15 +172,16 @@
xz:
if theme eq 'SLES'
- sles-release:
+ ReleasePackage = sles-release
sles-release-MINI:
elsif theme eq 'SLED'
- sled-release:
+ ReleasePackage = sled-release
sled-release-MINI:
else
- openSUSE-release:
+ ReleasePackage = openSUSE-release
openSUSE-release-mini:
endif
+<ReleasePackage>:
# we have full samba in rescue-server
if filelist ne 'rescue-server'
@@ -357,7 +358,12 @@
d /sys
# patch out 'Server' from product name
-R s/ Server//g etc/os-release
+# sometimes os-release is in /etc, sometimes in /usr/lib
+if exists(<ReleasePackage>, usr/lib/os-release)
+ R s/ Server//g usr/lib/os-release
+else
+ R s/ Server//g etc/os-release
+endif
R s/ Server//g etc/issue
# remove files we don't want to show up at all
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/installation-images-14.269/doc/files.md
new/installation-images-14.270/doc/files.md
--- old/installation-images-14.269/doc/files.md 2016-09-22 13:35:53.000000000
+0200
+++ new/installation-images-14.270/doc/files.md 2016-09-23 13:48:06.000000000
+0200
@@ -3,7 +3,7 @@
## Adding packages to the current (open)SUSE installation
Starting with openSUSE 13.1 and SLE12, the easiest way to include a package in
-the installation system is modifying the ```installation-images```
+the installation system is modifying the `installation-images`
package in the Open Build Service. That package evaluates the dependencies and
automatically adds the required packages. Simply add the needed packages as a
Requires dependency to the respective package and that's it.
@@ -16,21 +16,21 @@
it only works for full packages, but it's often useful to include just a subset
of the files in a given package.
-For every generated image there is a subdirectory in the ```data``` directory.
+For every generated image there is a subdirectory in the `data` directory.
Among other several things, those directories contain files with the extension
-```.file_list```. In order to fine tune the content of the generated images,
-just modify the corresponding ```.file_list``` file according to the syntax
+`.file_list`. In order to fine tune the content of the generated images,
+just modify the corresponding `.file_list` file according to the syntax
described below.
Keep in mind that in order to make sure the images still can be generated in
the
-Open Build Service, it's necessary to add the corresponding ```BuildRequires```
-to the ```installation-images``` package.
+Open Build Service, it's necessary to add the corresponding `BuildRequires`
+to the `installation-images` package.
## Format of the file list
### Comments
-Lines starting with '#' are comments, empty lines are ignored. Example:
+Lines starting with `'#'` are comments, empty lines are ignored. Example:
```
# some comment
@@ -38,8 +38,8 @@
### Including other files
-You can include other files with the following syntax, where ```FILE```
-is relative to the data/*/ tree.
+You can include other files with the following syntax, where `FILE`
+is relative to the `data/*/` tree.
```
include FILE
@@ -47,17 +47,18 @@
### Conditional sections
-You can use if/elsif/else/endif with the following syntax.
+You can use `if/elsif/else/endif` with the following syntax.
```
if EXPRESSION
```
-```EXPRESSION``` is more or less a valid perl expression except that
-variables don't have a starting '$' and are implicitly environment
-variables. The only exceptions to this are ```abuild``` and ```arch```.
+`EXPRESSION` is more or less a valid perl expression except that
+variables don't have a starting `'$'` and are implicitly environment
+variables. The only exceptions to this are `abuild` and `arch`.
-Also, you can use ```exists(PACKAGE)``` to test for a specific package.
+Also, you can use `exists(PACKAGE)` to test for a specific package or
+`exists(PACKAGE, FILE)` to test for a file in a package.
Example:
@@ -71,6 +72,21 @@
endif
```
+### Environment variables
+
+You can set environment variables:
+
+```
+MyVar1 = package-xxx
+MyVar2 = "Value With Spaces"
+```
+and use them everywhere by putting the variable name between `'<'` and `'>'`:
+
+```
+ <MyVar1>:
+ MyVar3 = <MyVar2>
+```
+
### Packages
This syntax can be used to include files from a given package.
@@ -84,18 +100,18 @@
You can add tags (comma-separated) after the colon. The following tags
are supported:
- - requires: create a file ```PACKAGE_NAME.requires``` in the image root
+ - requires: create a file `PACKAGE_NAME.requires` in the image root
- nodeps: ignore package dependencies when solving
- ignore: ignore package ('BuildIgnore')
-```PACKAGE_NAME``` may be empty which can be used to tell the parser that
+`PACKAGE_NAME` may be empty which can be used to tell the parser that
subsequent lines do not belong to any package.
-```PACKAGE_NAME``` can contain '*'s. In that case the latest package version
-is used. If ```PACKAGE_NAME``` ends in '~' the last but one version is used.
+`PACKAGE_NAME` can contain `'*'`s. In that case the latest package version
+is used. If `PACKAGE_NAME` ends in `'~'` the last but one version is used.
-If ```PACKAGE_NAME``` starts with a '?', the package is optional.
-This is a handy shortcut if you'd otherwise use an 'if' with exists().
+If `PACKAGE_NAME` starts with a `'?'`, the package is optional.
+This is a handy shortcut if you'd otherwise use an `if` with `exists()`.
Examples:
@@ -113,7 +129,7 @@
<action> <arg1> <arg2> ...
```
-Do the specified action. ```<action>``` is one of these:
+Do the specified action. `<action>` is one of these:
- Add the file/directory tree to the image:
@@ -194,7 +210,7 @@
s <args>
```
-- Apply a patch from the ```data/*/``` tree. The patch **must not** contain
+- Apply a patch from the `data/*/` tree. The patch **must not** contain
absolute path names!
```
@@ -251,11 +267,13 @@
E <script>
```
-- Apply a perl regexp in a sed-like fashion to a file, ```<regexp>``` may
- contain white space but not ```<file>```.
- If this is a multi line regexp (ends with /s) it is applied to
+- Apply a perl regexp in a sed-like fashion to a file, `<regexp>` may
+ contain white space but not `<file>`.
+ If this is a multi line regexp (ends with `/s`) it is applied to
the whole file. Otherwise the regexp is applied to each line.
+ Note: `<file>` must not be an absolute symlink!
+
```
R <regexp> <file>
```
@@ -268,8 +286,8 @@
f <dir> <name> <dst>
```
-- search for a file ```<name>``` (in the local system!) below ```<dir>``` and
- copy it to ```<dst>``` (```<dst>``` may be omitted)
+- search for a file `<name>` (in the local system!) below `<dir>` and
+ copy it to `<dst>` (`<dst>` may be omitted)
```
F <dir> <name> <dst>
@@ -314,7 +332,7 @@
Note that the template should contain some action (it should not be
empty) because otherwise the matching will continue. If you don't need
-any action use something inconspicuous, e.g. 'd .'.
+any action use something inconspicuous, e.g. `'d .'`.
### Resolving dependencies
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/installation-images-14.269/lib/AddFiles.pm
new/installation-images-14.270/lib/AddFiles.pm
--- old/installation-images-14.269/lib/AddFiles.pm 2016-09-22
13:35:53.000000000 +0200
+++ new/installation-images-14.270/lib/AddFiles.pm 2016-09-23
13:48:06.000000000 +0200
@@ -65,6 +65,7 @@
sub add_pack;
sub _add_pack;
sub find_missing_packs;
+sub rpm_has_file;
sub fixup_re;
my $ignore;
@@ -160,9 +161,7 @@
s/<rpm_file>/$rpm_file/g;
s/<(kernel_ver|kernel_mods|kernel_rpm|kernel_img|(suse|sles|sled)_release|theme|base_theme|splash_theme|yast_theme|product|product_name|update_dir|load_image|min_memory|instsys_build_id|instsys_complain|instsys_complain_root|arch|lib)>/$ConfigData{$1}/g;
- for my $i (qw( linuxrc lang extramod items )) {
- s/<$i>/$ENV{$i}/g if exists $ENV{$i};
- }
+ s/<(\w+)>/exists $ENV{$1} ? $ENV{$1} : "<$1>"/eg;
if(/^endif/) {
$if_val >>= 1;
@@ -213,6 +212,16 @@
print "*$ifmsg" if $debug =~ /\bif\b/;
+ # set environment var
+ if(/^(\w+)\s*=\s*(.*+)\s*$/) {
+ my $key = $1;
+ my $val = $2;
+ $val =~ s/^(['"])(.*)\1$/$2/;
+ print "$key = \"$val\"\n" if $debug =~ /\bif\b/;
+ $ENV{$key} = $val;
+ next;
+ }
+
if(/^include\s+(\S+)$/) {
die "$Script: recursive include not supported" if $inc_it;
$inc_file = $1;
@@ -826,6 +835,29 @@
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Check if an rpm contains a file.
+#
+# rpm_has_file(rpm, file)
+#
+# If file is missing, verifies only existence of rpm.
+#
+sub rpm_has_file
+{
+ my ($rpm, $file) = @_;
+
+ return 0 if !RealRPM $rpm;
+
+ return 1 if $file eq "";
+
+ my $rpm_dir = ReadRPM $rpm;
+
+ return 0 if !$rpm_dir;
+
+ return -e "$rpm_dir/rpm/$file";
+}
+
+
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
sub fixup_re
{
local ($_);
@@ -845,7 +877,8 @@
substr($re, length($2), length($3)) = $val;
}
- $re =~ s/\bexists\(([^)]*)\)/RealRPM($1) ? 1 : 0/eg;
+ $re =~ s/\bexists\(([^),]+),\s*([^)]*)\)/rpm_has_file($1, $2) ? 1 : 0/eg;
+ $re =~ s/\bexists\(([^)]*)\)/rpm_has_file($1) ? 1 : 0/eg;
return $re;
}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/installation-images-14.269/lib/ReadConfig.pm
new/installation-images-14.270/lib/ReadConfig.pm
--- old/installation-images-14.269/lib/ReadConfig.pm 2016-09-22
13:35:53.000000000 +0200
+++ new/installation-images-14.270/lib/ReadConfig.pm 2016-09-23
13:48:06.000000000 +0200
@@ -679,7 +679,10 @@
my @err;
my %added;
- open $f, "curl -k -s -T $t -X POST
'$ConfigData{obs_server}/build/$prj/$repo/$ConfigData{obs_arch}/_repository/_buildinfo?debug=1'
|";
+ my $cmd = "curl -k -s -T $t -H 'Content-Type: application/octet-stream' -X
POST
'$ConfigData{obs_server}/build/$prj/$repo/$ConfigData{obs_arch}/_repository/_buildinfo?debug=1'";
+
+ print "== $cmd ==\n" if $ENV{debug} =~ /solv/;
+ open $f, "$cmd |";
while(<$f>) {
print $_ if $ENV{debug} =~ /solv/;
$added{$1} = $3 if /^added (\S+?)(\@\S+)? because of (\S+?)(:|$)/;