Add.pm (7a5146e9) Add.pm (b6ce8483)
1# ex:ts=8 sw=4:
1# ex:ts=8 sw=4:
2# $OpenBSD: Add.pm,v 1.103 2010/01/03 19:55:35 espie Exp $
2# $OpenBSD: Add.pm,v 1.104 2010/01/14 19:35:55 espie Exp $
3#
4# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
5#
6# Permission to use, copy, modify, and distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 353 unchanged lines hidden (view full) ---

364 my ($self, $state, $pkgname) = @_;
365 my $fname = $state->{destdir}.$self->fullname;
366 # check for collisions with existing stuff
367 if ($state->vstat->exists($fname)) {
368 push(@{$state->{colliding}}, $self);
369 $state->{problems}++;
370 return;
371 }
3#
4# Copyright (c) 2003-2007 Marc Espie <espie@openbsd.org>
5#
6# Permission to use, copy, modify, and distribute this software for any
7# purpose with or without fee is hereby granted, provided that the above
8# copyright notice and this permission notice appear in all copies.
9#
10# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES

--- 353 unchanged lines hidden (view full) ---

364 my ($self, $state, $pkgname) = @_;
365 my $fname = $state->{destdir}.$self->fullname;
366 # check for collisions with existing stuff
367 if ($state->vstat->exists($fname)) {
368 push(@{$state->{colliding}}, $self);
369 $state->{problems}++;
370 return;
371 }
372 my $s = $state->vstat->add($fname, $self->{size}, \$pkgname);
372 my $s = $state->vstat->add($fname, $self->{size}, $pkgname);
373 return unless defined $s;
374 if ($s->ro) {
375 $s->report_ro($state, $fname);
376 }
377 if ($s->avail < 0) {
378 $s->report_overflow($state, $fname);
379 }
380}

--- 104 unchanged lines hidden (view full) ---

485 $state->{problems}++;
486 }
487 my $fname = $state->{destdir}.$self->fullname;
488 # If file already exists, we won't change it
489 if ($state->vstat->exists($fname)) {
490 return;
491 }
492 my $size = $self->{copyfrom}->{size};
373 return unless defined $s;
374 if ($s->ro) {
375 $s->report_ro($state, $fname);
376 }
377 if ($s->avail < 0) {
378 $s->report_overflow($state, $fname);
379 }
380}

--- 104 unchanged lines hidden (view full) ---

485 $state->{problems}++;
486 }
487 my $fname = $state->{destdir}.$self->fullname;
488 # If file already exists, we won't change it
489 if ($state->vstat->exists($fname)) {
490 return;
491 }
492 my $size = $self->{copyfrom}->{size};
493 my $s = $state->vstat->add($fname, $size, \$pkgname);
493 my $s = $state->vstat->add($fname, $size, $pkgname);
494 return unless defined $s;
495 if ($s->ro) {
496 $s->report_ro($state, $fname);
497 }
498 if ($s->avail < 0) {
499 $s->report_overflow($state, $fname);
500 }
501}

--- 167 unchanged lines hidden (view full) ---

669 $size = (stat $cname)[7];
670 }
671 if ($self->exec_on_add) {
672 my $s2 = $state->vstat->stat($cname);
673 if (defined $s2 && $s2->noexec) {
674 $s2->report_noexec($state, $cname);
675 }
676 }
494 return unless defined $s;
495 if ($s->ro) {
496 $s->report_ro($state, $fname);
497 }
498 if ($s->avail < 0) {
499 $s->report_overflow($state, $fname);
500 }
501}

--- 167 unchanged lines hidden (view full) ---

669 $size = (stat $cname)[7];
670 }
671 if ($self->exec_on_add) {
672 my $s2 = $state->vstat->stat($cname);
673 if (defined $s2 && $s2->noexec) {
674 $s2->report_noexec($state, $cname);
675 }
676 }
677 my $s = $state->vstat->add($fname, $self->{size}, \$pkgname);
677 my $s = $state->vstat->add($fname, $self->{size}, $pkgname);
678 return unless defined $s;
679 if ($s->ro) {
680 $s->report_ro($state, $fname);
681 }
682 if ($s->noexec && $self->exec_on_delete) {
683 $s->report_noexec($state, $fname);
684 }
685 if ($s->avail < 0) {

--- 27 unchanged lines hidden ---
678 return unless defined $s;
679 if ($s->ro) {
680 $s->report_ro($state, $fname);
681 }
682 if ($s->noexec && $self->exec_on_delete) {
683 $s->report_noexec($state, $fname);
684 }
685 if ($s->avail < 0) {

--- 27 unchanged lines hidden ---