summaryrefslogtreecommitdiff
path: root/usr
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2010-03-17 22:54:02 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2010-03-17 22:54:02 -0700
commitae5a764ebe9a8e055dd2521c6db43232c3e705f8 (patch)
tree068befaad4755693494f4fdac9195a8163b13150 /usr
parent654a7353e1c46878dd84bfef0e987f0205e03fde (diff)
downloadpiny-code-ae5a764ebe9a8e055dd2521c6db43232c3e705f8.tar.gz
piny-code-ae5a764ebe9a8e055dd2521c6db43232c3e705f8.zip
Remove newlines from fatal errors, so we get useful traces.
Diffstat (limited to 'usr')
-rw-r--r--usr/src/libpiny/Piny/Group.pm10
-rw-r--r--usr/src/libpiny/Piny/Repo.pm12
-rw-r--r--usr/src/libpiny/Piny/User.pm10
3 files changed, 16 insertions, 16 deletions
diff --git a/usr/src/libpiny/Piny/Group.pm b/usr/src/libpiny/Piny/Group.pm
index 8e0c2aa..3181033 100644
--- a/usr/src/libpiny/Piny/Group.pm
+++ b/usr/src/libpiny/Piny/Group.pm
@@ -55,11 +55,11 @@ sub BUILD {
my ( $s ) = @_;
if ( not ( $s->has_gid( ) or $s->has_groupname( ) ) ) {
- die "You must provide either GID or groupname!\n";
+ die "You must provide either GID or groupname!";
};
if ( $s->has_gid( ) and $s->has_groupname( ) ) {
- die "You must not provide both GID and groupname!\n";
+ die "You must not provide both GID and groupname!";
};
};
@@ -80,14 +80,14 @@ sub _build_grent {
if ( $s->has_gid( ) ) {
my @res = getgrgid( $s->gid( ) );
- die "getgrgid( " . $s->gid( ) . " ) failed: $!\n" unless @res;
+ die "getgrgid( " . $s->gid( ) . " ) failed: $!" unless @res;
return \@res;
} elsif ( $s->has_groupname( ) ) {
my @res = getgrnam( $s->groupname( ) );
- die "getgrnam( " . $s->groupname( ) . " ) failed: $!\n" unless @res;
+ die "getgrnam( " . $s->groupname( ) . " ) failed: $!" unless @res;
return \@res;
} else {
- die "Not enough information provided to lookup group!\n";
+ die "Not enough information provided to lookup group!";
};
};
diff --git a/usr/src/libpiny/Piny/Repo.pm b/usr/src/libpiny/Piny/Repo.pm
index 51034dd..b10651f 100644
--- a/usr/src/libpiny/Piny/Repo.pm
+++ b/usr/src/libpiny/Piny/Repo.pm
@@ -66,7 +66,7 @@ sub _rename_repo {
my $olddir = "/srv/git/$old_name.git";
my $newdir = "/srv/git/$new_name.git";
- rename( $olddir, $newdir ) or die "Couldn't rename $olddir to $newdir: $!\n";
+ rename( $olddir, $newdir ) or die "Couldn't rename $olddir to $newdir: $!";
$s->clear_path( );
};
@@ -76,9 +76,9 @@ sub _set_description {
return unless defined $old_description;
- open( my $fd, ">", $s->path( ) . "/description" ) or die "Unable to open " . $s->path( ) . "/description for writing: $!\n";
+ open( my $fd, ">", $s->path( ) . "/description" ) or die "Unable to open " . $s->path( ) . "/description for writing: $!";
print $fd $new_description;
- close( $fd ) or die "Error when closing " . $s->path( ) . "/description: $!\n";
+ close( $fd ) or die "Error when closing " . $s->path( ) . "/description: $!";
};
# Builder methods
@@ -102,14 +102,14 @@ sub _build_path {
if ( -d $dir ) {
return $dir;
} else {
- die "Expected repo $dir does not exist!\n";
+ die "Expected repo $dir does not exist!";
};
};
sub _build_description {
my ( $s ) = @_;
- open( my $d, "<", $s->path( ) . "/description" ) or die "Unable to open " . $s->path( ) . "/description: $!\n";
+ open( my $d, "<", $s->path( ) . "/description" ) or die "Unable to open " . $s->path( ) . "/description: $!";
my $desc;
{
local $/ = undef;
@@ -124,7 +124,7 @@ sub _build_repostat {
my ( $s ) = @_;
my @res = stat( $s->path( ) );
- die "stat( " . $s->path( ) . " ) failed: $!\n" unless @res;
+ die "stat( " . $s->path( ) . " ) failed: $!" unless @res;
return \@res;
};
diff --git a/usr/src/libpiny/Piny/User.pm b/usr/src/libpiny/Piny/User.pm
index bba859f..66757dc 100644
--- a/usr/src/libpiny/Piny/User.pm
+++ b/usr/src/libpiny/Piny/User.pm
@@ -70,11 +70,11 @@ sub BUILD {
my ( $s ) = @_;
if ( not ( $s->has_uid( ) or $s->has_username( ) ) ) {
- die "You must provide either UID or username!\n";
+ die "You must provide either UID or username!";
};
if ( $s->has_uid( ) and $s->has_username( ) ) {
- die "You must not provide both UID and username!\n";
+ die "You must not provide both UID and username!";
};
};
@@ -95,14 +95,14 @@ sub _build_pwent {
if ( $s->has_uid( ) ) {
my @res = getpwuid( $s->uid( ) );
- die "getpwuid( " . $s->uid( ) . " ) failed: $!\n" unless @res;
+ die "getpwuid( " . $s->uid( ) . " ) failed: $!" unless @res;
return \@res;
} elsif ( $s->has_username( ) ) {
my @res = getpwnam( $s->username( ) );
- die "getpwnam( " . $s->username( ) . " ) failed: $!\n" unless @res;
+ die "getpwnam( " . $s->username( ) . " ) failed: $!" unless @res;
return \@res;
} else {
- die "Not enough information provided to lookup user!\n";
+ die "Not enough information provided to lookup user!";
};
};