Bug#717332: please create a debian-cross ML

2013-07-19 Thread Ryan Kuester
This is a good idea. With multiarch, cross development within Debian is coming 
into its prime. Having an obvious place to discuss it will help to keep it 
blossoming.

-- Ryan

--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#702036: multistrap: optionally mark dependencies as auto-installed

2013-03-21 Thread Ryan Kuester
On Sat, Mar 02, 2013 at 04:42:04PM +, Neil Williams wrote:
> On Sat, 2 Mar 2013 00:21:29 +
> Ryan Kuester  wrote:
> 
> > The attached patch causes such packages to be so marked if
> > 'markauto' is set to true in the general settings stanza of the
> > configuration file, e.g.:
> 
> Interesting patch, I think there are problems though.

Neil, I see you've marked this bug as pending. Thanks for fixing my
patch up. I applologize this didn't get back to the top of my TODO
list quickly enough.

The logical errors you mentioned were oversights, and the new trim
function and other oddities were just my naïveté with perl. You've
faithfully implemented the intent of my prototype.

I've just given your version from Subversion a spin here, and it
works great.

> Have you tested this support cross-architecture? Does apt-mark
> correctly handle the config_str to prevent pollution of the system
> running multistrap? (Please describe if you've
> checked /var/lib/apt/extended_states before and after inside the new
> chroot and outside it, especially when the chroot is armel on an x86
> system etc.)

Yep, that's the mode in which I usually use it--building filesystems
for armel on amd64.

Thanks again for the useful tool,
-- Ryan


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#702036: multistrap: optionally mark dependencies as auto-installed

2013-03-01 Thread Ryan Kuester
Package: multistrap
Version: 2.1.20
Severity: wishlist
Tags: patch

To enable use of `apt-get autoremove`, it is necessary that packages
which are installed to satisfy dependencies (as opposed to those
packages directly specified, e.g. via a section "packages" list) be
marked as auto-installed in APT's extended_states database. apt-get
normally does this, but not when APT::Get::Download-Only is set, as it
is by multistrap.

The attached patch causes such packages to be so marked if
'markauto' is set to true in the general settings stanza of the
configuration file, e.g.:


[general]

markauto=true


[emdebian]
source=http://emdebian.org/grip
suite=wheezy-grip



Diffstat of the attached patch:
 multistrap |   21 -
 pod/multistrap |5 +
 2 files changed, 25 insertions(+), 1 deletion(-)


-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages multistrap depends on:
ii  apt0.9.7.7
ii  libconfig-auto-perl0.42-1
ii  liblocale-gettext-perl 1.05-7+b1
ii  libparse-debian-packages-perl  0.03-1
ii  perl   5.14.2-18

Versions of packages multistrap recommends:
ii  emdebian-archive-keyring  2.0.3

Versions of packages multistrap suggests:
ii  fakeroot  1.18.4-2

-- no debconf information
--- a/multistrap
+++ b/multistrap
@@ -36,13 +36,14 @@ use vars qw/ $progname $ourversion $dstrap $extra @aptsources
  $explicit_suite $allow_recommends %omitdebsrc @dsclist @sectoutput
  %flatfile %important $addimportant @debconf $hookdir %hooks
  $warn_count $use_shortcut @foreignarches $olddpkg $ignorenative
- %foreignpkgs /;
+ %foreignpkgs $markauto /;
 
 setlocale(LC_MESSAGES, "");
 textdomain("multistrap");
 $progname = basename($0);
 $ourversion = &our_version();
 $unpack = "true";
