wolfgangw / digital_cinema_tools

Collection of useful scripts and notes for an open source based digital cinema pipeline
https://github.com/wolfgangw/digital_cinema_tools/wiki
95 stars 41 forks source link

cinemaslides: problem with empty CINEMASLIDESDIR environment variable #6

Closed andrae-steiner closed 13 years ago

andrae-steiner commented 13 years ago

I got the following problem with your latst cinemaslides:

linux-opensuse11-3:/home/home-10.1/Documents/Programmkino/DCP-TEST # ../rubyscripts/cinemaslides-2011-06-07.rb -v debug -t dcp -o ${OUT} --keep -x cut,1 -j $ENCODER   Testpictures/IMG_1512.tiff 
* cinemaslides-2011-06-07.rb v0.2011.06.07                        
* cinemaslides-2011-06-07.rb -v debug -t dcp -o Andrae-Test-1920x1080-kakadu --keep -x cut,1 -j kakadu Testpictures/IMG_1512.tiff                        
../rubyscripts/cinemaslides-2011-06-07.rb:1505:in `expand_path': can't convert nil into String (TypeError)
        from ../rubyscripts/cinemaslides-2011-06-07.rb:1505
linux-opensuse11-3:/home/home-10.1/Documents/Programmkino/DCP-TEST # 

The following patch helps:

 2011-06-07.rb /home/home-10.1/Documents/Programmkino/rubyscripts/cinemaslides-2011-06-07-new.rb
--- /home/home-10.1/Documents/Programmkino/rubyscripts/cinemaslides-2011-06-07.rb       2011-06-08 14:22:49.000000000 +0200
+++ /home/home-10.1/Documents/Programmkino/rubyscripts/cinemaslides-2011-06-07-new.rb   2011-06-08 18:02:44.000000000 +0200
@@ -1502,13 +1502,13 @@
 @logger.debug( commandline )

-CINEMASLIDESDIR = File.expand_path( ENV[ 'CINEMASLIDESDIR' ] )
-if CINEMASLIDESDIR.nil?
+if ENV[ 'CINEMASLIDESDIR' ].nil?
   @cinemaslidesdir = File.join( ENV[ 'HOME' ], "cinemaslidesdir" )
   @logger.debug( "CINEMASLIDESDIR not set. Will use #{ @cinemaslidesdir }" )
 else
+  CINEMASLIDESDIR = File.expand_path( ENV[ 'CINEMASLIDESDIR' ] )
   @logger.debug( "CINEMASLIDESDIR is set to #{ CINEMASLIDESDIR }" )
-  @cinemaslidesdir = CINEMASLIDESDIR
+  @cinemaslidesdir = File.expand_path( ENV[ 'CINEMASLIDESDIR' ] )
 end
wolfgangw commented 13 years ago

Andrae, great, thanks. Done.