跳轉至內容

線上 OsiriX 文件/使用 getosirixCVS.pl

來自 WikiBooks,面向開放世界的開放書籍

< | ^

我編寫了一個 perl 指令碼(或者更準確地說,從 BibDesk 網站摘取而來)來獲取名為 getosirixCVS.pl 的 Osirix 原始碼。將此指令碼下載到您的計算機上。最簡單的方法可能是將其儲存到您的開發目錄。我的目錄是 /Users/jefferis/dev。轉到終端並按如下所示執行

gjg5:~/dev jefferis$ perl getosirixCVS.pl

回答問題,如果您使用匿名 cvs,您會得到一個類似這樣的響應

*******************************
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。如果您有選擇,請確保使用 Unix 換行符,否則 perl 會出現錯誤提示。

#!/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;
	 }
  } 
}

--Jefferis 02:17,15 Jan 2005 (UTC)

華夏公益教科書