mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-23 04:23:08 +00:00
Add p5-Class-DBI-Loader-Relationship 1.2, easier relationship
specification in CDBI::L. This module acts as a mix-in, adding the relationship method to Class::DBI::Loader. Since Class::DBI::Loader knows how to map between table names and class names, there ought to be no need to replicate the names. In addition, it is common (but not universal) to want reverse relationships defined for has-many relationships, and for has-a relationships to be defined for the linkages surrounding a many-to-many table. WWW: http://search.cpan.org/dist/Class-DBI-Loader-Relationship/ PR: ports/65176 Submitted by: Lars Thegler <lars@thegler.dk>
This commit is contained in:
parent
41794386b0
commit
602bdb5436
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=106499
@ -116,6 +116,7 @@
|
||||
SUBDIR += p5-Class-DBI-BaseDSN
|
||||
SUBDIR += p5-Class-DBI-FromCGI
|
||||
SUBDIR += p5-Class-DBI-Loader
|
||||
SUBDIR += p5-Class-DBI-Loader-Relationship
|
||||
SUBDIR += p5-Class-DBI-Oracle
|
||||
SUBDIR += p5-Class-DBI-Pager
|
||||
SUBDIR += p5-Class-DBI-Pg
|
||||
|
34
databases/p5-Class-DBI-Loader-Relationship/Makefile
Normal file
34
databases/p5-Class-DBI-Loader-Relationship/Makefile
Normal file
@ -0,0 +1,34 @@
|
||||
# New ports collection makefile for: p5-Class-DBI-Loader-Relationship
|
||||
# Date created: Apr 4 2004
|
||||
# Whom: Lars Thegler <lars@thegler.dk>
|
||||
#
|
||||
# $FreeBSD$
|
||||
|
||||
PORTNAME= Class-DBI-Loader-Relationship
|
||||
PORTVERSION= 1.2
|
||||
CATEGORIES= databases perl5
|
||||
MASTER_SITES= ${MASTER_SITE_PERL_CPAN}
|
||||
MASTER_SITE_SUBDIR= Class
|
||||
PKGNAMEPREFIX= p5-
|
||||
|
||||
MAINTAINER= lars@thegler.dk
|
||||
COMMENT= Easier relationship specification in CDBI::L
|
||||
|
||||
BUILD_DEPENDS= ${SITE_PERL}/Class/DBI/Loader.pm:${PORTSDIR}/databases/p5-Class-DBI-Loader \
|
||||
${SITE_PERL}/Lingua/EN/Inflect/Number.pm:${PORTSDIR}/textproc/p5-Lingua-EN-Inflect-Number
|
||||
RUN_DEPENDS= ${BUILD_DEPENDS}
|
||||
|
||||
PERL_CONFIGURE= yes
|
||||
|
||||
MAN3= Class::DBI::Loader::Relationship.3
|
||||
|
||||
.include <bsd.port.pre.mk>
|
||||
|
||||
.if ${PERL_LEVEL} < 500600
|
||||
EXTRA_PATCHES= ${PATCHDIR}/500503-Relationship.pm
|
||||
|
||||
post-configure:
|
||||
${PERL} -pi -e 's,/usr/local/,\$$(PREFIX)/,g' ${WRKSRC}/Makefile
|
||||
.endif
|
||||
|
||||
.include <bsd.port.post.mk>
|
2
databases/p5-Class-DBI-Loader-Relationship/distinfo
Normal file
2
databases/p5-Class-DBI-Loader-Relationship/distinfo
Normal file
@ -0,0 +1,2 @@
|
||||
MD5 (Class-DBI-Loader-Relationship-1.2.tar.gz) = d5a3262146ee4c63a46a5c87205c5619
|
||||
SIZE (Class-DBI-Loader-Relationship-1.2.tar.gz) = 3109
|
@ -0,0 +1,33 @@
|
||||
--- Relationship.pm.orig Mon Mar 1 16:48:45 2004
|
||||
+++ Relationship.pm Sun Apr 4 22:30:41 2004
|
||||
@@ -1,9 +1,8 @@
|
||||
package Class::DBI::Loader::Relationship;
|
||||
-use 5.006;
|
||||
use strict;
|
||||
-use warnings;
|
||||
-our $VERSION = '1.2';
|
||||
-our $DEBUG = 0;
|
||||
+use vars qw($VERSION $DEBUG);
|
||||
+$VERSION = '1.2';
|
||||
+$DEBUG = 0;
|
||||
|
||||
1;
|
||||
|
||||
@@ -82,7 +81,7 @@
|
||||
"$via_c->has_a(".to_S($to)." => $to_c)\n".
|
||||
"$from_c->$method($mapper => [ $via_c => ".to_S($to)." ])\n".
|
||||
"$to_c->has_many(".to_PL($from)." => [ $via_c => ".to_S($from)." ])\n"
|
||||
- if $DEBUG;
|
||||
+ if $Class::DBI::Loader::Relationship::DEBUG;
|
||||
|
||||
$via_c->has_a(to_S($from) => $from_c);
|
||||
$via_c->has_a(to_S($to) => $to_c);
|
||||
@@ -92,7 +91,7 @@
|
||||
}
|
||||
return "$from_c->$method($mapper => $to_c);\n".
|
||||
($method ne "has_a" && "$to_c->has_a(".to_S($from)." => $from_c);\n")
|
||||
- if $DEBUG;
|
||||
+ if $Class::DBI::Loader::Relationship::DEBUG;
|
||||
$from_c->$method($mapper => $to_c);
|
||||
$to_c->has_a(to_S($from) => $from_c) unless $method eq "has_a";
|
||||
}
|
9
databases/p5-Class-DBI-Loader-Relationship/pkg-descr
Normal file
9
databases/p5-Class-DBI-Loader-Relationship/pkg-descr
Normal file
@ -0,0 +1,9 @@
|
||||
This module acts as a mix-in, adding the relationship method to
|
||||
Class::DBI::Loader. Since Class::DBI::Loader knows how to map between
|
||||
table names and class names, there ought to be no need to replicate
|
||||
the names. In addition, it is common (but not universal) to want
|
||||
reverse relationships defined for has-many relationships, and for
|
||||
has-a relationships to be defined for the linkages surrounding a
|
||||
many-to-many table.
|
||||
|
||||
WWW: http://search.cpan.org/dist/Class-DBI-Loader-Relationship/
|
9
databases/p5-Class-DBI-Loader-Relationship/pkg-plist
Normal file
9
databases/p5-Class-DBI-Loader-Relationship/pkg-plist
Normal file
@ -0,0 +1,9 @@
|
||||
%%SITE_PERL%%/Class/DBI/Loader/Relationship.pm
|
||||
%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI/Loader/Relationship/.packlist
|
||||
@dirrm %%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI/Loader/Relationship
|
||||
@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI/Loader 2>/dev/null || true
|
||||
@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class/DBI 2>/dev/null || true
|
||||
@unexec rmdir %D/%%SITE_PERL%%/%%PERL_ARCH%%/auto/Class 2>/dev/null || true
|
||||
@unexec rmdir %D/%%SITE_PERL%%/Class/DBI/Loader 2>/dev/null || true
|
||||
@unexec rmdir %D/%%SITE_PERL%%/Class/DBI 2>/dev/null || true
|
||||
@unexec rmdir %D/%%SITE_PERL%%/Class 2>/dev/null || true
|
Loading…
Reference in New Issue
Block a user