Author: schoenfeld
Date: 2008-09-21 20:07:31 +0000 (Sun, 21 Sep 2008)
New Revision: 1638

Modified:
   trunk/conf.default.in
   trunk/debian/changelog
   trunk/debian/postinst
   trunk/scripts/mk-build-deps.pl
Log:
mk-build-deps:
  + Enable configuration file parsing
  + Add a configuration option MKBUILDDEPS_TOOL to specify which tool shall
    be used if the installation of the build-depends after creation is
    requested.
  + Add a configuration option MKBUILDDEPS_REMOVE_AFTER_INSTALL to configure
    that package files shall always be installed after installing the
    created packages and its build-depends.

Modified: trunk/conf.default.in
===================================================================
--- trunk/conf.default.in       2008-09-21 16:54:16 UTC (rev 1637)
+++ trunk/conf.default.in       2008-09-21 20:07:31 UTC (rev 1638)
@@ -539,3 +539,11 @@
 ##### wnpp-check
 #
 # No variables currently
+
+#### mk-build-deps
+#
+# Which tool to use for installing build depends?
+# MKBUILDDEPS_TOOL=/usr/bin/apt-get
+#
+# Remove package files after install?
+# MKBUILDDEPS_REMOVE_AFTER_INSTALL=yes

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog      2008-09-21 16:54:16 UTC (rev 1637)
+++ trunk/debian/changelog      2008-09-21 20:07:31 UTC (rev 1638)
@@ -13,6 +13,13 @@
       packages (default: apt-get)
     + Add an option --remove to specify that package files should be deleted
       after installing it.
+    + Enable configuration file parsing
+    + Add a configuration option MKBUILDDEPS_TOOL to specify which tool shall
+      be used if the installation of the build-depends after creation is
+      requested.
+    + Add a configuration option MKBUILDDEPS_REMOVE_AFTER_INSTALL to configure
+      that package files shall always be installed after installing the
+      created packages and its build-depends.
 
  -- Patrick Schoenfeld <[EMAIL PROTECTED]>  Sun, 21 Sep 2008 18:43:33 +0200
 

Modified: trunk/debian/postinst
===================================================================
--- trunk/debian/postinst       2008-09-21 16:54:16 UTC (rev 1637)
+++ trunk/debian/postinst       2008-09-21 20:07:31 UTC (rev 1638)
@@ -565,6 +565,15 @@
 
 EOF
            fi
+           cat >> /etc/devscripts.conf << EOF
+##### mk-build-deps options added in version 2.10.38
+#
+# Which tool to use for installing build depends?
+# MKBUILDDEPS_TOOL=/usr/bin/apt-get
+#
+# Remove package files after install?
+# MKBUILDDEPS_REMOVE_AFTER_INSTALL=yes
+EOF
        fi
     fi
 fi

Modified: trunk/scripts/mk-build-deps.pl
===================================================================
--- trunk/scripts/mk-build-deps.pl      2008-09-21 16:54:16 UTC (rev 1637)
+++ trunk/scripts/mk-build-deps.pl      2008-09-21 20:07:31 UTC (rev 1638)
@@ -83,13 +83,45 @@
 
 my $progname = basename($0);
 my $opt_install;
-my $opt_remove;
+my $opt_remove=0;
 my ($opt_help, $opt_version);
 my $control;
-my $install_tool='apt-get';
+my $install_tool;
 my @packages;
 my @deb_files;
 
+my @config_files = ('/etc/devscripts.conf', '~/.devscripts');
+my %config_vars = (
+                   'MKBUILDDEPS_TOOL' => 'apt-get',
+                   'MKBUILDDEPS_REMOVE_AFTER_INSTALL' => 'no'
+                   );
+my %config_default = %config_vars;
+
+my $shell_cmd;
+# Set defaults
+foreach my $var (keys %config_vars) {
+       $shell_cmd .= qq[$var="$config_vars{$var}";\n];
+}
+$shell_cmd .= 'for file in ' . join(" ",@config_files) . "; do\n";
+$shell_cmd .= '[ -f $file ] && . $file; done;' . "\n";
+# Read back values
+foreach my $var (keys %config_vars) { $shell_cmd .= "echo \$$var;\n" }
+my $shell_out = `/bin/bash -c '$shell_cmd'`;
[EMAIL PROTECTED] %config_vars} = split /\n/, $shell_out, -1;
+
+# Check validity
+$config_vars{'MKBUILDDEPS_TOOL'} =~ /./
+       or $config_vars{'MKBUILDDEPS_TOOL'}='/usr/bin/apt-get';
+$config_vars{'MKBUILDDEPS_REMOVE_AFTER_INSTALL'} =~ /^(yes|no)$/
+       or $config_vars{'MKBUILDDEPS_REMOVE_AFTER_INSTALL'}='no';
+
+$install_tool = $config_vars{'MKBUILDDEPS_TOOL'};
+
+if ($config_vars{'MKBUILDDEPS_REMOVE_AFTER_INSTALL'} =~ /yes/) {
+       $opt_remove=1;
+}
+
+
 GetOptions("help|h" => \$opt_help,
            "version|v" => \$opt_version,
           "install|i" => \$opt_install,



-- 
To unsubscribe, send mail to [EMAIL PROTECTED]

Reply via email to