summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitri John Ledkov <dimitri.j.ledkov@intel.com>2014-10-25 02:33:42 +0100
committerDimitri John Ledkov <dimitri.j.ledkov@intel.com>2014-10-25 02:33:42 +0100
commit31ec7f8a73cc77d937267b9ae440bed5485fea1e (patch)
treece8d31295bba41d2f7a8560ae002dfb362c8dd64
parent53ec11670b4264387ee59fe233e8122a39aa9174 (diff)
parentdafe67336672360deec05588173653813bedbcfc (diff)
Import obs-build_20141024.orig.tar.gz
-rw-r--r--Build.pm129
-rw-r--r--Build/Arch.pm20
-rw-r--r--Build/Deb.pm40
-rw-r--r--Build/Kiwi.pm20
-rw-r--r--Build/LiveBuild.pm15
-rw-r--r--Build/Rpm.pm20
-rw-r--r--Build/Susetags.pm20
-rw-r--r--Build/Zypp.pm20
-rw-r--r--COPYING340
-rw-r--r--Makefile3
-rwxr-xr-xbuild44
-rw-r--r--build-pkg19
-rw-r--r--build-pkg-arch23
-rw-r--r--build-pkg-deb31
-rw-r--r--build-pkg-rpm54
-rw-r--r--build-recipe20
-rw-r--r--build-recipe-arch21
-rw-r--r--build-recipe-dsc34
-rw-r--r--build-recipe-kiwi51
-rw-r--r--build-recipe-livebuild27
-rw-r--r--build-recipe-mock25
-rw-r--r--build-recipe-preinstallimage19
-rw-r--r--build-recipe-spec33
-rw-r--r--build-vm20
-rw-r--r--build-vm-ec219
-rw-r--r--build-vm-emulator29
-rw-r--r--build-vm-kvm19
-rw-r--r--build-vm-lxc19
-rw-r--r--build-vm-openstack19
-rw-r--r--build-vm-qemu19
-rw-r--r--build-vm-uml19
-rw-r--r--build-vm-xen19
-rw-r--r--build-vm-zvm19
-rwxr-xr-xchangelog2spec20
-rwxr-xr-xcommon_functions20
-rwxr-xr-xcomputeblocklists20
-rwxr-xr-xcreatearchdeps20
-rwxr-xr-xcreatedebdeps118
-rwxr-xr-xcreaterepomddeps29
-rwxr-xr-xcreaterpmdeps37
-rwxr-xr-xcreateyastdeps62
-rwxr-xr-xcreatezyppdeps20
-rwxr-xr-xdebtransform20
-rwxr-xr-xdebtransformbz220
-rwxr-xr-xdebtransformzip20
-rwxr-xr-xdownload20
-rwxr-xr-xemulator/emulator.sh20
-rwxr-xr-xexpanddeps137
-rwxr-xr-xextractbuild20
-rwxr-xr-xgetbinaryid20
-rwxr-xr-xinit_buildsystem54
-rw-r--r--initvm.c18
-rwxr-xr-xkillchroot20
-rwxr-xr-xlivebuild_pre_run.template20
-rwxr-xr-xmkbaselibs20
-rwxr-xr-xmkdrpms20
-rwxr-xr-xorder20
-rw-r--r--qemu-reg2
-rwxr-xr-xqueryconfig20
-rwxr-xr-xsigndummy20
-rwxr-xr-xspec2changelog19
-rwxr-xr-xspec_add_patch20
-rwxr-xr-xspectool20
-rwxr-xr-xsubstitutedeps20
-rwxr-xr-xt/dist20
-rwxr-xr-xt/live-build20
-rwxr-xr-xunrpm20
-rw-r--r--unrpm.117
-rwxr-xr-xvc4
-rw-r--r--vc.125
70 files changed, 2046 insertions, 205 deletions
diff --git a/Build.pm b/Build.pm
index 9e6fda3..089cb7f 100644
--- a/Build.pm
+++ b/Build.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build;
use strict;
@@ -550,15 +570,19 @@ sub get_cbinstalls { return @{[]}; }
sub readdeps {
my ($config, $pkginfo, @depfiles) = @_;
- my %requires = ();
+ my %requires;
local *F;
my %provides;
+ my %pkgconflicts;
+ my %pkgobsoletes;
my $dofileprovides = %{$config->{'fileprovides'}};
for my $depfile (@depfiles) {
if (ref($depfile) eq 'HASH') {
for my $rr (keys %$depfile) {
$provides{$rr} = $depfile->{$rr}->{'provides'};
$requires{$rr} = $depfile->{$rr}->{'requires'};
+ $pkgconflicts{$rr} = $depfile->{$rr}->{'conflicts'};
+ $pkgobsoletes{$rr} = $depfile->{$rr}->{'obsoletes'};
}
next;
}
@@ -578,20 +602,16 @@ sub readdeps {
next;
}
push @ss, shift @s;
- while (@s) {
- if ($s[0] =~ /^[\(<=>|]/) {
- $ss[-1] .= " $s[0] $s[1]";
- $ss[-1] =~ s/ \((.*)\)/ $1/;
- $ss[-1] =~ s/(<|>){2}/$1/;
- splice(@s, 0, 2);
- } else {
- last;
- }
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $ss[-1] .= " $s[0] $s[1]";
+ $ss[-1] =~ s/ \((.*)\)/ $1/;
+ $ss[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
}
}
my %ss;
@ss = grep {!$ss{$_}++} @ss;
- if ($s =~ /^(P|R):(.*)\.(.*)-\d+\/\d+\/\d+:$/) {
+ if ($s =~ /^(P|R|C|O):(.*)\.(.*)-\d+\/\d+\/\d+:$/) {
my $pkgid = $2;
my $arch = $3;
if ($1 eq "R") {
@@ -599,6 +619,16 @@ sub readdeps {
$pkginfo->{$pkgid}->{'requires'} = \@ss if $pkginfo;
next;
}
+ if ($1 eq "C") {
+ $pkgconflicts{$pkgid} = \@ss;
+ $pkginfo->{$pkgid}->{'conflicts'} = \@ss if $pkginfo;
+ next;
+ }
+ if ($1 eq "O") {
+ $pkgobsoletes{$pkgid} = \@ss;
+ $pkginfo->{$pkgid}->{'obsoletes'} = \@ss if $pkginfo;
+ next;
+ }
# handle provides
$provides{$pkgid} = \@ss;
if ($pkginfo) {
@@ -617,6 +647,8 @@ sub readdeps {
}
$config->{'providesh'} = \%provides;
$config->{'requiresh'} = \%requires;
+ $config->{'pkgconflictsh'} = \%pkgconflicts;
+ $config->{'pkgobsoletesh'} = \%pkgobsoletes;
makewhatprovidesh($config);
}
@@ -650,6 +682,8 @@ sub forgetdeps {
delete $config->{'providesh'};
delete $config->{'whatprovidesh'};
delete $config->{'requiresh'};
+ delete $config->{'pkgconflictsh'};
+ delete $config->{'pkgobsoletesh'};
}
my %addproviders_fm = (
@@ -721,12 +755,47 @@ sub addproviders {
return \@p;
}
+# XXX: should also check the package EVR
+sub nevrmatch {
+ my ($config, $r, @p) = @_;
+ my $rn = $r;
+ $rn =~ s/\s*([<=>]{1,2}).*$//;
+ return grep {$_ eq $rn} @p;
+}
+
+sub checkconflicts {
+ my ($config, $ins, $q, $eq, @r) = @_;
+ my $whatprovides = $config->{'whatprovidesh'};
+ for my $r (@r) {
+ my @eq = grep {$ins->{$_}} @{$whatprovides->{$r} || addproviders($config, $r)};
+ next unless @eq;
+ push @$eq, map {"provider $q conflicts with installed $_"} @eq;
+ return 1;
+ }
+ return 0;
+}
+
+sub checkobsoletes {
+ my ($config, $ins, $q, $eq, @r) = @_;
+ my $whatprovides = $config->{'whatprovidesh'};
+ for my $r (@r) {
+ my @eq = grep {$ins->{$_}} nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
+ next unless @eq;
+ push @$eq, map {"provider $q is obsoleted by installed $_"} @eq;
+ return 1;
+ }
+ return 0;
+}
+
sub expand {
my ($config, @p) = @_;
my $conflicts = $config->{'conflicth'};
+ my $pkgconflicts = $config->{'pkgconflictsh'} || {};
+ my $pkgobsoletes = $config->{'pkgobsoletesh'} || {};
my $prefer = $config->{'preferh'};
my $ignore = $config->{'ignoreh'};
+ my $ignoreconflicts = $config->{'expandflags:ignoreconflicts'};
my $whatprovides = $config->{'whatprovidesh'};
my $requires = $config->{'requiresh'};
@@ -761,10 +830,19 @@ sub expand {
push @p, $p;
next;
}
+ return (undef, "$q[0] $aconflicts{$q[0]}") if $aconflicts{$q[0]};
print "added $q[0] because of $p (direct dep)\n" if $expand_dbg;
push @p, $q[0];
$p{$q[0]} = 1;
- $aconflicts{$_} = 1 for @{$conflicts->{$q[0]} || []};
+ $aconflicts{$_} = "conflict from project config with $q[0]" for @{$conflicts->{$q[0]} || []};
+ if (!$ignoreconflicts) {
+ for my $r (@{$pkgconflicts->{$q[0]}}) {
+ $aconflicts{$_} = "conflicts with installed $q[0]" for @{$whatprovides->{$r} || addproviders($config, $r)};
+ }
+ for my $r (@{$pkgobsoletes->{$q[0]}}) {
+ $aconflicts{$_} = "is obsoleted by installed $q[0]" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
+ }
+ }
}
push @p, @directdepsend;
@@ -782,13 +860,24 @@ sub expand {
next if grep {$p{$_}} @q;
next if grep {$xignore{$_}} @q;
next if grep {$ignore->{"$p:$_"} || $xignore{"$p:$_"}} @q;
+ my @eq = map {"provider $_ $aconflicts{$_}"} grep {$aconflicts{$_}} @q;
@q = grep {!$aconflicts{$_}} @q;
+ if (!$ignoreconflicts) {
+ for my $q (splice @q) {
+ push @q, $q unless @{$pkgconflicts->{$q} || []} && checkconflicts($config, \%p, $q, \@eq, @{$pkgconflicts->{$q}});
+ }
+ for my $q (splice @q) {
+ push @q, $q unless @{$pkgobsoletes->{$q} || []} && checkobsoletes($config, \%p, $q, \@eq, @{$pkgobsoletes->{$q}});
+ }
+ }
if (!@q) {
+ my $eq = @eq ? " (".join(', ', @eq).")" : '';
+ my $msg = @eq ? 'conflict for providers of' : 'nothing provides';
if ($r eq $p) {
- push @rerror, "nothing provides $r";
+ push @rerror, "$msg $r$eq";
} else {
- next if $r =~ /^\//;
- push @rerror, "nothing provides $r needed by $p";
+ next if $r =~ /^\// && !@eq;
+ push @rerror, "$msg $r needed by $p$eq";
}
next;
}
@@ -831,7 +920,15 @@ sub expand {
push @p, $q[0];
print "added $q[0] because of $p:$r\n" if $expand_dbg;
$p{$q[0]} = 1;
- $aconflicts{$_} = 1 for @{$conflicts->{$q[0]} || []};
+ $aconflicts{$_} = "conflict from project config with $q[0]" for @{$conflicts->{$q[0]} || []};
+ if (!$ignoreconflicts) {
+ for my $r (@{$pkgconflicts->{$q[0]}}) {
+ $aconflicts{$_} = "conflicts with installed $q[0]" for @{$whatprovides->{$r} || addproviders($config, $r)};
+ }
+ for my $r (@{$pkgobsoletes->{$q[0]}}) {
+ $aconflicts{$_} = "is obsoleted by installed $q[0]" for nevrmatch($config, $r, @{$whatprovides->{$r} || addproviders($config, $r)});
+ }
+ }
@error = ();
$doamb = 0;
}
diff --git a/Build/Arch.pm b/Build/Arch.pm
index 9d4f727..dcffe13 100644
--- a/Build/Arch.pm
+++ b/Build/Arch.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Arch;
use strict;
diff --git a/Build/Deb.pm b/Build/Deb.pm
index 2620873..7f1f7ec 100644
--- a/Build/Deb.pm
+++ b/Build/Deb.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Deb;
use strict;
@@ -9,6 +29,18 @@ eval {
$have_zlib = 1;
};
+sub basearch {
+ my ($arch) = @_;
+ $arch = 'all' if !defined($arch) || $arch eq 'noarch';
+ $arch = 'i386' if $arch =~ /^i[456]86$/;
+ $arch = 'powerpc' if $arch eq 'ppc';
+ $arch = 'ppc64el' if $arch eq 'ppc64le';
+ $arch = 'amd64' if $arch eq 'x86_64';
+ $arch = 'armel' if $arch =~ /^armv[4567]l$/;
+ $arch = 'armhf' if $arch eq 'armv7hl';
+ return $arch;
+}
+
sub parse {
my ($bconf, $fn) = @_;
my $ret;
@@ -22,13 +54,7 @@ sub parse {
}
# map to debian names
$os = 'linux' if !defined($os);
- $arch = 'all' if !defined($arch) || $arch eq 'noarch';
- $arch = 'i386' if $arch =~ /^i[456]86$/;
- $arch = 'powerpc' if $arch eq 'ppc';
- $arch = 'ppc64el' if $arch eq 'ppc64le';
- $arch = 'amd64' if $arch eq 'x86_64';
- $arch = 'armel' if $arch =~ /^armv[4567]l$/;
- $arch = 'armhf' if $arch eq 'armv7hl';
+ $arch = basearch($arch);
if (ref($fn) eq 'ARRAY') {
@control = @$fn;
diff --git a/Build/Kiwi.pm b/Build/Kiwi.pm
index 515057d..5d730d7 100644
--- a/Build/Kiwi.pm
+++ b/Build/Kiwi.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Kiwi;
use strict;
diff --git a/Build/LiveBuild.pm b/Build/LiveBuild.pm
index 00da9e3..fbc66d9 100644
--- a/Build/LiveBuild.pm
+++ b/Build/LiveBuild.pm
@@ -1,21 +1,24 @@
+################################################################
#
# Author: Jan Blunck <jblunck@infradead.org>
#
# This file is part of build.
#
-# build is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
#
-# build is distributed in the hope that it will be useful,
+# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with build. If not, see <http://www.gnu.org/licenses/>.
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
+#################################################################
package Build::LiveBuild;
diff --git a/Build/Rpm.pm b/Build/Rpm.pm
index c692ac4..58bfabc 100644
--- a/Build/Rpm.pm
+++ b/Build/Rpm.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Rpm;
our $unfilteredprereqs = 0;
diff --git a/Build/Susetags.pm b/Build/Susetags.pm
index cd0a103..8bc7962 100644
--- a/Build/Susetags.pm
+++ b/Build/Susetags.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Susetags;
use strict;
diff --git a/Build/Zypp.pm b/Build/Zypp.pm
index bd0ced0..20d020c 100644
--- a/Build/Zypp.pm
+++ b/Build/Zypp.pm
@@ -1,3 +1,23 @@
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
package Build::Zypp;
use strict;
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..c6b1bb9
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,340 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Steet, Fifth Floor, Boston, MA 02111-1307 USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) year name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/Makefile b/Makefile
index fd3ec66..8c84ced 100644
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@ install:
mkdrpms \
createzyppdeps \
createarchdeps \
+ createdebdeps \
createrepomddeps \
createyastdeps \
changelog2spec \
@@ -68,6 +69,8 @@ install:
install -m644 *.pm baselibs_global*.conf lxc.conf $(DESTDIR)$(pkglibdir)
install -m644 configs/* $(DESTDIR)$(pkglibdir)/configs
install -m644 build.1 $(DESTDIR)$(man1dir)
+ install -m644 vc.1 $(DESTDIR)$(man1dir)
+ install -m644 unrpm.1 $(DESTDIR)$(man1dir)
ln -sf $(pkglibdir)/build $(DESTDIR)$(bindir)/build
ln -sf $(pkglibdir)/vc $(DESTDIR)$(bindir)/buildvc
ln -sf $(pkglibdir)/unrpm $(DESTDIR)$(bindir)/unrpm
diff --git a/build b/build
index 9f9fb72..cdba8f8 100755
--- a/build
+++ b/build
@@ -5,7 +5,25 @@
#
# BUILD_ROOT here the packages will be built
#
-# (c) 1997-2008 SuSE GmbH Nuernberg, Germany
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
# some VMs do not allow to specify the init process...
if test "$0" = /sbin/init ; then
@@ -17,6 +35,8 @@ test -z "$BUILD_DIR" && BUILD_DIR=/usr/lib/build
test -z "$BUILD_ROOT" && BUILD_ROOT=/var/tmp/build-root
test -z "$CONFIG_DIR" && CONFIG_DIR="$BUILD_DIR/configs"
+export CHROOT="chroot $BUILD_ROOT"
+
export BUILD_ARCH BUILD_HOST_ARCH BUILD_ROOT BUILD_RPMS BUILD_DIR BUILD_DEBUG
export BUILD_DIST
@@ -73,6 +93,7 @@ SIGNDUMMY=
DO_STATISTICS=
RUN_SHELL=
CCACHE=
+DLNOSIGNATURE=
CACHE_DIR=/var/cache/build
@@ -259,7 +280,6 @@ Known Parameters:
--emulator
Use any generic emulator to isolate the build process. You need to write
an emulator/emulator.sh script and put it next to the build script sources.
- You must NOT use any vm swap file for this.
--emulator-script SCRIPT
specify another emulator instead of emulator.sh
@@ -444,7 +464,7 @@ setupicecream() {
echo "create-env not found"
return 1
fi
- chroot $BUILD_ROOT bash -c "cd /var/run/icecream; $createenv" || cleanup_and_exit 1
+ $CHROOT bash -c "cd /var/run/icecream; $createenv" || cleanup_and_exit 1
icecc_vers=(`shopt -s nullglob; echo $BUILD_ROOT/var/run/icecream/*.tar.{bz2,gz}`)
icecc_vers=${icecc_vers//$BUILD_ROOT/}
else
@@ -541,7 +561,7 @@ create_baselibs() {
echo "... creating baselibs$whichone"
while read line
do
- chroot $BUILD_ROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
+ $CHROOT su -c "$mkbaselibs $BASELIBS_GLOBAL $BASELIBS_CFG $line" - $BUILD_USER || cleanup_and_exit 1
done < <(IFS=$'\n'; echo "${pkgs[*]#$BUILD_ROOT}" | xargs -n 1024)
rm -rf "$BUILD_ROOT/.mkbaselibs"
}
@@ -576,6 +596,11 @@ become_root_or_fail() {
}
mkdir_build_root() {
+ # strip trailing slash
+ if test "$BUILD_ROOT" != /; then
+ BUILD_ROOT="${BUILD_ROOT%/}"
+ export CHROOT="chroot $BUILD_ROOT"
+ fi
if test -d "$BUILD_ROOT" ; then
# check if it is owned by root
if test -z "$RUNNING_IN_VM" -a \! -O "$BUILD_ROOT" -a "`stat -c %u $BUILD_ROOT`" -ne 0 ; then
@@ -732,6 +757,7 @@ while test -n "$1"; do
-root)
needarg
BUILD_ROOT="$ARG"
+ export CHROOT="chroot $BUILD_ROOT"
shift
;;
-cachedir)
@@ -861,6 +887,9 @@ while test -n "$1"; do
-signdummy)
SIGNDUMMY=1
;;
+ -nosignature)
+ DLNOSIGNATURE="--nosignature"
+ ;;
---noarg)
echo "$ARG does not take an argument"
cleanup_and_exit
@@ -927,6 +956,7 @@ expand_recipe_directories
if test -n "$LIST_STATE" ; then
BUILD_ROOT=`mktemp -d /var/tmp/build-list-state-XXXXXX`
+ export CHROOT="chroot $BUILD_ROOT"
test -d "$BUILD_ROOT" || cleanup_and_exit 3
RECIPEFILE=$RECIPEFILES # only one specified anyways
if test "$RECIPEFILE" != "${RECIPEFILE%.src.rpm}" ; then
@@ -934,7 +964,7 @@ if test -n "$LIST_STATE" ; then
recipe_unpack_srcrpm
RECIPEFILE="$MYSRCDIR/$RECIPEFILE"
fi
- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
+ init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" --list-state "${definesnstuff[@]}" "${repos[@]}" $DLNOSIGNATURE $USEUSEDFORBUILD $RECIPEFILE $BUILD_EXTRA_PACKS
ERR=$?
rm -rf "$BUILD_ROOT"
cleanup_and_exit $ERR
@@ -1072,7 +1102,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
egrep '^#[ ]*needsbinariesforbuild[ ]*$' >/dev/null <$MYSRCDIR/$RECIPEFILE && CREATE_BUILD_BINARIES=--create-build-binaries
test "$BUILDTYPE" = mock && CREATE_BUILD_BINARIES=--create-build-binaries
test "$BUILDTYPE" = livebuild && CREATE_BUILD_BINARIES=--create-build-binaries
- set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
+ set -- init_buildsystem --configdir "$CONFIG_DIR" --cachedir "$CACHE_DIR" "${definesnstuff[@]}" "${repos[@]}" $CLEAN_BUILD $DLNOSIGNATURE $USEUSEDFORBUILD $CREATE_BUILD_BINARIES $RPMLIST "$MYSRCDIR/$RECIPEFILE" $ADDITIONAL_PACKS
echo "$* ..."
start_time=`date +%s`
"$@" || cleanup_and_exit 1
@@ -1119,7 +1149,7 @@ for RECIPEFILE in "${RECIPEFILES[@]}" ; do
#
BUILD_USER=abuild
if test -x $BUILD_ROOT/bin/rpm ; then
- SUSE_VERSION=`chroot $BUILD_ROOT /bin/rpm --eval '%{?suse_version}' 2>/dev/null`
+ SUSE_VERSION=`$CHROOT /bin/rpm --eval '%{?suse_version}' 2>/dev/null`
test -n "$SUSE_VERSION" -a "${SUSE_VERSION:-0}" -le 1020 && BUILD_USER=root
fi
if test "$BUILD_USER" = abuild ; then
diff --git a/build-pkg b/build-pkg
index 529421f..b014007 100644
--- a/build-pkg
+++ b/build-pkg
@@ -1,8 +1,25 @@
#
# binary package specific functions for the build script
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
for i in rpm deb arch ; do
. "$BUILD_DIR/build-pkg-$i"
diff --git a/build-pkg-arch b/build-pkg-arch
index 919a744..dcbdca5 100644
--- a/build-pkg-arch
+++ b/build-pkg-arch
@@ -1,8 +1,25 @@
#
# Arch specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
pkg_initdb_arch() {
mkdir -p $BUILD_ROOT/var/lib/pacman/sync
@@ -36,7 +53,7 @@ pkg_cumulate_arch() {
pkg_install_arch() {
# -d -d disables deps checking
- ( cd $BUILD_ROOT && chroot $BUILD_ROOT pacman -U --force -d -d --noconfirm .init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
+ ( $CHROOT pacman -U --force -d -d --noconfirm /.init_b_cache/$PKG.$PSUF 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(warning: could not get filesystem information for |loading packages|looking for inter-conflicts|Targets |Total Installed Size: |Net Upgrade Size: |Proceed with installation|checking package integrity|loading package files|checking for file conflicts|checking keyring|Packages \(\d+\):|:: Proceed with installation|checking available disk space|installing |upgrading |warning:.*is up to date -- reinstalling|Optional dependencies for| )/||/^$/||print'
}
@@ -56,7 +73,7 @@ pkg_preinstall_arch() {
pkg_runscripts_arch() {
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
- ( cd $BUILD_ROOT && chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" < /dev/null )
+ ( $CHROOT "/.init_b_cache/scripts/$PKG.post" < /dev/null )
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
fi
}
diff --git a/build-pkg-deb b/build-pkg-deb
index 199b53f..c6c4702 100644
--- a/build-pkg-deb
+++ b/build-pkg-deb
@@ -1,8 +1,25 @@
#
# Debian dpkg specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
deb_setup() {
mkdir -p $BUILD_ROOT/var/lib/dpkg
@@ -22,7 +39,7 @@ pkg_initdb_deb() {
rm -f $BUILD_ROOT/.init_b_cache/dpkg.deb
cp $BUILD_ROOT/.init_b_cache/rpms/dpkg.deb $BUILD_ROOT/.init_b_cache/dpkg.deb || cleanup_and_exit 1
fi
- chroot $BUILD_ROOT dpkg -i --force all .init_b_cache/dpkg.deb >/dev/null 2>&1
+ $CHROOT dpkg -i --force all .init_b_cache/dpkg.deb >/dev/null 2>&1
}
pkg_get_installed_deb() {
@@ -38,7 +55,7 @@ pkg_set_packageid_deb() {
pkg_install_deb() {
export DEBIAN_FRONTEND=noninteractive
export DEBIAN_PRIORITY=critical
- ( chroot $BUILD_ROOT dpkg --install --force all .init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
+ ( $CHROOT dpkg --install --force all /.init_b_cache/$PKG.deb 2>&1 || touch $BUILD_ROOT/exit ) | \
perl -ne '$|=1;/^(Configuration file|Installing new config file|Selecting previously deselected|Selecting previously unselected|\(Reading database|Unpacking |Setting up|Creating config file|Preparing to replace dpkg)/||/^$/||print'
check_exit
# ugly workaround for upstart system. some packages (procps) try
@@ -72,9 +89,9 @@ pkg_finalize_deb() {
# configure all packages after complete installation, not for each package like rpm does
# We need to run this twice, because of cyclic dependencies as it does not succeed on most
# debian based distros in the first attempt.
- if ! chroot $BUILD_ROOT dpkg --configure --pending 2>&1; then
+ if ! $CHROOT dpkg --configure --pending 2>&1; then
echo "first configure attempt failed, trying again..."
- chroot $BUILD_ROOT dpkg --configure --pending 2>&1 || cleanup_and_exit 1
+ $CHROOT dpkg --configure --pending 2>&1 || cleanup_and_exit 1
fi
}
@@ -100,12 +117,12 @@ pkg_runscripts_deb() {
fi
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then
echo "running $PKG preinstall script"
- chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.pre" install < /dev/null
+ $CHROOT "/.init_b_cache/scripts/$PKG.pre" install < /dev/null
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre"
fi
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
- chroot $BUILD_ROOT ".init_b_cache/scripts/$PKG.post" configure '' < /dev/null
+ $CHROOT "/.init_b_cache/scripts/$PKG.post" configure '' < /dev/null
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
fi
}
diff --git a/build-pkg-rpm b/build-pkg-rpm
index d0b2ef9..bd5b581 100644
--- a/build-pkg-rpm
+++ b/build-pkg-rpm
@@ -1,8 +1,26 @@
#
# RPM specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
#buildhost removed so that id can be generated from repo files
#RPMIDFMT="%{NAME}-%{VERSION}-%{RELEASE} %{BUILDHOST}-%{BUILDTIME}\n"
@@ -14,20 +32,20 @@ pkg_initdb_rpm() {
# rpm v5 does not have initdb
if ! test -e $BUILD_ROOT/usr/lib/rpm/cpuinfo.yaml ; then
if test -x $BUILD_ROOT/usr/bin/rpmdb ; then
- chroot $BUILD_ROOT /usr/bin/rpmdb --initdb || cleanup_and_exit 1
+ $CHROOT /usr/bin/rpmdb --initdb || cleanup_and_exit 1
else
- chroot $BUILD_ROOT rpm --initdb || cleanup_and_exit 1
+ $CHROOT rpm --initdb || cleanup_and_exit 1
fi
fi
# hack: add nofsync to db config to speed up install
mkdir -p $BUILD_ROOT/root
- DBI_OTHER=`chroot $BUILD_ROOT rpm --eval '%{?__dbi_other}'`
+ DBI_OTHER=`$CHROOT rpm --eval '%{?__dbi_other}'`
echo "%__dbi_other $DBI_OTHER nofsync" > $BUILD_ROOT/.rpmmacros
echo "%__dbi_other $DBI_OTHER nofsync" > $BUILD_ROOT/root/.rpmmacros
}
pkg_get_installed_rpm() {
- chroot $BUILD_ROOT rpm -qa --qf "%{NAME} $RPMIDFMT" | (
+ $CHROOT rpm -qa --qf "%{NAME} $RPMIDFMT" | (
while read pp ii; do
echo "$ii" > "$BUILD_ROOT/.init_b_cache/alreadyinstalled/$pp"
done
@@ -38,7 +56,7 @@ pkg_get_installed_rpm() {
}
pkg_erase_rpm() {
- chroot $BUILD_ROOT rpm --nodeps -e $PKG 2>&1 | {
+ $CHROOT rpm --nodeps -e $PKG 2>&1 | {
local retry
while read line; do
case "$line" in
@@ -53,7 +71,7 @@ pkg_erase_rpm() {
done
if test -n "$retry" ; then
echo "re-try deleting $PKG using --noscripts"
- chroot $BUILD_ROOT rpm --nodeps --noscripts -e $PKG || true
+ $CHROOT rpm --nodeps --noscripts -e $PKG || true
fi
}
}
@@ -73,7 +91,7 @@ rpm_init_cumulate() {
CUMULATED_PIDS=()
CUMULATED_HMD5=()
DO_CUMULATE=
- typeset -ri suse_version=$(chroot $BUILD_ROOT rpm --eval '%{?suse_version}' 2>/dev/null)
+ typeset -ri suse_version=$($CHROOT rpm --eval '%{?suse_version}' 2>/dev/null)
if ((suse_version > 1220)) ; then
DO_CUMULATE=true
fi
@@ -84,7 +102,7 @@ pkg_set_packageid_rpm() {
}
pkg_verify_installed_rpm() {
- chroot $BUILD_ROOT rpm --verify $PKG 2>&1 | tee $TMPFILE
+ $CHROOT rpm --verify $PKG 2>&1 | tee $TMPFILE
if grep ^missing $TMPFILE > /dev/null ; then
return 1
fi
@@ -100,7 +118,7 @@ pkg_cumulate_rpm() {
done
fi
let cumulate++
- CUMULATED_LIST[$cumulate]=".init_b_cache/$PKG.rpm"
+ CUMULATED_LIST[$cumulate]="/.init_b_cache/$PKG.rpm"
CUMULATED_PIDS[$cumulate]="$PKGID"
CUMULATED_HMD5[$cumulate]="$PKG_HDRMD5"
return 0
@@ -117,8 +135,8 @@ pkg_install_rpm() {
test -e "$i" && ADDITIONAL_PARAMS="$ADDITIONAL_PARAMS --justdb"
done
fi
- ( chroot $BUILD_ROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
- $ADDITIONAL_PARAMS .init_b_cache/$PKG.rpm 2>&1 || \
+ ( $CHROOT rpm --ignorearch --nodeps -U --oldpackage --ignoresize $RPMCHECKOPTS \
+ $ADDITIONAL_PARAMS /.init_b_cache/$PKG.rpm 2>&1 || \
touch $BUILD_ROOT/exit ) | \
grep -v "^warning:.*saved as.*rpmorig$"
}
@@ -133,8 +151,8 @@ pkg_finalize_rpm() {
rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]}
cp $BUILD_ROOT/.init_b_cache/rpms/$PKG $BUILD_ROOT/${CUMULATED_LIST[$num]} || cleanup_and_exit 1
done > $BUILD_ROOT/.init_b_cache/manifest
- chroot $BUILD_ROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
- $ADDITIONAL_PARAMS .init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit
+ $CHROOT rpm --ignorearch --nodeps -Uh --oldpackage --ignoresize --verbose $RPMCHECKOPTS \
+ $ADDITIONAL_PARAMS /.init_b_cache/manifest 2>&1 || touch $BUILD_ROOT/exit
for ((num=0; num<=cumulate; num++)) ; do
rm -f $BUILD_ROOT/${CUMULATED_LIST[$num]}
done
@@ -181,21 +199,21 @@ pkg_preinstall_rpm() {
# hack for rpm erasures
if test -d "$BUILD_ROOT/installed-pkg" ; then
# call for rpm-4.x and not rpm-devel
- test -z "${PKG##rpm-[0-9]*}" && chroot $BUILD_ROOT rpm --rebuilddb
+ test -z "${PKG##rpm-[0-9]*}" && $CHROOT rpm --rebuilddb
# also exec for exchanged rpm ! naming is rpm-x86-<target>-<ver>
- test -z "${PKG##rpm-x86-*[0-9]*}" && chroot $BUILD_ROOT rpm --rebuilddb
+ test -z "${PKG##rpm-x86-*[0-9]*}" && $CHROOT rpm --rebuilddb
fi
}
pkg_runscripts_rpm() {
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre" ; then
echo "running $PKG preinstall script"
- chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.pre" 0
+ $CHROOT sh "/.init_b_cache/scripts/$PKG.pre" 0
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.pre"
fi
if test -e "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post" ; then
echo "running $PKG postinstall script"
- chroot $BUILD_ROOT sh ".init_b_cache/scripts/$PKG.post" 1
+ $CHROOT sh "/.init_b_cache/scripts/$PKG.post" 1
rm -f "$BUILD_ROOT/.init_b_cache/scripts/$PKG.post"
fi
}
diff --git a/build-recipe b/build-recipe
index b8165ec..b60f31a 100644
--- a/build-recipe
+++ b/build-recipe
@@ -1,8 +1,26 @@
#
# recipe specific functions for the build script
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
KIWI_PARAMETERS=
diff --git a/build-recipe-arch b/build-recipe-arch
index 2db77da..19d04c3 100644
--- a/build-recipe-arch
+++ b/build-recipe-arch
@@ -1,8 +1,25 @@
#
# Arch specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
recipe_setup_arch() {
TOPDIR=/usr/src/packages
@@ -36,5 +53,5 @@ recipe_resultdirs_arch() {
}
_arch_recipe_makepkg() {
- chroot $BUILD_ROOT su -lc "source /etc/profile; cd $TOPDIR/SOURCES && makepkg --config ../makepkg.conf $*" $BUILD_USER
+ $CHROOT su -lc "source /etc/profile; cd $TOPDIR/SOURCES && makepkg --config ../makepkg.conf $*" $BUILD_USER
}
diff --git a/build-recipe-dsc b/build-recipe-dsc
index 81cd024..3b8cbeb 100644
--- a/build-recipe-dsc
+++ b/build-recipe-dsc
@@ -1,8 +1,25 @@
#
# dsc specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
recipe_setup_dsc() {
TOPDIR=/usr/src/packages
@@ -42,7 +59,7 @@ recipe_prepare_dsc() {
for DEB_DSCFILE in $BUILD_ROOT/$DEB_SOURCEDIR/*.dsc ; do : ; done
DEB_DSCFILE="${DEB_DSCFILE##*/}"
fi
- chroot $BUILD_ROOT su -c "dpkg-source -x $DEB_SOURCEDIR/$DEB_DSCFILE $TOPDIR/BUILD" - $BUILD_USER
+ $CHROOT su -c "dpkg-source -x $DEB_SOURCEDIR/$DEB_DSCFILE $TOPDIR/BUILD" - $BUILD_USER
}
recipe_build_dsc() {
@@ -53,20 +70,21 @@ recipe_build_dsc() {
# if test -n "$BUILD_JOBS" ; then
# DSC_BUILD_JOBS="-j$BUILD_JOBS"
# fi
- DSC_BUILD_CMD="dpkg-buildpackage -us -uc -rfakeroot-tcp $DSC_BUILD_JOBS"
+ DSC_BUILD_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute dsc:build_cmd)"
+ test -z "$DSC_BUILD_CMD" && DSC_BUILD_CMD="dpkg-buildpackage -us -uc $DSC_BUILD_JOBS"
if test -e $BUILD_ROOT/$TOPDIR/SOURCES/build.script ; then
- echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc -rfakeroot-tcp'"
+ echo "Sourcing build.script to build - it should normally run 'dpkg-buildpackage -us -uc'"
DSC_BUILD_CMD="source $TOPDIR/SOURCES/build.script"
chmod +x $BUILD_ROOT/$TOPDIR/SOURCES/build.script
fi
if test -n "$RUN_SHELL"; then
- chroot $BUILD_ROOT su -
+ $CHROOT su -
else
- chroot $BUILD_ROOT su -c "cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+ $CHROOT su -c "cd $TOPDIR/BUILD && $DSC_BUILD_CMD" - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
if test "$BUILD_SUCCEEDED" = true -a "$DO_CHECKS" != "false"; then
- DEB_CHANGESFILE=${RECIPEFILE%.dsc}_"$(chroot $BUILD_ROOT su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes
- chroot $BUILD_ROOT su -c "which lintian > /dev/null && cd $TOPDIR && echo Running lintian && (set -x && lintian -i $DEB_SOURCEDIR/$DEB_DSCFILE)" - $BUILD_USER < /dev/null
+ DEB_CHANGESFILE=${RECIPEFILE%.dsc}_"$($CHROOT su -c 'dpkg-architecture -qDEB_BUILD_ARCH')".changes
+ $CHROOT su -c "which lintian > /dev/null && cd $TOPDIR && echo Running lintian && (set -x && lintian -i $DEB_SOURCEDIR/$DEB_DSCFILE)" - $BUILD_USER < /dev/null
fi
fi
diff --git a/build-recipe-kiwi b/build-recipe-kiwi
index 95afd3f..7c18460 100644
--- a/build-recipe-kiwi
+++ b/build-recipe-kiwi
@@ -1,8 +1,25 @@
#
# KIWI specific functions. Handle with care.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
############################################################
@@ -260,6 +277,10 @@ recipe_setup_kiwi() {
cleanup_and_exit 1
fi
fi
+
+ # extract macros from configuration
+ # some post scripts might call rpm-build and rely on the macros
+ queryconfig rawmacros --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" > $BUILD_ROOT/root/.rpmmacros
}
recipe_prepare_kiwi() {
@@ -273,7 +294,7 @@ run_suse_isolinux() {
i="${i##*/}"
test "$i" = scripts && continue
test "$i" != "${i%0}" && continue
- chroot $BUILD_ROOT su -c "suse-isolinux $TOPDIR/KIWIROOT/main/$i $TOPDIR/KIWI/$i.iso" - $BUILD_USER
+ $CHROOT su -c "suse-isolinux $TOPDIR/KIWIROOT/main/$i $TOPDIR/KIWI/$i.iso" - $BUILD_USER
done
}
@@ -302,7 +323,11 @@ build_kiwi_product() {
test -e "$i" || continue
f=${i##*/}
case $f in
- *.iso) mv $i $BUILD_ROOT/$TOPDIR/KIWI/. ;;
+ *.iso) if [ -x /usr/bin/sha256sum ]; then
+ /usr/bin/sha256sum "$i" > "$i.sha256"
+ mv "$i.sha256" $BUILD_ROOT/$TOPDIR/KIWI/.
+ fi
+ mv "$i" $BUILD_ROOT/$TOPDIR/KIWI/. ;;
*.packages) mv $i $BUILD_ROOT/$TOPDIR/OTHER/. ;;
*.report) mv $i $BUILD_ROOT/$TOPDIR/OTHER/. ;;
scripts) ;;
@@ -322,12 +347,12 @@ build_kiwi_appliance() {
for imgtype in $imagetype ; do
echo "running kiwi --prepare for $imgtype..."
# Do not use $BUILD_USER here, since we always need root permissions
- chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
+ $CHROOT su -c "cd $TOPDIR/SOURCES && kiwi --prepare $TOPDIR/SOURCES --logfile terminal --root $TOPDIR/KIWIROOT-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
echo "running kiwi --create for $imgtype..."
mkdir -p $BUILD_ROOT/$TOPDIR/KIWI-$imgtype
- chroot $BUILD_ROOT su -c "cd $TOPDIR/SOURCES && kiwi --create $TOPDIR/KIWIROOT-$imgtype --logfile terminal --type $imgtype -d $TOPDIR/KIWI-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
+ $CHROOT su -c "cd $TOPDIR/SOURCES && kiwi --create $TOPDIR/KIWIROOT-$imgtype --logfile terminal --type $imgtype -d $TOPDIR/KIWI-$imgtype $KIWI_PARAMETERS" - root < /dev/null || cleanup_and_exit 1
rm -rf "/$TOPDIR/KIWI.bundle"
- if chroot $BUILD_ROOT su -c "kiwi --bundle-build $TOPDIR/KIWI-$imgtype -d /$TOPDIR/KIWI.bundle/ --bundle-id Build$RELEASE" - root < /dev/null; then
+ if $CHROOT su -c "kiwi --bundle-build $TOPDIR/KIWI-$imgtype -d /$TOPDIR/KIWI.bundle/ --bundle-id Build$RELEASE" - root < /dev/null; then
mv "$BUILD_ROOT/$TOPDIR/KIWI.bundle/"* "$BUILD_ROOT/$TOPDIR/KIWI/" || cleanup_and_exit 1
rmdir "$BUILD_ROOT/$TOPDIR/KIWI.bundle"
unset RUN_BUNDLE
@@ -376,7 +401,7 @@ build_kiwi_appliance() {
cp "$imageout.verified" "/$TOPDIR/OTHER/$imageout$buildnum-$imgtype.verified"
fi
EOF
- chroot $BUILD_ROOT su -c "sh -e /kiwi_post.sh" || cleanup_and_exit 1
+ $CHROOT su -c "sh -e /kiwi_post.sh" || cleanup_and_exit 1
rm -f $BUILD_ROOT/kiwi_post.sh
done
}
@@ -405,10 +430,10 @@ recipe_build_kiwi() {
fi
if test "$imagetype" != product -a "$DO_INIT" != "false" ; then
echo "creating repodata for $repo"
- if chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames --help >/dev/null 2>&1 ; then
- chroot $BUILD_ROOT createrepo --no-database --simple-md-filenames "$repo"
+ if $CHROOT createrepo --no-database --simple-md-filenames --help >/dev/null 2>&1 ; then
+ $CHROOT createrepo --no-database --simple-md-filenames "$repo"
else
- chroot $BUILD_ROOT createrepo "$repo"
+ $CHROOT createrepo "$repo"
fi
fi
done
@@ -417,7 +442,7 @@ recipe_build_kiwi() {
for t in $BUILD_ROOT/$TOPDIR/SOURCES/root.tar* ; do
test -f $t || continue
mkdir -p $BUILD_ROOT/$TOPDIR/SOURCES/root
- chroot $BUILD_ROOT tar -C $TOPDIR/SOURCES/root -xf "$TOPDIR/SOURCES/${t##*/}"
+ $CHROOT tar -C $TOPDIR/SOURCES/root -xf "$TOPDIR/SOURCES/${t##*/}"
done
# fix script permissions
@@ -433,7 +458,7 @@ recipe_build_kiwi() {
for t in $r/root.tar* ; do
test -f $t || continue
mkdir -p $r/root
- chroot $BUILD_ROOT tar -C $TOPDIR/SOURCES/images/$r/root -xf "$TOPDIR/SOURCES/images/$r/${t##*/}"
+ $CHROOT tar -C $TOPDIR/SOURCES/images/$r/root -xf "$TOPDIR/SOURCES/images/$r/${t##*/}"
done
# fix script permissions
chmod a+x $BUILD_ROOT/$TOPDIR/SOURCES/images/$r/*.sh 2>/dev/null
@@ -460,7 +485,7 @@ recipe_build_kiwi() {
# Hook for running post kiwi build scripts like QA scripts if installed
if test -x $BUILD_ROOT/usr/lib/build/kiwi_post_run ; then
- chroot $BUILD_ROOT su -c /usr/lib/build/kiwi_post_run || cleanup_and_exit 1
+ $CHROOT su -c /usr/lib/build/kiwi_post_run || cleanup_and_exit 1
fi
}
diff --git a/build-recipe-livebuild b/build-recipe-livebuild
index 6ae7046..22012b3 100644
--- a/build-recipe-livebuild
+++ b/build-recipe-livebuild
@@ -1,3 +1,4 @@
+#################################################################
#
# Debian live-build specific functions.
#
@@ -5,19 +6,21 @@
#
# This file is part of build.
#
-# build is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 2 of the License, or
-# (at your option) any later version.
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
#
-# build is distributed in the hope that it will be useful,
+# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with build. If not, see <http://www.gnu.org/licenses/>.
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
#
+#################################################################
recipe_setup_livebuild() {
@@ -69,7 +72,7 @@ createrepo_debian() {
gzip -c9 dists/${DIST}/main/source/Sources \
> dists/${DIST}/main/source/Sources.gz
EOF
- chroot $BUILD_ROOT su -c "sh /.createrepo_debian.tmp.sh" - root
+ $CHROOT su -c "sh /.createrepo_debian.tmp.sh" - root
local RESULT=$?
rm -f $BUILD_ROOT/.createrepo_debian.tmp.sh
[ "${RESULT}" != 0 ] && return
@@ -114,8 +117,8 @@ createrepo_debian() {
# $RECIPEFILE the name of the live-build config tarball
recipe_build_livebuild() {
- local ARCH=$(chroot $BUILD_ROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
- local DIST=$(chroot $BUILD_ROOT su -c "lsb_release --codename" | awk '{ print $2 }')
+ local ARCH=$($CHROOT su -c "dpkg-architecture -qDEB_BUILD_ARCH")
+ local DIST=$($CHROOT su -c "lsb_release --codename" | awk '{ print $2 }')
local LIVEBUILD_ROOT="LIVEBUILD_ROOT"
[ -z "${ARCH}" -o -z "${DIST}" ] && cleanup_and_exit 1
@@ -174,7 +177,7 @@ recipe_build_livebuild() {
if [ -x $BUILD_ROOT/usr/lib/build/livebuild_pre_run ] ; then
echo "Running OBS build livebuild_pre_run hook"
- chroot $BUILD_ROOT su -c "/usr/lib/build/livebuild_pre_run" - root \
+ $CHROOT su -c "/usr/lib/build/livebuild_pre_run" - root \
< /dev/null || cleanup_and_exit 1
fi
@@ -184,11 +187,11 @@ recipe_build_livebuild() {
$BUILD_ROOT/.build.livebuild_pre_run
chmod +x $BUILD_ROOT/.build.livebuild_pre_run
echo "Running package livebuild_pre_run hook"
- chroot $BUILD_ROOT su -c "/.build.livebuild_pre_run" - root \
+ $CHROOT su -c "/.build.livebuild_pre_run" - root \
< /dev/null || cleanup_and_exit 1
fi
- chroot $BUILD_ROOT su -c "cd $TOPDIR/$LIVEBUILD_ROOT && lb build" - root \
+ $CHROOT su -c "cd $TOPDIR/$LIVEBUILD_ROOT && lb build" - root \
< /dev/null || cleanup_and_exit 1
# Move created product to destination
diff --git a/build-recipe-mock b/build-recipe-mock
index 2aa387a..8851ec2 100644
--- a/build-recipe-mock
+++ b/build-recipe-mock
@@ -1,8 +1,25 @@
#
# mock specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
recipe_setup_mock() {
recipe_setup_spec "$@"
@@ -16,7 +33,7 @@ recipe_build_mock() {
test -d $BUILD_ROOT/.build.binaries || cleanup_and_exit 1
if test "$DO_INIT" = true -o ! -d "$BUILD_ROOT/.build.binaries/repodata" ; then
echo "creating repository for mock..."
- chroot $BUILD_ROOT createrepo --no-database --basedir /.build.binaries -o /.build.binaries /.build.binaries
+ $CHROOT createrepo --no-database --basedir /.build.binaries -o /.build.binaries /.build.binaries
fi
MOCK_CHROOT_SETUP_CMD="$(queryconfig --dist "$BUILD_DIST" --archpath "$BUILD_ARCH" --configdir "$CONFIG_DIR" substitute mock:chroot_setup_cmd)"
test -z "$MOCK_CHROOT_SETUP_CMD" && MOCK_CHROOT_SETUP_CMD="groupinstall buildsys-build"
@@ -47,7 +64,7 @@ recipe_build_mock() {
echo "building src rpm..."
MOCK_INIT_ARG=
test "$DO_INIT" = true || MOCK_INIT_ARG=--no-clean
- if chroot $BUILD_ROOT /usr/bin/mock -r build $MOCK_INIT_ARG --buildsrpm --spec "$TOPDIR/SOURCES/$RECIPEFILE" --sources "$TOPDIR/SOURCES" ; then
+ if $CHROOT /usr/bin/mock -r build $MOCK_INIT_ARG --buildsrpm --spec "$TOPDIR/SOURCES/$RECIPEFILE" --sources "$TOPDIR/SOURCES" ; then
BUILT_SRPM=
for i in "$BUILD_ROOT/var/lib/mock/build/result/"*src.rpm ; do
test -s "$i" && BUILT_SRPM="${i##*/}"
@@ -56,7 +73,7 @@ recipe_build_mock() {
mkdir -p "$BUILD_ROOT/$TOPDIR/SRPMS"
mv "$BUILD_ROOT/var/lib/mock/build/result/$BUILT_SRPM" "$BUILD_ROOT/$TOPDIR/SRPMS/$BUILT_SRPM"
echo "building binary rpms..."
- if chroot $BUILD_ROOT /usr/bin/mock -v -r build --rebuild --no-clean "$TOPDIR/SRPMS/$BUILT_SRPM" ; then
+ if $CHROOT /usr/bin/mock -v -r build --rebuild --no-clean "$TOPDIR/SRPMS/$BUILT_SRPM" ; then
BUILD_SUCCEEDED=true
# move result over to TOPDIR
rm -f "$TOPDIR/SRPMS/$BUILT_SRPM"
diff --git a/build-recipe-preinstallimage b/build-recipe-preinstallimage
index 2dce153..446236f 100644
--- a/build-recipe-preinstallimage
+++ b/build-recipe-preinstallimage
@@ -1,8 +1,25 @@
#
# preinstall specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
recipe_setup_preinstallimage() {
# should never be called
diff --git a/build-recipe-spec b/build-recipe-spec
index b120f02..99fa243 100644
--- a/build-recipe-spec
+++ b/build-recipe-spec
@@ -1,11 +1,28 @@
#
# spec specific functions.
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
recipe_setup_spec() {
- TOPDIR=`chroot $BUILD_ROOT su -c "rpm --eval '%_topdir'" - $BUILD_USER`
+ TOPDIR=`$CHROOT su -c "rpm --eval '%_topdir'" - $BUILD_USER`
if test -z "$TOPDIR"; then
echo "Error: TOPDIR empty"
cleanup_and_exit 1
@@ -125,9 +142,9 @@ recipe_build_spec() {
chmod 755 $BUILD_ROOT/.build.command
check_exit
if test -n "$RUN_SHELL"; then
- chroot $BUILD_ROOT su -
+ $CHROOT su -
else
- chroot $BUILD_ROOT su -c /.build.command - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
+ $CHROOT su -c /.build.command - $BUILD_USER < /dev/null && BUILD_SUCCEEDED=true
fi
}
@@ -182,7 +199,7 @@ recipe_run_rpmlint() {
rm -f "$BUILD_ROOT$rpmlint_logfile"
ret=0
mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- chroot $BUILD_ROOT su -s /opt/testing/bin/rpmlint "$BUILD_USER" -- \
+ $CHROOT su -s /opt/testing/bin/rpmlint "$BUILD_USER" -- \
--info ${LINT_RPM_FILE_LIST[*]#$BUILD_ROOT} \
${SRPM_FILE_LIST[*]#$BUILD_ROOT} > "$BUILD_ROOT$rpmlint_logfile" || ret=1
cat "$BUILD_ROOT$rpmlint_logfile"
@@ -197,8 +214,8 @@ recipe_compare_oldpackages() {
if test -x "$BUILD_ROOT/usr/lib/build/same-build-result.sh" ; then
echo "... comparing built packages with the former built"
mount -n -tproc none $BUILD_ROOT/proc 2> /dev/null
- if chroot $BUILD_ROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS"; then
- chroot $BUILD_ROOT touch /.build/.same_result_marker
+ if $CHROOT /usr/lib/build/same-build-result.sh /.build.oldpackages "$TOPDIR/RPMS" "$TOPDIR/SRPMS"; then
+ $CHROOT touch /.build/.same_result_marker
# XXX: dirty build service hack. fix bs_worker. Search for
# 'same_result_marker' for traces of a first try to get rid of this
if test -n "$REASON" -a -n "$DISTURL" ; then
@@ -213,6 +230,6 @@ recipe_create_deltarpms() {
if test -x "$BUILD_ROOT/usr/bin/makedeltarpm" -a -x $BUILD_ROOT/usr/lib/build/mkdrpms ; then
echo "... creating delta rpms"
ds=("$BUILD_ROOT/$TOPDIR"/RPMS/* "$BUILD_ROOT$TOPDIR/SRPMS")
- chroot $BUILD_ROOT /usr/lib/build/mkdrpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
+ $CHROOT /usr/lib/build/mkdrpms /.build.oldpackages "${ds[@]#$BUILD_ROOT}"
fi
}
diff --git a/build-vm b/build-vm
index 4737e00..40a7d31 100644
--- a/build-vm
+++ b/build-vm
@@ -1,8 +1,25 @@
#
# VM specific functions for the build script
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
# defaults for vm_img_mkfs
vm_img_mkfs_ext4_options='-O ^has_journal,^huge_file,^resize_inode,sparse_super'
@@ -410,6 +427,7 @@ vm_detect_2nd_stage() {
test -n "$VM_WATCHDOG" -a -z "$PERSONALITY_SET" && echo "### WATCHDOG MARKER END ###"
echo "2nd stage started in virtual machine"
BUILD_ROOT=/
+ unset CHROOT
BUILD_DIR=/.build
echo "machine type: `uname -m`"
if test "$PERSONALITY" != 0 -a -z "$PERSONALITY_SET" ; then
diff --git a/build-vm-ec2 b/build-vm-ec2
index 7bb8070..3fefc61 100644
--- a/build-vm-ec2
+++ b/build-vm-ec2
@@ -1,8 +1,25 @@
#
# EC2 specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
BUILD_EC2_TYPE="t1.micro"
diff --git a/build-vm-emulator b/build-vm-emulator
index 472385c..045d244 100644
--- a/build-vm-emulator
+++ b/build-vm-emulator
@@ -1,11 +1,32 @@
#
# generic emulator specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
vm_verify_options_emulator() {
- VM_SWAP=
+ if test -f "$BUILD_DIR/emulator/verify-options.sh"; then
+ . "$BUILD_DIR/emulator/verify-options.sh"
+ else
+ VM_SWAP=
+ fi
}
vm_startup_emulator() {
@@ -15,7 +36,7 @@ vm_startup_emulator() {
elif test "${EMULATOR_SCRIPT:0:1}" != / ; then
EMULATOR_SCRIPT="./$EMULATOR_SCRIPT"
fi
- set -- "$EMULATOR_SCRIPT" "$VM_IMAGE"
+ set -- "$EMULATOR_SCRIPT" "$VM_IMAGE" "$VM_SWAP"
echo "$@"
if ! "$@"; then
popd
@@ -24,6 +45,8 @@ vm_startup_emulator() {
fi
popd
+ test -n "$VM_SWAP" && return
+
# Emulators may not offer to use a second swap space.
# So we just mount the filesystem.
# WARNING: This is not safe against attacks.
diff --git a/build-vm-kvm b/build-vm-kvm
index 5130ec7..455ecc1 100644
--- a/build-vm-kvm
+++ b/build-vm-kvm
@@ -1,8 +1,25 @@
#
# kvm/qemu specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
kvm_bin=/usr/bin/qemu-kvm
kvm_console=ttyS0
diff --git a/build-vm-lxc b/build-vm-lxc
index c8eeb9f..6d9ef20 100644
--- a/build-vm-lxc
+++ b/build-vm-lxc
@@ -1,8 +1,25 @@
#
# LXC specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
vm_verify_options_lxc() {
VM_IMAGE=
diff --git a/build-vm-openstack b/build-vm-openstack
index 92d1d78..73688ec 100644
--- a/build-vm-openstack
+++ b/build-vm-openstack
@@ -1,8 +1,25 @@
#
# Openstack specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
cloud_volume_attach_openstack() {
local VM_SERVER="$1"
diff --git a/build-vm-qemu b/build-vm-qemu
index ba95f37..09e4250 100644
--- a/build-vm-qemu
+++ b/build-vm-qemu
@@ -1,8 +1,25 @@
#
# qemu specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
# just forward everything to kvm...
diff --git a/build-vm-uml b/build-vm-uml
index 13c6456..4ca82e6 100644
--- a/build-vm-uml
+++ b/build-vm-uml
@@ -1,8 +1,25 @@
#
# UML specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
uml_kernel=/boot/vmlinux-um
uml_initrd=/boot/initrd-um
diff --git a/build-vm-xen b/build-vm-xen
index d3c55e0..7366009 100644
--- a/build-vm-xen
+++ b/build-vm-xen
@@ -1,8 +1,25 @@
#
# XEN specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
vm_verify_options_xen() {
vm_kernel=/boot/vmlinuz
diff --git a/build-vm-zvm b/build-vm-zvm
index 2bbabe6..c28442c 100644
--- a/build-vm-zvm
+++ b/build-vm-zvm
@@ -1,8 +1,25 @@
#
# z/VM specific functions
#
-# (C) 2014 SUSE, Inc
+################################################################
#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
# z/VM: use default kernel image from local machine
# lets go with the default parameters. However zvm_initrd will be a required parameter
diff --git a/changelog2spec b/changelog2spec
index 4b94798..d95ab85 100755
--- a/changelog2spec
+++ b/changelog2spec
@@ -4,6 +4,26 @@
# Convert a SUSE or Debian changelog file to rpm format
#
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
diff --git a/common_functions b/common_functions
index 4c2c0b6..2bfc988 100755
--- a/common_functions
+++ b/common_functions
@@ -1,5 +1,25 @@
#!/bin/bash
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
build_host_arch() {
: ${BUILD_HOST_ARCH:=`uname -m`}
BUILD_INITVM_ARCH="$BUILD_HOST_ARCH"
diff --git a/computeblocklists b/computeblocklists
index 80d2ca7..1370f50 100755
--- a/computeblocklists
+++ b/computeblocklists
@@ -11,6 +11,26 @@
# a block is either a number or a range (start-end)
#
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use strict;
my ($opt_padstart, $opt_padend, $opt_verbose, $opt_manifest, $opt_mani0);
diff --git a/createarchdeps b/createarchdeps
index 94efdb1..d73ea38 100755
--- a/createarchdeps
+++ b/createarchdeps
@@ -2,6 +2,26 @@
# Archlinux support, based on the GSoC work of Nikolay Rysev <mad.f3ka@gmail.com>
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{"BUILD_DIR"} || "/usr/lib/build");
}
diff --git a/createdebdeps b/createdebdeps
new file mode 100755
index 0000000..20b924a
--- /dev/null
+++ b/createdebdeps
@@ -0,0 +1,118 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{"BUILD_DIR"} || "/usr/lib/build");
+}
+
+use strict;
+use Digest::MD5;
+use File::Path;
+use Getopt::Long;
+use Build::Deb;
+
+Getopt::Long::Configure("no_ignore_case");
+
+my $cachedir = "/var/cache/build";
+my $archpath;
+
+sub getreponame {
+ my ($url) = @_;
+ return $1 if "/$url/" =~ /.*\/([^\/]+)\/os\//;
+ return undef;
+}
+
+my $pkgnum = 0;
+
+sub printpkginfo {
+ my ($d, $repourl) = @_;
+
+ for (qw{package version filename architecture}) {
+ return unless defined $d->{$_};
+ }
+ $pkgnum++;
+ my $id = "$d->{'package'}.$d->{'architecture'}-$pkgnum/0/0";
+ print "F:$id: $repourl$d->{'filename'}\n";
+ if (defined $d->{'provides'}) {
+ $d->{'provides'} =~ s/,\s+/ /g;
+ print "P:$id: $d->{'provides'} $d->{'package'} (= $d->{'version'})\n";
+ } else {
+ print "P:$id: $d->{'package'} (= $d->{'version'})\n";
+ }
+ if (defined $d->{'depends'}) {
+ $d->{'depends'} =~ s/,\s+/ /g;
+ print "R:$id: $d->{'depends'}\n";
+ }
+ print "I:$id: $d->{package}-$d->{'version'} 0\n";
+}
+
+GetOptions('cachedir=s' => \$cachedir, 'archpath=s' => \$archpath) or exit(1);
+
+if (!$archpath) {
+ $archpath = `uname -p` || 'unknown';
+ chomp $archpath;
+}
+my $basearch = $archpath;
+$basearch =~ s/:.*//;
+$basearch = Build::Deb::basearch($basearch);
+
+for my $url (@ARGV) {
+ die("Not an remote debian repo") unless $url =~ /^(:?ftps?|https?):\/\/([^\/]*)\/?/;
+ my $reponame = getreponame($url);
+ my $repoid = Digest::MD5::md5_hex($url);
+ my $dir = "$cachedir/$repoid";
+
+ my @components;
+ my $baseurl = $url;
+
+ if ($url =~ /^(.*\/)\.(\/.*)?$/) {
+ # flat repo
+ $baseurl = $1;
+ @components = ('.');
+ $url = defined($2) ? "$1$2" : $1;
+ $url .= '/' unless $url =~ /\/$/;
+ } else {
+ if ($url =~ /([^\/]+)$/) {
+ @components = split(/[,+]/, $1);
+ $url =~ s/([^\/]+)$//;
+ }
+ push @components, 'main' unless @components;
+ $url .= '/' unless $url =~ /\/$/;
+ $url =~ s/([^\/]+\/)$/dists\/$1/;
+ }
+
+ File::Path::mkpath($dir);
+ for my $component (@components) {
+ unlink("$dir/Packages.gz");
+ if ($component eq '.') {
+ system($INC[0]."/download", $dir, "${url}Packages.gz");
+ die("Packages.gz missing\n") unless -s "$dir/Packages.gz";
+ } else {
+ system($INC[0]."/download", $dir, "$url$component/binary-$basearch/Packages.gz");
+ die("Packages.gz missing for basearch $basearch, component $component\n") unless -s "$dir/Packages.gz";
+ }
+ open(F, "-|", 'gunzip', '-dc', "$dir/Packages.gz") || die("$dir/Packages.gz: $!\n");
+ my $pkg = {};
+ my $tag;
+ while (<F>) {
+ chomp;
+ if ($_ eq '') {
+ printpkginfo($pkg, $baseurl);
+ $pkg = {};
+ next;
+ }
+ if (/^\s/) {
+ next unless $tag;
+ $pkg->{$tag} .= "\n".substr($_, 1);
+ next;
+ }
+ my $data;
+ ($tag, $data) = split(':', $_, 2);
+ next unless defined $data;
+ $tag = lc($tag);
+ $data =~ s/^\s*//;
+ $pkg->{$tag} = $data;
+ }
+ close(F) || die("gunzip: $!\n");
+ printpkginfo($pkg, $baseurl);
+ }
+}
diff --git a/createrepomddeps b/createrepomddeps
index fad84e5..fe89a57 100755
--- a/createrepomddeps
+++ b/createrepomddeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
@@ -359,6 +379,15 @@ sub printasbuildcachefile(@)
$deps = deps2string(@{$pkg->{'requires'}});
print "R:$id$deps\n";
+ if (@{$pkg->{'conflicts'} || []}) {
+ $deps = deps2string(@{$pkg->{'conflicts'}});
+ print "C:$id$deps\n";
+ }
+ if (@{$pkg->{'obsoletes'} || []}) {
+ $deps = deps2string(@{$pkg->{'obsoletes'}});
+ print "O:$id$deps\n";
+ }
+
my $tag = sprintf("%s-%s-%s %s",
$pkg->{'name'},
$pkg->{'ver'},
diff --git a/createrpmdeps b/createrpmdeps
index c8c796d..191c850 100755
--- a/createrpmdeps
+++ b/createrpmdeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
@@ -15,6 +35,8 @@ my %tag;
my %oldp;
my %oldr;
+my %oldc;
+my %oldo;
if (defined($rpmdepfile) && open(F, '<', $rpmdepfile)) {
while (<F>) {
chomp;
@@ -22,6 +44,10 @@ if (defined($rpmdepfile) && open(F, '<', $rpmdepfile)) {
$oldp{$1} = $_;
} elsif (/^R:([^ ]): /) {
$oldr{$1} = $_;
+ } elsif (/^C:([^ ]): /) {
+ $oldc{$1} = $_;
+ } elsif (/^O:([^ ]): /) {
+ $oldo{$1} = $_;
}
}
close F;
@@ -74,9 +100,13 @@ foreach my $dir (@ARGV) {
my %newp;
my %newr;
+ my %newc;
+ my %newo;
for (@known) {
$newp{$_} = $oldp{$_} if $oldp{$_};
$newr{$_} = $oldr{$_} if $oldr{$_};
+ $newc{$_} = $oldc{$_} if $oldc{$_};
+ $newo{$_} = $oldo{$_} if $oldo{$_};
}
my @todo = grep {!($newp{$_} && $newr{$_})} @known;
@@ -84,10 +114,12 @@ foreach my $dir (@ARGV) {
for my $known (@todo) {
my $path = $known2path{$known};
if ($path =~ /\.rpm$/) {
- my %res = Build::Rpm::rpmq($path, 1000, 1001, 1002, 1006, 1022, 1047, 1049, 1048, 1050, 1112, 1113);
+ my %res = Build::Rpm::rpmq($path, 1000, 1001, 1002, 1006, 1022, 1047, 1049, 1048, 1050, 1053, 1054, 1055, 1090, 1112, 1113, 1114, 1115);
next unless %res;
Build::Rpm::add_flagsvers(\%res, 1047, 1112, 1113);
Build::Rpm::add_flagsvers(\%res, 1049, 1048, 1050);
+ Build::Rpm::add_flagsvers(\%res, 1054, 1053, 1055);
+ Build::Rpm::add_flagsvers(\%res, 1090, 1114, 1115);
my $id = $known;
$id =~ s/.*-//;
if ($known ne "$res{1000}->[0].$res{1022}->[0]-$id") {
@@ -107,6 +139,8 @@ foreach my $dir (@ARGV) {
$newp{$known} = "P:$known: ".join(' ', @{$res{1047} || []});
$newr{$known} = "R:$known: ".join(' ', @{$res{1049} || []});
+ $newc{$known} = "C:$known: ".join(' ', @{$res{1054} || []}) if @{$res{1054} || []};
+ $newo{$known} = "O:$known: ".join(' ', @{$res{1090} || []}) if @{$res{1090} || []};
#$tag{$known} = $res{1000}->[0]."-".$res{1001}->[0]."-".$res{1002}->[0]." ".$res{1007}->[0]."-".$res{1006}->[0];
$tag{$known} = $res{1000}->[0]."-".$res{1001}->[0]."-".$res{1002}->[0]." ".$res{1006}->[0];
} else {
@@ -141,6 +175,7 @@ foreach my $dir (@ARGV) {
print "F:$_: $known2path{$_}\n";
print "$newp{$_}\n";
print "$newr{$_}\n";
+ print "$newc{$_}\n" if $newc{$_};
print "I:$_: $tag{$_}\n" if exists $tag{$_};
}
}
diff --git a/createyastdeps b/createyastdeps
index 43c83e7..b135ae2 100755
--- a/createyastdeps
+++ b/createyastdeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
@@ -17,18 +37,12 @@ sub print_pkg($)
my $pkg = shift;
return if $pkg->{'arch'} eq 'src' || $pkg->{'arch'} eq 'nosrc';
- my $id = sprintf("%s.%s-%d/%d/%d: ",
- $pkg->{'name'},
- $pkg->{'arch'},
- $pkg->{'buildtime'},
- 0,
- 0);
- print sprintf('F:%s%ssuse/%s/%s',$id,$pkg->{'baseurl'},
- $pkg->{'arch'}, $pkg->{'location'}), "\n";
-
- print "P:$id".$pkg->{'provides'}."\n";
- print "R:$id".$pkg->{'requires'}."\n";
-
+ my $id = sprintf("%s.%s-%d/%d/%d: ", $pkg->{'name'}, $pkg->{'arch'}, $pkg->{'buildtime'}, 0, 0);
+ print "F:$id$pkg->{'baseurl'}suse/$pkg->{'arch'}/$pkg->{'location'}\n";
+ print "P:$id$pkg->{'provides'}\n";
+ print "R:$id$pkg->{'requires'}\n";
+ print "C:$id$pkg->{'conflicts'}\n" if $pkg->{'conflicts'};
+ print "O:$id$pkg->{'obsoletes'}\n" if $pkg->{'obsoletes'};
my $tag = sprintf("%s-%s-%s %s",
$pkg->{'name'},
$pkg->{'version'},
@@ -44,23 +58,22 @@ sub callback
$pkg->{'provides'} = [] unless exists $pkg->{'provides'};
# add self provides (rpm3 misses that)
my $n = $pkg->{'name'};
- if(substr($pkg->{'arch'}, -3) ne 'src' && !scalar grep(/^\Q$n\E( =.*)?$/,@{$pkg->{'provides'}}))
- {
+ if(substr($pkg->{'arch'}, -3) ne 'src' && !grep(/^\Q$n\E( =.*)?$/,@{$pkg->{'provides'}})) {
push @{$pkg->{'provides'}}, sprintf("%s = %s-%s", $pkg->{'name'}, $pkg->{'version'}, $pkg->{'release'});
}
$pkg->{'provides'} = join(' ', @{$pkg->{'provides'}});
$pkg->{'requires'} = join(' ', @{$pkg->{'requires'}}) if $pkg->{'requires'};
+ $pkg->{'conflicts'} = join(' ', @{$pkg->{'conflicts'}}) if $pkg->{'conflicts'};
+ $pkg->{'obsoletes'} = join(' ', @{$pkg->{'obsoletes'}}) if $pkg->{'obsoletes'};
$pkg->{'baseurl'} = $url;
my @data = split(' ', $pkg->{'location'});
# multi cd support hack
my $num = $data[0];
- if($pkg->{'baseurl'} =~ /1\/$/ && $num ne 0) {
+ if($pkg->{'baseurl'} =~ /1\/$/ && $num ne '0') {
$pkg->{'baseurl'} =~ s/1\/$/$num\//;
}
$pkg->{'location'} = $data[1];
-
print_pkg($pkg);
-
return 0;
}
@@ -69,19 +82,10 @@ sub callback
my $opt_zypp;
my $cachedir = "/var/cache/build";
-GetOptions (
- "zypp=s" => \$opt_zypp,
- "cachedir=s" => \$cachedir,
- ) or exit(1);
+GetOptions ("zypp=s" => \$opt_zypp, "cachedir=s" => \$cachedir) or exit(1);
for my $url (@ARGV) {
- my $dir;
- if ($opt_zypp) {
- $dir = $opt_zypp;
- } else {
- $dir = $url;
- }
-
+ my $dir = $opt_zypp ? $opt_zypp : $url;
$dir .= '/' unless $dir =~ /\/$/;
$url .= '/' unless $url =~ /\/$/;
@@ -90,6 +94,6 @@ for my $url (@ARGV) {
my @order = ();
my $pkgs = Build::Susetags::parse($packages,
- { 'Loc' => 'location', 'Prv' => 'provides', 'Req' => 'requires', 'Tim' => 'buildtime' },
+ { 'Loc' => 'location', 'Prv' => 'provides', 'Req' => 'requires', 'Con' => 'conflicts', 'Obs' => 'obsoletes', 'Tim' => 'buildtime' },
{ cb => \&callback, data => $url });
}
diff --git a/createzyppdeps b/createzyppdeps
index 9abf693..9c812b9 100755
--- a/createzyppdeps
+++ b/createzyppdeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
diff --git a/debtransform b/debtransform
index 272ff71..29ef4c3 100755
--- a/debtransform
+++ b/debtransform
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use strict;
use Digest::MD5;
diff --git a/debtransformbz2 b/debtransformbz2
index 01c1e9d..b49ed4c 100755
--- a/debtransformbz2
+++ b/debtransformbz2
@@ -1,5 +1,25 @@
#! /bin/bash
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
if test $# -ne 2; then
exit 1
fi
diff --git a/debtransformzip b/debtransformzip
index 2054c12..2335745 100755
--- a/debtransformzip
+++ b/debtransformzip
@@ -1,5 +1,25 @@
#! /bin/bash
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
if test $# -ne 2; then
exit 1
fi
diff --git a/download b/download
index b0a7c1f..96c46c0 100755
--- a/download
+++ b/download
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use Net::SSL ();
BEGIN {
$ENV{PERL_LWP_SSL_VERIFY_HOSTNAME} = 0,
diff --git a/emulator/emulator.sh b/emulator/emulator.sh
index 78bc238..3320f9f 100755
--- a/emulator/emulator.sh
+++ b/emulator/emulator.sh
@@ -1,5 +1,25 @@
#!/bin/bash
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
echo "ERROR: the emulator.sh script needs to be changed to support your emulator!"
exit 1
diff --git a/expanddeps b/expanddeps
index 48116d8..48272b7 100755
--- a/expanddeps
+++ b/expanddeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
@@ -74,14 +94,28 @@ for my $arg (@ARGV) {
push @extradeps, $arg;
}
}
+
+my $binarytype;
my @archs = split(':', $archs);
if ($recipe =~ /(^|\/)PKGBUILD$/) {
push @archs, 'any' unless grep {$_ eq 'any'} @archs;
+ $binarytype = 'arch';
+} elsif ($recipe =~ /\.dsc$/) {
+ push @archs, 'all' unless grep {$_ eq 'noarch'} @archs;
+ $binarytype = 'deb';
} else {
push @archs, 'noarch' unless grep {$_ eq 'noarch'} @archs;
+ $binarytype = 'rpm';
+}
+
+# read dist if we can
+my $cf;
+if (defined($dist) && $dist ne '') {
+ $cf = Build::read_config_dist($dist, $archs[0], $configdir);
+ $binarytype = $cf->{'binarytype'} if $cf->{'binarytype'} && $cf->{'binarytype'} ne 'UNDEFINED';
}
-my (%fn, %prov, %req);
+my (%fn, %prov, %req, %con, %obs);
my %packs;
my %repo;
@@ -91,42 +125,52 @@ my %packs_arch;
my %packs_done;
open(F, '<', $rpmdeps) || die("$rpmdeps: $!\n");
# WARNING: the following code assumes that the 'I' tag comes last
-my ($pkgF, $pkgP, $pkgR);
+my ($pkgF, $pkgP, $pkgR, $pkgC, $pkgO);
+
+my $verscmp = \&Build::Rpm::verscmp;
+
+if ($binarytype && $binarytype eq 'deb') {
+ $verscmp = \&Build::Deb::verscmp;
+ for my $arch (@archs) {
+ $arch = Build::Deb::basearch($arch) unless $arch =~ /^i[456]86$/;
+ }
+}
+
while(<F>) {
chomp;
if (/^F:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
$pkgF = $2;
- next if $fn{$1};
- $fn{$1} = $2;
- my $pack = $1;
- $pack =~ /^(.*)\.([^\.]+)$/ or die;
- push @{$packs_arch{$2}}, $1;
} elsif (/^P:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
$pkgP = $2;
- next if $prov{$1};
- $prov{$1} = $2;
} elsif (/^R:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
$pkgR = $2;
- next if $req{$1};
- $req{$1} = $2;
+ } elsif (/^C:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgC = $2;
+ } elsif (/^O:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
+ $pkgO = $2;
} elsif (/^I:(.*?)-\d+\/\d+\/\d+: (.*)$/) {
- if ($ids{$1} && !$packs_done{$1} && defined($pkgF) && defined($pkgP) && defined($pkgR)) {
- my $i = $1;
- my $oldid = $ids{$1};
- my $newid = $2;
- if (Build::Rpm::verscmp($oldid, $newid) < 0) {
- $ids{$i} = $newid;
- $fn{$i} = $pkgF;
- $prov{$i} = $pkgP;
- $req{$i} = $pkgR;
- }
- } else {
- next if $ids{$1};
- $ids{$1} = $2;
+ next if $packs_done{$1};
+ my ($i, $newid) = ($1, $2);
+ undef $i unless !$ids{$i} || $verscmp->($ids{$i}, $newid) < 0;
+ undef $i unless defined($pkgF) && defined($pkgP);
+ if (defined $i) {
+ $i =~ /^(.*)\.([^\.]+)$/ or die;
+ push @{$packs_arch{$2}}, $1;
+ $ids{$i} = $newid;
+ $fn{$i} = $pkgF;
+ $prov{$i} = $pkgP;
+ delete $req{$i};
+ delete $con{$i};
+ delete $obs{$i};
+ $req{$i} = $pkgR;
+ $con{$i} = $pkgC if defined $pkgC;
+ $obs{$i} = $pkgO if defined $pkgO;
}
undef $pkgF;
undef $pkgP;
undef $pkgR;
+ undef $pkgC;
+ undef $pkgO;
} elsif ($_ eq 'D:') {
%packs_done = %ids;
}
@@ -164,14 +208,15 @@ if (!defined($dist) || $dist eq '') {
print STDERR "Warning: distribution not specified, assuming '$dist' (see $configdir).\n";
}
-my $cf = Build::read_config_dist($dist, $archs[0], $configdir);
+$cf ||= Build::read_config_dist($dist, $archs[0], $configdir);
$cf->{'warnings'} = 1;
my $dofileprovides = %{$cf->{'fileprovides'}};
+$dofileprovides = 1 if ($binarytype || 'rpm') ne 'rpm';
for my $pack (keys %packs) {
my $r = {};
- my (@s, $s, @pr, @re);
+ my (@s, $s, @pr, @re, @co, @ob);
@s = split(' ', $prov{$packs{$pack}} || '');
while (@s) {
$s = shift @s;
@@ -181,7 +226,12 @@ for my $pack (keys %packs) {
next;
}
push @pr, $s;
- splice(@s, 0, 2) if @s && $s[0] =~ /^[<=>]/;
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $pr[-1] .= " $s[0] $s[1]";
+ $pr[-1] =~ s/ \((.*)\)/ $1/;
+ $pr[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ }
}
@s = split(' ', $req{$packs{$pack}} || '');
while (@s) {
@@ -192,10 +242,41 @@ for my $pack (keys %packs) {
next;
}
push @re, $s;
- splice(@s, 0, 2) if @s && $s[0] =~ /^[<=>]/;
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $re[-1] .= " $s[0] $s[1]";
+ $re[-1] =~ s/ \((.*)\)/ $1/;
+ $re[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ }
+ }
+ @s = split(' ', $con{$packs{$pack}} || '');
+ while (@s) {
+ $s = shift @s;
+ next if !$dofileprovides && $s =~ /^\//;
+ push @co, $s;
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $co[-1] .= " $s[0] $s[1]";
+ $co[-1] =~ s/ \((.*)\)/ $1/;
+ $co[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ }
+ }
+ @s = split(' ', $obs{$packs{$pack}} || '');
+ while (@s) {
+ $s = shift @s;
+ next if !$dofileprovides && $s =~ /^\//;
+ push @ob, $s;
+ while (@s && $s[0] =~ /^[\(<=>|]/) {
+ $ob[-1] .= " $s[0] $s[1]";
+ $ob[-1] =~ s/ \((.*)\)/ $1/;
+ $ob[-1] =~ s/(<|>){2}/$1/;
+ splice(@s, 0, 2);
+ }
}
$r->{'provides'} = \@pr;
$r->{'requires'} = \@re;
+ $r->{'conflicts'} = \@co;
+ $r->{'obsoletes'} = \@ob;
$repo{$pack} = $r;
}
diff --git a/extractbuild b/extractbuild
index 7483ab7..d2d56ad 100755
--- a/extractbuild
+++ b/extractbuild
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use strict;
# buffer size for reading
diff --git a/getbinaryid b/getbinaryid
index 55c57f6..a85df82 100755
--- a/getbinaryid
+++ b/getbinaryid
@@ -1,5 +1,25 @@
#!/usr/bin/perl
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
diff --git a/init_buildsystem b/init_buildsystem
index 9fec7aa..ec1d862 100755
--- a/init_buildsystem
+++ b/init_buildsystem
@@ -7,7 +7,25 @@
# BUILD_RPMS here we get our packages to install
# BUILD_ARCH path of the architectures we try
#
-# (c) 1997-2005 SuSE GmbH Nuernberg, Germany
+################################################################
+#
+# Copyright (c) 1997-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
#
# needed globals variables
@@ -19,7 +37,6 @@ export YAST_IS_RUNNING=instsys
# slurp in package binary support
. "$BUILD_DIR/build-pkg"
-
# need to restore build root owner for non-root builds
browner=0
definesnstuff=()
@@ -38,6 +55,7 @@ LIST_STATE=
RPMLIST=
CLEAN_BUILD=
CREATE_BUILD_BINARIES=
+DLNOSIGNATURE=
CACHE_DIR=/var/cache/build
while test -n "$1" ; do
@@ -84,6 +102,10 @@ while test -n "$1" ; do
CONFIG_DIR=$2
shift 2
;;
+ --nosignature)
+ shift
+ DLNOSIGNATURE="--nosignature"
+ ;;
*)
break
;;
@@ -186,7 +208,7 @@ preinstall() {
}
run_pkg_scripts() {
- chroot $BUILD_ROOT /sbin/ldconfig 2>/dev/null
+ $CHROOT /sbin/ldconfig 2>/dev/null
for PKG in $PACKAGES_TO_RUNSCRIPTS ; do
pkg_runscripts
check_exit
@@ -304,6 +326,8 @@ create_cache_file() {
mkdir -p "$(getcachedir "$SRC")"
if test "$BINTYPE" = arch ; then
set -- $BUILD_DIR/createarchdeps --cachedir="$CACHE_DIR" "$SRC"
+ elif test "$BINTYPE" = deb ; then
+ set -- $BUILD_DIR/createdebdeps --cachedir="$CACHE_DIR" --archpath "$BUILD_ARCH" "$SRC"
else
set -- $BUILD_DIR/createrepomddeps --cachedir="$CACHE_DIR" "$SRC"
fi
@@ -360,7 +384,7 @@ downloadpkg() {
fi
case $destfile in
*.rpm)
- rpm -K "$destfile" > $destfile.v || { echo "rpm verify failed" >&2; rm -rf "$destdir"; cleanup_and_exit 1; }
+ rpm -K $DLNOSIGNATURE "$destfile" > $destfile.v || { echo "rpm verify failed" >&2; rm -rf "$destdir"; cleanup_and_exit 1; }
if grep "NOT OK" $destfile.v; then
rm -rf "$destdir"
cleanup_and_exit 1
@@ -818,7 +842,7 @@ done
rm -rf "$BUILD_ROOT/installed-pkg"
mkdir -p "$BUILD_ROOT/installed-pkg"
-test -x $BUILD_ROOT/sbin/ldconfig && chroot $BUILD_ROOT /sbin/ldconfig 2>&1
+test -x $BUILD_ROOT/sbin/ldconfig && $CHROOT /sbin/ldconfig 2>&1
MAIN_LIST="$PACKAGES_TO_INSTALL"
progress_setup MAIN_LIST
@@ -938,12 +962,12 @@ done
echo now finalizing build dir...
if test -x $BUILD_ROOT/sbin/ldconfig ; then
- CHROOT_RETURN="`chroot $BUILD_ROOT /sbin/ldconfig 2>&1`"
+ CHROOT_RETURN="`$CHROOT /sbin/ldconfig 2>&1`"
case "$CHROOT_RETURN" in
*warning:*)
- chroot $BUILD_ROOT /sbin/ldconfig
+ $CHROOT /sbin/ldconfig
echo
- echo chroot $BUILD_ROOT /sbin/ldconfig
+ echo $CHROOT /sbin/ldconfig
echo
echo "$CHROOT_RETURN"
echo
@@ -955,7 +979,7 @@ if test -x $BUILD_ROOT/sbin/ldconfig ; then
fi
if test -x $BUILD_ROOT/usr/sbin/Check && ! grep -q "/usr/sbin/Check is obsolete" $BUILD_ROOT/usr/sbin/Check ; then
- chroot $BUILD_ROOT /usr/sbin/Check
+ $CHROOT /usr/sbin/Check
fi
mkdir -p $BUILD_ROOT/var/adm/packages
@@ -963,24 +987,24 @@ touch $BUILD_ROOT/var/adm/packages
if test -x $BUILD_ROOT/sbin/SuSEconfig ; then
if grep norestarts $BUILD_ROOT/sbin/SuSEconfig > /dev/null ; then
- chroot $BUILD_ROOT /sbin/SuSEconfig --norestarts --force
+ $CHROOT /sbin/SuSEconfig --norestarts --force
else
- chroot $BUILD_ROOT /sbin/SuSEconfig --force
+ $CHROOT /sbin/SuSEconfig --force
fi
fi
if test -x $BUILD_ROOT/usr/X11R6/bin/switch2mesasoft ; then
- chroot $BUILD_ROOT /usr/X11R6/bin/switch2mesasoft
+ $CHROOT /usr/X11R6/bin/switch2mesasoft
fi
for PROG in /usr/bin/TeX/texhash /usr/bin/texhash ; do
test -x $BUILD_ROOT/$PROG && \
- chroot $BUILD_ROOT bash -c ". /etc/profile ; $PROG"
+ $CHROOT bash -c ". /etc/profile ; $PROG"
done
if test -e $BUILD_ROOT/usr/share/zoneinfo/UTC ; then
for PROG in /usr/sbin/zic /usr/bin/zic /bin/zic /sbin/zic ; do
- test -x $BUILD_ROOT/$PROG && chroot $BUILD_ROOT bash -c "$PROG -l $(readlink -f /usr/share/zoneinfo/UTC)"
+ test -x $BUILD_ROOT/$PROG && $CHROOT bash -c "$PROG -l $(readlink -f /usr/share/zoneinfo/UTC)"
done
fi
@@ -997,7 +1021,7 @@ fi
# XXX: still needed?
if test -x $BUILD_ROOT/bin/rpm -a ! -f $BUILD_ROOT/var/lib/rpm/packages.rpm -a ! -f $BUILD_ROOT/var/lib/rpm/Packages ; then
pkg_initdb_rpm
- chroot $BUILD_ROOT rpm -q --whatprovides rpm >/dev/null 2>&1 # create provides index
+ $CHROOT rpm -q --whatprovides rpm >/dev/null 2>&1 # create provides index
fi
rm -f $BUILD_ROOT/.rpmmacros $BUILD_ROOT/root/.rpmmacros
diff --git a/initvm.c b/initvm.c
index 55686ea..241cf41 100644
--- a/initvm.c
+++ b/initvm.c
@@ -19,8 +19,22 @@
* build script to execute once binfmts are set up
*
* AUTHOR
- * James Perkins <james.perkins@linuxfoundation.org>
- * Adrian Schroeter <adrian@suse.de>
+ * Copyright (c) 2012 James Perkins <james.perkins@linuxfoundation.org>
+ * i Adrian Schroeter <adrian@suse.de>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 or 3 as
+ * published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program (see the file COPYING); if not, write to the
+ * Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <sys/mount.h>
diff --git a/killchroot b/killchroot
index 2b71f6c..330b7c7 100755
--- a/killchroot
+++ b/killchroot
@@ -1,5 +1,25 @@
#!/usr/bin/perl
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
my $sig = 15;
my $verbose = 0;
my $msg = '';
diff --git a/livebuild_pre_run.template b/livebuild_pre_run.template
index d88dad6..679220c 100755
--- a/livebuild_pre_run.template
+++ b/livebuild_pre_run.template
@@ -4,6 +4,26 @@
# executed by build_livebuild.sh in the chroot environment.
#
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
fix_debootstrap()
{
# debootstrap in Debian 7.0 does not like dash
diff --git a/mkbaselibs b/mkbaselibs
index c7ce4fa..33bcee3 100755
--- a/mkbaselibs
+++ b/mkbaselibs
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use POSIX;
use strict;
use File::Temp qw/tempfile tempdir/;
diff --git a/mkdrpms b/mkdrpms
index b3c13b3..a6ba730 100755
--- a/mkdrpms
+++ b/mkdrpms
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, '/usr/lib/build';
unshift @INC, $::ENV{'BUILD_DIR'} if $::ENV{'BUILD_DIR'};
diff --git a/order b/order
index 2236b46..ddf3aa5 100755
--- a/order
+++ b/order
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
diff --git a/qemu-reg b/qemu-reg
index e18a7cd..3288490 100644
--- a/qemu-reg
+++ b/qemu-reg
@@ -9,6 +9,8 @@
:arm:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-arm-binfmt:P
:armeb:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x28:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-armeb-binfmt:P
:ppc:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x14:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-ppc-binfmt:P
+:ppc64:M::i\x7fELF\x02\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff::/usr/bin/qemu-ppc64-binfmt:P
+:ppc64le:M::\x7fELF\x02\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x15:\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff::/usr/bin/qemu-ppc64le-binfmt:P
:mips:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mips-binfmt:P
:mipsel:M::\x7fELF\x01\x01\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08\x00:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff\xff:/usr/bin/qemu-mipsel-binfmt:P
#:mipsn32:M::\x7fELF\x01\x02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x08:\xff\xff\xff\xff\xff\xff\xff\x00\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\xff\xff:/usr/bin/qemu-mipsn32-binfmt:P
diff --git a/queryconfig b/queryconfig
index f4d383c..2666d2c 100755
--- a/queryconfig
+++ b/queryconfig
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
diff --git a/signdummy b/signdummy
index 8fc2e4c..df15f84 100755
--- a/signdummy
+++ b/signdummy
@@ -1,5 +1,25 @@
#!/usr/bin/perl
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
# simple "sign" replacement that does nothing but
# write a 2048 byte file with a fixed signature.
# sign is used in kiwi builds to sign repositories
diff --git a/spec2changelog b/spec2changelog
index 4ac2b0a..a7bcf1e 100755
--- a/spec2changelog
+++ b/spec2changelog
@@ -6,10 +6,25 @@
#
# Usage: cat foo.spec | spec2changes.pl > foo.changes
#
+################################################################
+#
# Copyright 2009 by Pascal Bleser <pascal.bleser@opensuse.org>
-# This script is licensed under the GNU General Public License version 2
-# http://www.gnu.org/licenses/gpl-2.0.html
#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
use warnings;
use strict;
diff --git a/spec_add_patch b/spec_add_patch
index fd62753..7b7cf36 100755
--- a/spec_add_patch
+++ b/spec_add_patch
@@ -2,6 +2,26 @@
# vim:sw=4:et
# Author: Dirk Mueller
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use strict;
sub helpexit {
diff --git a/spectool b/spectool
index ef05859..bdb897c 100755
--- a/spectool
+++ b/spectool
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
=head1 spectool
spectool - tool to work with rpm spec files
diff --git a/substitutedeps b/substitutedeps
index 54e540c..5a15e66 100755
--- a/substitutedeps
+++ b/substitutedeps
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
BEGIN {
unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
}
diff --git a/t/dist b/t/dist
index 889d182..f1fab4f 100755
--- a/t/dist
+++ b/t/dist
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use strict;
use Test::More tests => 9;
use Build;
diff --git a/t/live-build b/t/live-build
index b0c9699..1b20be0 100755
--- a/t/live-build
+++ b/t/live-build
@@ -1,5 +1,25 @@
#!/usr/bin/perl -w -I ..
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
use strict;
use Test::More tests => 5;
use Build::LiveBuild;
diff --git a/unrpm b/unrpm
index e69dafb..e1c347c 100755
--- a/unrpm
+++ b/unrpm
@@ -1,5 +1,25 @@
#!/bin/bash
+################################################################
+#
+# Copyright (c) 1995-2014 SUSE Linux Products GmbH
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 or 3 as
+# published by the Free Software Foundation.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program (see the file COPYING); if not, write to the
+# Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+#
+################################################################
+
function Usage () {
echo "Usage: $(basename $0) [-vq] rpm-files...";
echo "Unpack rpm files in current directory.";
diff --git a/unrpm.1 b/unrpm.1
new file mode 100644
index 0000000..6ed4dcd
--- /dev/null
+++ b/unrpm.1
@@ -0,0 +1,17 @@
+.TH unrpm 1 "(c) 1997-2014 SuSE Linux AG Nuernberg, Germany"
+.SH NAME
+unrpm \- unpack the contents of one or more rpm files
+.SH SYNOPSIS
+.B unrpm
+.RB [ -v ]
+.RB [ -q ]
+.I rpm
+.RB ...
+
+.SH DESCRIPTION
+The \fBunrpm\fP tool unpacks one or more rpm files into the
+current directory. The \fB-v\fP option makes it print the filenames
+while unpacking, whereas the \fB-q\fP option suppresses any output.
+
+.SH SEE ALSO
+.BR rpm2cpio (8),
diff --git a/vc b/vc
index bf57343..66f3da0 100755
--- a/vc
+++ b/vc
@@ -8,7 +8,7 @@
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
+# the Free Software Foundation; either version 2 or 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
@@ -148,7 +148,7 @@ if [ -z "$message" ]; then
fi
fi
mode=`stat -c "%a" "$changelog"`
-user=`stat -c "%U:%G" "$changelog"`
+user=`stat -c "%u:%g" "$changelog"`
mv "$tmpfile" "$changelog"
chmod $mode "$changelog"
chown $user "$changelog"
diff --git a/vc.1 b/vc.1
new file mode 100644
index 0000000..e2b50e2
--- /dev/null
+++ b/vc.1
@@ -0,0 +1,25 @@
+.TH vc 1 "(c) 1997-2014 SuSE Linux AG Nuernberg, Germany"
+.SH NAME
+vs \- create a SUSE stype changes entry
+.SH SYNOPSIS
+.B vc
+.RB [ -m
+.IR message ]
+.RB [ -e ]
+.RI [ changesfile_or_dir
+.RI [ commentfile ]]
+
+.SH DESCRIPTION
+The \fBvc\fP tool adds a new changes entry to a SUSE \fB.changes\fP file.
+The \fB-m\fP option can be used to directly specify the entry, if it is
+not given an editor is started to interactively enter the new changes
+entry. If a \fIcommentfile\fP is given, its content is used as template
+for the new entry instead of an empty entry, whereas the \fB-e\fP option
+suppresses the creation of an empty entry.
+
+If no \fIchangesfile\fP is specified, \fBvc\fP will search the current
+directory for a file ending with \fB.changes\fP. If a directory is
+specified instead of a changes will, it will be searched instead.
+
+.SH SEE ALSO
+.BR build (1),