Hi,

please find attached patch. It make it possible to define a server tcp port.

Comments are welcome.

Cu, Maik
diff -ru ARSperl-1.85/ARSOOsup.pm ARSperl-new/ARSOOsup.pm
--- ARSperl-1.85/ARSOOsup.pm	2001-10-22 07:59:25.000000000 +0200
+++ ARSperl-new/ARSOOsup.pm	2005-12-14 16:39:19.000000000 +0100
@@ -24,8 +24,8 @@
   my ($class, @p) = (shift, @_);
   my ($self) = {};
   my ($blessed) = bless($self, $class);
-  my ($server, $username, $password, $catch, $ctrl, $dbg) = 
-    rearrange([SERVER,USERNAME,PASSWORD,CATCH,CTRL,DEBUG],@p);
+  my ($server, $username, $password, $tcpport, $catch, $ctrl, $dbg) = 
+    rearrange([SERVER,USERNAME,PASSWORD, TCPPORT, CATCH,CTRL,DEBUG],@p);
   # should the OO layer emit debugging information?
 
   $self->{'.debug'} = 0;
@@ -69,9 +69,9 @@
       $self->{'ctrl'} = $ctrl;
       $self->{'.nologoff'} = 1;
   } else {
-      print "new connection object: ($server, $username, $password)\n" 
+      print "new connection object: ($server, $username, $password, $tcpport)\n" 
 	  if $self->{'.debug'};
-      $self->{'ctrl'} = ars_Login($server, $username, $password);
+      $self->{'ctrl'} = ars_Login($server, $username, $password, undef, undef, $tcpport);
       $self->{'.nologoff'} = 0;
       $self->tryCatch();
   }
diff -ru ARSperl-1.85/Makefile.PL ARSperl-new/Makefile.PL
--- ARSperl-1.85/Makefile.PL	2005-09-19 16:40:30.000000000 +0200
+++ ARSperl-new/Makefile.PL	2005-12-14 15:55:32.000000000 +0100
@@ -25,7 +25,7 @@
 
 # STEP 1 -> Set the path to your ARS API directory
 
-$ARSAPI     = "/usr/ar/api";
+$ARSAPI     = "/usr/local/ars/api";
 #$ARSAPI     = "/u1/project/ARSperl/api/sol2/api6.0.1";
 #$ARSAPI     = "/u1/project/ARSperl/api/linux/4.5";
 #$ARSAPI     = "/u1/project/ARSperl/api/linux/4.0";
@@ -698,12 +698,13 @@
 }
 
 sub makeTestConfig {
-	my ($SERVER, $USERNAME, $PASSWORD);
-	my ($S, $U, $P) = ("", "", "");
+	my ($SERVER, $TCPPORT, $USERNAME, $PASSWORD);
+	my ($S, $TP, $U, $P) = ("", "", "", "");
 
 	if(-e "./t/config.cache") {
 		do './t/config.cache';
 		$S = &CCACHE::SERVER;
+		$TP = &CCACHE::TCPPORT;
 		$U = &CCACHE::USERNAME;
 		$P = &CCACHE::PASSWORD;
 	}
@@ -728,6 +729,12 @@
 		$SERVER = $S if ($S ne "");
 	} 
 