+$markauto = "false";
 %omitdebsrc=();
 %foreignpkgs=();
 while( @ARGV ) {
@@ -399,6 +400,7 @@ $retval >>= 8;
 die (sprintf (_g("apt download failed. Exit value: %d\n"),$retval))
 	if ($retval != 0);
 &force_unpack if ($unpack eq "true");
+&mark_as_autoinstalled_except ($str) if ($markauto eq "true");
 system ("touch ${dir}${libdir}lists/lock");
 if ((defined $setupsh) and (-x $setupsh)) {
 	$retval = 0;
@@ -683,6 +685,15 @@ sub force_unpack {
 	}
 }
 
+sub mark_as_autoinstalled_except {
+	my @manual = split(/ +/, $_[0]);
+	my @all = map {
+			trim (`LC_ALL=C dpkg -f ${dir}${cachedir}archives/$_ Package`);
+		} @archives;
+	my @auto = grep {my $pkg = $_; ! grep /$pkg/, @manual} @all;
+	system ("apt-mark $config_str auto " . join (" ", @auto)) if @auto;
+}
+
 sub run_download_hooks {
 	my (@hooks) = @_;
 	return if (scalar @hooks == 0);
@@ -1123,6 +1134,7 @@ sub cascade {
 if (defined $keys{$section}{'directory'} and (not defined $dir));
 			# support the original value but replace by new value.
 			$unpack = "false" if (defined $keys{$section}{'forceunpack'} and (lc($keys{$section}{'forceunpack'}) ne "true"));
+			$markauto = lc($keys{$section}{'markauto'}) if (defined $keys{$section}{'markauto'});
 			$unpack = "false" if (defined $keys{$section}{'unpack'} and (lc($keys{$section}{'unpack'} ne "true")));
 			$configsh = lc($keys{$section}{'configscript'})
 if (defined $keys{$section}{'configscript'} and (not defined $configsh));
@@ -1477,3 +1489,10 @@ sub dump_config {
 		exit 1;
 	}
 }
+
+sub trim {
+	my $str = shift;
+	$str =~ s/^\s+//;
+	$str =~ s/\s+$//;
+	return $str;
+}

--- a/pod/multistrap
+++ b/pod/multistrap
@@ -175,6 +175,11 @@ the C list under General.
 
 The order of section names in either list is not important.
 
+'markauto' if true will cause packages installed to satisfy a
+dependency (as opposed to those installed intentionally, via a
+C list) to be marked as automatically installed in APT's
+extended state database.
+
 As with debootstrap, multistrap will continue after errors, as long
 as the configuration file can be correctly parsed.
 


Bug#702033: multistrap: deletes files unpacked to /etc/apt/sources.list.d

2013-03-01 Thread Ryan Kuester
Package: multistrap
Version: 2.1.20
Severity: normal
Tags: patch

After downloading and unpacking, multistrap deletes *all* files in
${target}/etc/apt/sources.list.d in order to delete the files
specifying the sources from which it downloaded. This inadvertently
deletes any source lists added by the packages that were just
unpacked.

The following patch limits the lists deleted to only those added by
multistrap itself.

--- a/multistrap
+++ b/multistrap
@@ -427,7 +427,7 @@ unlink 
("${dir}etc/apt/sources.list.d/multistrap.sources.list")
if (-f "${dir}etc/apt/sources.list.d/multistrap.sources.list");
 opendir (LISTS, "${dir}etc/apt/sources.list.d/")
or die (_g("Cannot read apt sources list directory.\n"));
-my @sources=grep(!m:\.\.?$:, readdir LISTS);
+my @sources=grep(m:^multistrap-.*\.list$:, readdir LISTS);
 closedir (LISTS);
 foreach my $filelist (@sources) {
next if (-d $filelist);


-- System Information:
Debian Release: 7.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages multistrap depends on:
ii  apt0.9.7.7
ii  libconfig-auto-perl0.42-1
ii  liblocale-gettext-perl 1.05-7+b1
ii  libparse-debian-packages-perl  0.03-1
ii  perl   5.14.2-18

Versions of packages multistrap recommends:
ii  emdebian-archive-keyring  2.0.3

Versions of packages multistrap suggests:
ii  fakeroot  1.18.4-2

-- no debconf information


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org