Date: Thu, 16 Jun 2005 04:50:18 GMT From: Jim Pirzyk <jim@pirzyk.org> To: freebsd-ports-bugs@FreeBSD.org Subject: Re: ports/82289: New Port: sysutils/p5-Sys-Mknod cpan perl module Sys::Mknod Message-ID: <200506160450.j5G4oIGW074191@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/82289; it has been noted by GNATS. From: Jim Pirzyk <jim@pirzyk.org> To: pirzyk@freebsd.org, bug-followup@freebsd.org Cc: Subject: Re: ports/82289: New Port: sysutils/p5-Sys-Mknod cpan perl module Sys::Mknod Date: Wed, 15 Jun 2005 23:42:33 -0500 I should have 'make test' before I submitted the port. There should be a dependency on File::Stat::Bits as well listed in the Makefile: BUILD_DEPENDS= ${SITE_PERL}/File/Stat/Bits.pm:${PORTSDIR}/sysutils/p5-File-Stat-Bits RUN_DEPENDS= ${BUILD_DEPENDS} Here is a patch to allow 'make test' to work: --- ./Mknod.pm.orig Wed Jun 15 23:30:29 2005 +++ ./Mknod.pm Wed Jun 15 23:33:21 2005 @@ -48,11 +48,11 @@ # obliviates the beneifit of avoiding a system(). See if I care. { local $^W = 0; -require "sys/sysmacros.ph"; require "sys/types.ph"; require "sys/syscall.ph"; } use Fcntl qw(S_IFCHR S_IFIFO S_IFBLK); +use File::Stat::Bits qw(dev_join); # I'm exporting all these functions for DWIM's sake. our @EXPORT = qw(mknod mkfifo); @@ -70,15 +70,13 @@ $mode |= S_IFBLK; } elsif ($type =~ m/^c/i) { $mode |= S_IFCHR; - } elsif ($type =~ m/^f/i) { - $mode |= S_IFIFO; } else { croak ("Invalid special file type `$type'"); } my $return = syscall( &SYS_mknod, $filename, $mode, ( defined $major - ? makedev($major, $minor) + ? dev_join($major, $minor) : 0 ) ); if ($return < 0) { die $!; @@ -90,13 +88,20 @@ sub mkfifo($;$) { my ($filename, $mode) = (@_); - mknod($filename, "fifo", undef, undef, $mode); + $mode = 0666 unless defined $mode; + + my $return = syscall( &SYS_mkfifo, $filename, $mode); + if ($return < 0) { + die $!; + } else { + return 1; + } } sub make_dev($$) { my ($major, $minor) = (@_); - return makedev($major, $minor); + return dev_join($major, $minor); } 1; --- ./Makefile.PL.orig Wed Jun 15 23:32:35 2005 +++ ./Makefile.PL Wed Jun 15 23:32:12 2005 @@ -4,7 +4,7 @@ WriteMakefile( 'NAME' => 'Sys::Mknod', 'VERSION_FROM' => 'Mknod.pm', # finds $VERSION - 'PREREQ_PM' => {}, # e.g., Module::Name => 1.1 + 'PREREQ_PM' => { File::Stat::Bits }, # e.g., Module::Name => 1.1 ($] >= 5.005 ? ## Add these new keywords supported since 5.005 (ABSTRACT_FROM => 'Mknod.pm', # retrieve abstract from module AUTHOR => 'Sam Vilain <sam@vilain.net>') : ()), --- @(#) $Id: dot.signature,v 1.14 2004/02/03 02:46:26 pirzyk Exp $ __o pirzyk@uiuc.edu --------------------------- jim@pirzyk.org _'\<,_ Systems Management Group, CITES (*)/ (*) University of Illinois at Urbana-Champaign
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200506160450.j5G4oIGW074191>