Compare commits

...

2 commits

2 changed files with 19 additions and 13 deletions

View file

@ -1,3 +1,8 @@
0.8.2 (2021-12-14)
------------------
- use apt patterns to select priority variants (requires apt >= 2.3.10)
0.8.1 (2021-10-07) 0.8.1 (2021-10-07)
------------------ ------------------

View file

@ -23,7 +23,7 @@
use strict; use strict;
use warnings; use warnings;
our $VERSION = '0.8.1'; our $VERSION = '0.8.2';
use English; use English;
use Getopt::Long; use Getopt::Long;
@ -599,8 +599,8 @@ sub get_unshare_cmd {
# not exist). It would also also call setgroups() in a way that makes # not exist). It would also also call setgroups() in a way that makes
# the root user be part of the group unknown. # the root user be part of the group unknown.
if ($EFFECTIVE_USER_ID != 0) { if ($EFFECTIVE_USER_ID != 0) {
0 == syscall &SYS_setgid, 0 or error "setgid failed: $!"; 0 == syscall &SYS_setgid, 0 or error "setgid failed: $!";
0 == syscall &SYS_setuid, 0 or error "setuid failed: $!"; 0 == syscall &SYS_setuid, 0 or error "setuid failed: $!";
0 == syscall &SYS_setgroups, 0, 0 or error "setgroups failed: $!"; 0 == syscall &SYS_setgroups, 0, 0 or error "setgroups failed: $!";
} }
@ -1858,7 +1858,7 @@ sub run_setup() {
} }
symlink $linkname, "$options->{root}/dev/$fname" symlink $linkname, "$options->{root}/dev/$fname"
or error "cannot create symlink ./dev/$fname"; or error "cannot create symlink ./dev/$fname";
next; # chmod cannot work on symlinks next; # chmod cannot work on symlinks
} elsif ($type == 3) { # character special } elsif ($type == 3) { # character special
0 == system('mknod', "$options->{root}/dev/$fname", 'c', 0 == system('mknod', "$options->{root}/dev/$fname", 'c',
$devmajor, $devminor) $devmajor, $devminor)
@ -3105,7 +3105,7 @@ sub hookhelper {
# supply it with on stdin to the output directory inside # supply it with on stdin to the output directory inside
# the chroot # the chroot
my @cmd = ( my @cmd = (
@cmdprefix, @tarcmd, '--xattrs-include=*', @cmdprefix, @tarcmd, '--xattrs-include=*',
'--directory', $directory, '--extract', '--file', '-' '--directory', $directory, '--extract', '--file', '-'
); );
debug("helper: running " . (join " ", @cmd)); debug("helper: running " . (join " ", @cmd));
@ -3246,7 +3246,7 @@ sub hookhelper {
# inside the requested directory inside the chroot and # inside the requested directory inside the chroot and
# writes it to stdout. # writes it to stdout.
my @cmd = ( my @cmd = (
@cmdprefix, @tarcmd, '--directory', @cmdprefix, @tarcmd, '--directory',
$directory, '--create', '--file', '-', '.' $directory, '--create', '--file', '-', '.'
); );
debug("helper: running " . (join " ", @cmd)); debug("helper: running " . (join " ", @cmd));
@ -4142,8 +4142,8 @@ sub main() {
Getopt::Long::Configure('default', 'bundling', 'auto_abbrev', Getopt::Long::Configure('default', 'bundling', 'auto_abbrev',
'ignore_case_always'); 'ignore_case_always');
GetOptions( GetOptions(
'h|help' => sub { pod2usage(-exitval => 0, -verbose => 1) }, 'h|help' => sub { pod2usage(-exitval => 0, -verbose => 1) },
'man' => sub { pod2usage(-exitval => 0, -verbose => 2) }, 'man' => sub { pod2usage(-exitval => 0, -verbose => 2) },
'version' => sub { print STDOUT "mmdebstrap $VERSION\n"; exit 0; }, 'version' => sub { print STDOUT "mmdebstrap $VERSION\n"; exit 0; },
'components=s@' => \$options->{components}, 'components=s@' => \$options->{components},
'variant=s' => \$options->{variant}, 'variant=s' => \$options->{variant},
@ -4192,8 +4192,8 @@ sub main() {
'logfile=s' => \$logfile, 'logfile=s' => \$logfile,
# no-op options so that mmdebstrap can be used with # no-op options so that mmdebstrap can be used with
# sbuild-createchroot --debootstrap=mmdebstrap # sbuild-createchroot --debootstrap=mmdebstrap
'resolve-deps' => sub { push @{ $options->{noop} }, 'resolve-deps'; }, 'resolve-deps' => sub { push @{ $options->{noop} }, 'resolve-deps'; },
'merged-usr' => sub { push @{ $options->{noop} }, 'merged-usr'; }, 'merged-usr' => sub { push @{ $options->{noop} }, 'merged-usr'; },
'no-merged-usr' => 'no-merged-usr' =>
sub { push @{ $options->{noop} }, 'no-merged-usr'; }, sub { push @{ $options->{noop} }, 'no-merged-usr'; },
'force-check-gpg' => 'force-check-gpg' =>
@ -5201,9 +5201,10 @@ sub main() {
# in unshare and root mode, other users than the current user need to # in unshare and root mode, other users than the current user need to
# access the rootfs, most prominently, the _apt user. Thus, make the # access the rootfs, most prominently, the _apt user. Thus, make the
# temporary directory world readable. # temporary directory world readable.
if (any { $_ eq $options->{mode} } ('unshare', 'root') if (
or any { $_ eq $options->{mode} } ('unshare', 'root')
($EFFECTIVE_USER_ID == 0 and $options->{mode} eq 'chrootless')) { or ($EFFECTIVE_USER_ID == 0 and $options->{mode} eq 'chrootless')
) {
chmod 0755, $options->{root} or error "cannot chmod root: $!"; chmod 0755, $options->{root} or error "cannot chmod root: $!";
} }
} elsif ($format eq 'directory') { } elsif ($format eq 'directory') {