+	print "Server TCP port [$TP]: ";
+	chomp($TCPPORT = <STDIN>);
+	if ($TCPPORT eq "") {
+		$TCPPORT = $TP if ($TP ne "");
+	}
+
 	print "Admin Username [$U]: ";
 	chomp($USERNAME = <STDIN>);
         if($USERNAME eq "") {
@@ -745,6 +752,7 @@
 	print FD "package CCACHE;\n";
 	print FD "\# enter your server, admin username and password below.\n\n";
 	print FD "sub SERVER { \"$SERVER\" ; }\n";
+	print FD "sub TCPPORT { \"$TCPPORT\" ; }\n";
 	print FD "sub USERNAME { \"$USERNAME\" ; }\n";
 	print FD "sub PASSWORD { \"$PASSWORD\" ; }\n";
 	print FD "1;\n";
diff -ru ARSperl-1.85/t/00connect.t ARSperl-new/t/00connect.t
--- ARSperl-1.85/t/00connect.t	2005-03-10 03:11:21.000000000 +0100
+++ ARSperl-new/t/00connect.t	2005-12-14 13:54:03.000000000 +0100
@@ -20,7 +20,8 @@
 
 my($ctrl) = ars_Login(&CCACHE::SERVER, 
 		      &CCACHE::USERNAME, 
- 		      &CCACHE::PASSWORD);
+ 		      &CCACHE::PASSWORD,
+			  undef,undef,&CCACHE::TCPPORT);
 
 if(!defined($ctrl)) {
   print "not ok [1 $ars_errstr]\n";
@@ -32,7 +33,8 @@
 {
   my ($c2) = ars_Login (&CCACHE::SERVER, 
 			&CCACHE::USERNAME, 
-			&CCACHE::PASSWORD);
+			&CCACHE::PASSWORD,
+			undef,undef,&CCACHE::TCPPORT);
 
   if (!defined($c2)) {
     print "not ok [2 $ars_errstr]\n";
@@ -53,6 +55,7 @@
 my $c = new ARS(-server => &CCACHE::SERVER, 
                 -username => &CCACHE::USERNAME,
 		-password => &CCACHE::PASSWORD,
+		-tcpport => &CCACHE::TCPPORT,
 		-catch => { ARS::AR_RETURN_ERROR => undef,
 			    ARS::AR_RETURN_WARNING => undef,
 			    ARS::AR_RETURN_FATAL => undef
diff -ru ARSperl-1.85/t/01import.t ARSperl-new/t/01import.t
--- ARSperl-1.85/t/01import.t	2003-04-02 07:56:18.000000000 +0200
+++ ARSperl-new/t/01import.t	2005-12-14 13:54:03.000000000 +0100
@@ -9,7 +9,8 @@
 
 print "1..1\n";
 
-my($ctrl) = ars_Login(&CCACHE::SERVER, &CCACHE::USERNAME, &CCACHE::PASSWORD);
+my($ctrl) = ars_Login(&CCACHE::SERVER, &CCACHE::USERNAME, &CCACHE::PASSWORD,
+				undef, undef, &CCACHE::TCPPORT);
 if(!defined($ctrl)) {
   print "not ok (login $ars_errstr)\n";
   exit 0;
diff -ru ARSperl-1.85/t/02export.t ARSperl-new/t/02export.t
--- ARSperl-1.85/t/02export.t	2005-09-07 14:42:12.000000000 +0200
+++ ARSperl-new/t/02export.t	2005-12-14 15:55:34.000000000 +0100
@@ -5,7 +5,8 @@
 
 print "1..8\n";
 
-my($ctrl) = ars_Login(&CCACHE::SERVER, &CCACHE::USERNAME, &CCACHE::PASSWORD);
+my($ctrl) = ars_Login(&CCACHE::SERVER, &CCACHE::USERNAME, &CCACHE::PASSWORD,
+				undef, undef, &CCACHE::TCPPORT);
 if(!defined($ctrl)) {
   print "not ok (login $ars_errstr)\n";
   exit 0;
diff -ru ARSperl-1.85/t/09qualifier.t ARSperl-new/t/09qualifier.t
--- ARSperl-1.85/t/09qualifier.t	2003-04-02 03:43:35.000000000 +0200
+++ ARSperl-new/t/09qualifier.t	2005-12-14 13:54:04.000000000 +0100
@@ -19,7 +19,8 @@
 
 my($ctrl) = ars_Login(&CCACHE::SERVER, 
 		      &CCACHE::USERNAME, 
- 		      &CCACHE::PASSWORD);
+ 		      &CCACHE::PASSWORD,
+			  undef, undef, &CCACHE::TCPPORT);
 
 if(!defined($ctrl)) {
   print "not ok [1]\n";
diff -ru ARSperl-1.85/t/10alink.t ARSperl-new/t/10alink.t
--- ARSperl-1.85/t/10alink.t	2003-04-02 07:27:46.000000000 +0200
+++ ARSperl-new/t/10alink.t	2005-12-14 13:54:04.000000000 +0100
@@ -8,7 +8,8 @@
 
 my $c = ars_Login(&CCACHE::SERVER, 
 		  &CCACHE::USERNAME,
-                  &CCACHE::PASSWORD);
+                  &CCACHE::PASSWORD,
+				  undef, undef, &CCACHE::TCPPORT);
 
 if (defined($c)) {
 	print "ok [1] (login)\n";
diff -ru ARSperl-1.85/t/10entry.t ARSperl-new/t/10entry.t
--- ARSperl-1.85/t/10entry.t	2005-09-07 14:42:12.000000000 +0200
+++ ARSperl-new/t/10entry.t	2005-12-14 15:55:34.000000000 +0100
@@ -23,6 +23,7 @@
 my $c = new ARS(-server => &CCACHE::SERVER, 
 		-username => &CCACHE::USERNAME,
                 -password => &CCACHE::PASSWORD,
+				-tcpport => &CCACHE::TCPPORT,
                 -catch => { ARS::AR_RETURN_ERROR => "main::mycatch",
                             ARS::AR_RETURN_WARNING => "main::mycatch",
                             ARS::AR_RETURN_FATAL => "main::mycatch"
diff -ru ARSperl-1.85/t/10getescalation.t ARSperl-new/t/10getescalation.t
--- ARSperl-1.85/t/10getescalation.t	2003-04-02 07:27:46.000000000 +0200
+++ ARSperl-new/t/10getescalation.t	2005-12-14 13:54:04.000000000 +0100
@@ -8,7 +8,8 @@
 
 my $c = ars_Login(&CCACHE::SERVER, 
 		  &CCACHE::USERNAME,
-                  &CCACHE::PASSWORD);
+                  &CCACHE::PASSWORD,
+				  undef, undef, &CCACHE::TCPPORT);
 
 if (defined($c)) {
 	print "ok [1] (login)\n";
diff -ru ARSperl-1.85/t/10getftinfo.t ARSperl-new/t/10getftinfo.t
--- ARSperl-1.85/t/10getftinfo.t	2003-04-02 07:27:46.000000000 +0200
+++ ARSperl-new/t/10getftinfo.t	2005-12-14 13:54:05.000000000 +0100
@@ -8,7 +8,8 @@
 
 my $c = ars_Login(&CCACHE::SERVER, 
 		  &CCACHE::USERNAME,
-                  &CCACHE::PASSWORD);
+                  &CCACHE::PASSWORD,
+				  undef, undef, &CCACHE::TCPPORT);
 
 if (defined($c)) {
 	print "ok [1] (login)\n";
diff -ru ARSperl-1.85/t/10getlist.t ARSperl-new/t/10getlist.t
--- ARSperl-1.85/t/10getlist.t	2003-04-02 07:56:18.000000000 +0200
+++ ARSperl-new/t/10getlist.t	2005-12-14 13:54:05.000000000 +0100
@@ -8,7 +8,8 @@
 
 my $c = ars_Login(&CCACHE::SERVER, 
 		  &CCACHE::USERNAME,
-                  &CCACHE::PASSWORD);
+                  &CCACHE::PASSWORD,
+				  undef, undef, &CCACHE::TCPPORT);
 
 ok(defined($c), "login") || diag "login: $ars_errstr";
 
diff -ru ARSperl-1.85/t/11entry.t ARSperl-new/t/11entry.t
--- ARSperl-1.85/t/11entry.t	2001-10-30 17:50:16.000000000 +0100
+++ ARSperl-new/t/11entry.t	2005-12-14 13:54:05.000000000 +0100
@@ -29,6 +29,7 @@
 my $c = new ARS(-server => &CCACHE::SERVER, 
 		-username => &CCACHE::USERNAME,
                 -password => &CCACHE::PASSWORD,
+				-tcpport => &CCACHE::TCPPORT,
                 -catch => { ARS::AR_RETURN_ERROR => "main::mycatch",
                             ARS::AR_RETURN_WARNING => "main::mycatch",
                             ARS::AR_RETURN_FATAL => "main::mycatch"
diff -ru ARSperl-1.85/t/12lotsoffields.t ARSperl-new/t/12lotsoffields.t
--- ARSperl-1.85/t/12lotsoffields.t	2003-04-02 07:56:18.000000000 +0200
+++ ARSperl-new/t/12lotsoffields.t	2005-12-14 13:54:05.000000000 +0100
@@ -12,7 +12,8 @@
 
 my($ctrl) = ars_Login(&CCACHE::SERVER, 
 		      &CCACHE::USERNAME, 
- 		      &CCACHE::PASSWORD);
+ 		      &CCACHE::PASSWORD,
+			  undef, undef, &CCACHE::TCPPORT);
 
 if(!defined($ctrl)) {
 	print "not ok [", $TN++, "]\n";
diff -ru ARSperl-1.85/t/13join.t ARSperl-new/t/13join.t
--- ARSperl-1.85/t/13join.t	2005-09-07 14:42:12.000000000 +0200
+++ ARSperl-new/t/13join.t	2005-12-14 15:55:35.000000000 +0100
@@ -11,7 +11,8 @@
 
 my($ctrl) = ars_Login(&CCACHE::SERVER, 
 		      &CCACHE::USERNAME, 
- 		      &CCACHE::PASSWORD);
+ 		      &CCACHE::PASSWORD,
+			  undef, undef, &CCACHE::TCPPORT);
 
 if(!defined($ctrl)) {
 	print "not ok [", $TN++, "]\n";
diff -ru ARSperl-1.85/t/20merge.t ARSperl-new/t/20merge.t
--- ARSperl-1.85/t/20merge.t	2003-03-27 18:58:42.000000000 +0100
+++ ARSperl-new/t/20merge.t	2005-12-14 13:54:06.000000000 +0100
@@ -8,7 +8,8 @@
 
 my $c = ars_Login(&CCACHE::SERVER, 
 		  &CCACHE::USERNAME, 
-		  &CCACHE::PASSWORD);
+		  &CCACHE::PASSWORD,
+		  undef, undef, &CCACHE::TCPPORT);
 
 if(!defined($c)) {
 	for(my $i = 1 ; $i <= $maxtest ; $i++) {
diff -ru ARSperl-1.85/t/21setlogging.t ARSperl-new/t/21setlogging.t
--- ARSperl-1.85/t/21setlogging.t	2005-09-05 23:14:47.000000000 +0200
+++ ARSperl-new/t/21setlogging.t	2005-12-14 16:13:41.000000000 +0100
@@ -9,7 +9,8 @@
 
 print "1..$maxtest\n";
 
-my $ctrl = ars_Login( &CCACHE::SERVER, &CCACHE::USERNAME, &CCACHE::PASSWORD );
+my $ctrl = ars_Login( &CCACHE::SERVER, &CCACHE::USERNAME, &CCACHE::PASSWORD,
+			   undef, undef, &CCACHE::TCPPORT );
 
 if(!defined($ctrl)) {
 	for(my $i = $c ; $i <= $maxtest ; $i++) {
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Arsperl-users mailing list
Arsperl-users@arsperl.org
https://lists.sourceforge.net/lists/listinfo/arsperl-users

Reply via email to