コンテンツにスキップ

OsiriX オンライン解説文書/OsiriXディベロッパー getosirixCVS.plを利用する

出典: フリー教科書『ウィキブックス(Wikibooks)』

< | ^

私は getosirixCVS.pl というperl スクリプトを作成しました (正確にはbibdesk website からの改変) 。これをダウンロードします。開発用のディレクトリに保存するのが良いでしょう。私の場合はUsers/jefferis/dev です。ターミナルを開いて、次のように入力します。:

gjg5:~/dev jefferis$ perl getosirixCVS.pl

匿名ユーザでのログインでは以下のようになります。:

*******************************
Welcome to osirix development.
This script will get the stuff you need from cvs to build osirix.
Developers should set SF_USERNAME to use ssh access
Are you a developer using ssh access (y/n)? "n"
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/osirix login

Password is empty--just hit return when asked for a password
Executing: cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/osirix login
(Logging in to anonymous@cvs.sourceforge.net)
CVS password:  "Press return"
Do you want a specific tag? (empty for none or enter tag(eg TRY_RTF_041503)  "Press return"
Executing: cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/osirix co  osirix
cvs checkout: Updating osirix
U osirix/AdvancedQuerySubview.h
U osirix/AdvancedQuerySubview.m
U osirix/Analyze.h
... 
U osirix/pixelmed/DICOMPersonNameAttribute.xcode/lpysher.pbxuser 
U osirix/pixelmed/DICOMPersonNameAttribute.xcode/project.pbxproj

****************************
getosirixCVS done.You will have to expand zip files as follows: 
find osirix -iname "*.zip" -execdir unzip {} ";"
After that open osirix/OsiriX.pbproj/ and commence the build.
1) compile DCM.framework target FIRST. This will create the OsiriX.framework for OsiriXBurner application
2) compile 'OsirixBurner.xcode' file
3) compile all the PreferencePanes projects located in the 'Preference Panes' folder
4) compile 'Osirix.pbproj' file with OsiriX target

開発者として登録したユーザ名でのログインでは以下のようになります。:

*******************************
Welcome to osirix development.
This script will get the stuff you need from cvs to build osirix. 
Developers should set SF_USERNAME to use ssh access 
Are you a developer using ssh access (y/n)? y
What is your sourceforge username (setenv SF_USERNAME for a default)?  jefferis
Do you want a specific tag? (empty for none or enter tag(eg TRY_RTF_041503) "Press return for HEAD"
Executing: cvs -z3 -d:ext:jefferis@cvs.sourceforge.net:/cvsroot/osirix co  osirix
The authenticity of host 'cvs.sourceforge.net (66.35.250.207)' can't be established. 
DSA key fingerprint is 02:ab:7c:aa:49:ed:0b:a8:50:13:10:c2:3e:92:0f:42.
Are you sure you want to continue connecting (yes/no)? yes 
Warning: Permanently added 'cvs.sourceforge.net,66.35.250.207' (DSA) to the list of known hosts.
jefferis@cvs.sourceforge.net's password:
cvs checkout: Updating osirix
U osirix/AdvancedQuerySubview.h
U osirix/AdvancedQuerySubview.m
...

はい、この通り!。

以下がperlスクリプトです。これをgetosirixCVS.plというファイル名で保存します。ターミナルで利用してください。:

#!/usr/bin/perl -w
#
# This script was written for fetching the BibDesk CVS tree
# I basically just did a search and replace for osirix
# Greg Jefferis 21 May 2004

print "\n*******************************\n";
print "Welcome to osirix development.\n";
print "This script will get the stuff you need from cvs to build osirix.\n";
print "Developers should set SF_USERNAME to use ssh access\n";

$SFNAME=getSFName();

if ($SFNAME ne "") {
	prepdev();
} else {
	prepanon();
} 
$bibtag=gettag();

getsources();

print "\n****************************\n";                     
print "getosirixCVS done.";
print "You will have to expand zip files as follows:\n";
print "find osirix -iname \"*.zip\" -execdir unzip {} \";\"\n";
print "After that open osirix/OsiriX.pbproj/ and commence the build.\n";
print << "EOF";
1) compile DCM.framework target FIRST. This will create the OsiriX.framework for OsiriXBurner application
2) compile 'OsirixBurner.xcode' file
3) compile all the PreferencePanes projects located in the 'Preference Panes' folder
4) compile 'Osirix.pbproj' file with OsiriX target
EOF

sub getSFName {
  if (defined $ENV{'SF_USERNAME'} ) { 
	return $ENV{'SF_USERNAME'};
  } else {
	  print "Are you a developer using ssh access (y/n)? ";
	  $DEV = <STDIN>;
	  if ( $DEV =~ /^n/ ) {
	  return "";
	  } else {
		 print "What is your sourceforge username (setenv SF_USERNAME for a default)?  ";
		 $SFNAME = <STDIN>;
	 chomp($SFNAME);
		 return $SFNAME;
	  }
  }
}


# Set the BIB tag
sub gettag {
 if (defined $ENV{'SF_BIB_TAG'} ) {
   $bibtag = $ENV{'SF_BIB_TAG'};
 } else {
   print "Do you want a specific tag? (empty for none or enter tag(eg TRY_RTF_041503) ";
   $bibtag = <STDIN>;
 }
 chomp($bibtag);
 if ($bibtag eq "") {
   return $bibtag;
 } else {
   return "-r $bibtag";
 }
}

sub prepanon {
  $CVS_METHOD = "pserver";
  $SFNAME = "anonymous";
  $LOGIN = "cvs -z3 -d:$CVS_METHOD:$SFNAME\@cvs.sourceforge.net:/cvsroot/osirix login";
  print "$LOGIN\n";
  print "\nPassword is empty--just hit return when asked for a password\n";
  tryGet($LOGIN);
}

sub prepdev {
  $ENV{'CVS_RSH'} = 'ssh';
  $CVS_METHOD = "ext";
}

sub getsources {
   $GETMAIN = "cvs -z3 -d:$CVS_METHOD:$SFNAME\@cvs.sourceforge.net:/cvsroot/osirix co $bibtag osirix";
   tryGet($GETMAIN);

   # not relevant for osirix
   #$GETVENDOR = "cvs -z3 -d:$CVS_METHOD:$SFNAME\@cvs.sourceforge.net:/cvsroot/osirix co osirix_vendorsrc";
   #tryGet($GETVENDOR);

}

sub tryGet {
  $toGet = shift;

  print "Executing: $toGet\n";
	   
  if ( (system $toGet) != 0) { #return of 0 indicates success
	 print "cvs failed.  Check messages above. Should I try again? (y/n)?";
	 undef $tryAgain;
	 $tryAgain = <STDIN>;
	   
	 if ($tryAgain =~  /^y/) {
	   getsources();
	 } else {
	  print "cvs failed.  Please read messages above and";
	  print " try again in a few moments\n";
	  exit;
	 }
  } 
}