summaryrefslogtreecommitdiff
path: root/gettype
diff options
context:
space:
mode:
authorCarsten Munk <carsten.munk@gmail.com>2012-02-24 10:36:17 +0100
committerAdrian Schröter <adrian@suse.de>2012-04-10 14:08:07 +0200
commit8bade085689ec3e9be5766dacc49fe57eb66bbd0 (patch)
treeeac0dc87666789cb6e691f69f774975cc71e0131 /gettype
parent54b130169ee32648bbe6b751b401bf2fad938dba (diff)
downloadbuild-8bade085689ec3e9be5766dacc49fe57eb66bbd0.tar.gz
build-8bade085689ec3e9be5766dacc49fe57eb66bbd0.tar.bz2
build-8bade085689ec3e9be5766dacc49fe57eb66bbd0.zip
Make it possible to specify Type: in prjconf and have non-rpm.rpm chroots
Signed-off-by: Carsten Munk <carsten.munk@gmail.com> Conflicts: init_buildsystem
Diffstat (limited to 'gettype')
-rwxr-xr-xgettype36
1 files changed, 36 insertions, 0 deletions
diff --git a/gettype b/gettype
new file mode 100755
index 0000000..e07483a
--- /dev/null
+++ b/gettype
@@ -0,0 +1,36 @@
+#!/usr/bin/perl -w
+
+BEGIN {
+ unshift @INC, ($::ENV{'BUILD_DIR'} || '/usr/lib/build');
+}
+
+use strict;
+
+use Build;
+
+my ($dist, $archs, $configdir, $debug);
+
+while (@ARGV) {
+ if ($ARGV[0] eq '--dist') {
+ shift @ARGV;
+ $dist = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--archpath') {
+ shift @ARGV;
+ $archs = shift @ARGV;
+ next;
+ }
+ if ($ARGV[0] eq '--configdir') {
+ shift @ARGV;
+ $configdir = shift @ARGV;
+ next;
+ }
+ last;
+}
+
+die("Usage: gettype --dist <dist> --archpath <archpath> [--configdir <configdir>]\n") if @ARGV;
+
+my $cf = Build::read_config_dist($dist, $archs, $configdir);
+exit 0 unless $cf->{'type'};
+print "$cf->{'type'}\n";