rbbt-util 5.23.11 → 5.23.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/rbbt/resource/util.rb +5 -1
- data/lib/rbbt/workflow.rb +14 -2
- data/lib/rbbt/workflow/accessor.rb +1 -0
- data/lib/rbbt/workflow/step/run.rb +1 -1
- data/share/install/software/lib/install_helpers +16 -6
- data/test/rbbt/test_workflow.rb +21 -1
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: f6ae6631eb6e9bb1a1b31eb427c4245072253f4f
         | 
| 4 | 
            +
              data.tar.gz: 333e8a20a8a3aa7d631a879d35ff808fb2c51946
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 9328bfdbc4c55e3e567edaaed2e11e0ea4c2b160d88d6bb0eef86b2bb785ec597c57008427b044ea106b288e4956148eedc65bc2f798dda1a3a5c6cdbbfaa944
         | 
| 7 | 
            +
              data.tar.gz: fb7291ccdf11019b1f1053f0867775ed0d6434e81a8c51344cc40d705a1a14922a71d96812d8c4452ee9fbf0be3549c2f284a6e1e9e7ff92d4fb346985952637
         | 
    
        data/lib/rbbt/resource/util.rb
    CHANGED
    
    | @@ -40,7 +40,7 @@ module Resource | |
| 40 40 |  | 
| 41 41 | 
             
                  FileUtils.mkdir_p opt_dir unless File.exist? opt_dir
         | 
| 42 42 |  | 
| 43 | 
            -
                  %w(.ld-paths .pkgconfig-paths .aclocal-paths .java-classpaths).each do |file|
         | 
| 43 | 
            +
                  %w(.ld-paths .c-paths .pkgconfig-paths .aclocal-paths .java-classpaths).each do |file|
         | 
| 44 44 | 
             
                    filename = File.join(opt_dir, file)
         | 
| 45 45 | 
             
                    begin
         | 
| 46 46 | 
             
                      FileUtils.touch filename unless File.exist? filename
         | 
| @@ -49,6 +49,10 @@ module Resource | |
| 49 49 | 
             
                    end
         | 
| 50 50 | 
             
                  end
         | 
| 51 51 |  | 
| 52 | 
            +
                  Open.read(File.join opt_dir, '.c-paths').split(/\n/).each do |line|
         | 
| 53 | 
            +
                    Misc.env_add('C_INCLULDE_PATH',line.chomp)
         | 
| 54 | 
            +
                  end if File.exist? File.join(opt_dir, '.c-paths')
         | 
| 55 | 
            +
             | 
| 52 56 | 
             
                  Open.read(File.join opt_dir, '.ld-paths').split(/\n/).each do |line|
         | 
| 53 57 | 
             
                    Misc.env_add('LD_LIBRARY_PATH',line.chomp)
         | 
| 54 58 | 
             
                    Misc.env_add('LD_RUN_PATH',line.chomp)
         | 
    
        data/lib/rbbt/workflow.rb
    CHANGED
    
    | @@ -423,7 +423,13 @@ module Workflow | |
| 423 423 | 
             
                end
         | 
| 424 424 | 
             
              end
         | 
| 425 425 |  | 
| 426 | 
            -
              def self. | 
| 426 | 
            +
              def self.transplant(listed, real, other)
         | 
| 427 | 
            +
                if listed.nil?
         | 
| 428 | 
            +
                  parts = real.split("/")
         | 
| 429 | 
            +
                  other_parts = other.split("/")
         | 
| 430 | 
            +
                  listed = (other_parts[0..-4] + parts[-3..-1]) * "/"
         | 
| 431 | 
            +
                end
         | 
| 432 | 
            +
             | 
| 427 433 | 
             
                sl = listed.split("/", -1)
         | 
| 428 434 | 
             
                so = other.split("/", -1)
         | 
| 429 435 | 
             
                sr = real.split("/", -1)
         | 
| @@ -437,13 +443,19 @@ module Workflow | |
| 437 443 | 
             
                File.join(sr - sl + so)
         | 
| 438 444 | 
             
              end
         | 
| 439 445 |  | 
| 446 | 
            +
              def  self.relocate(real, other)
         | 
| 447 | 
            +
                preal = real.split(/\/+/)
         | 
| 448 | 
            +
                pother = other.split(/\/+/)
         | 
| 449 | 
            +
                (preal[0..-4] + pother[-3..-1]) * "/"
         | 
| 450 | 
            +
              end
         | 
| 451 | 
            +
             | 
| 440 452 | 
             
              def self.load_step(path)
         | 
| 441 453 | 
             
                step = Step.new path
         | 
| 442 454 | 
             
                step.dependencies = (step.info[:dependencies] || []).collect do |task,name,dep_path|
         | 
| 443 455 | 
             
                  if File.exists?(dep_path)
         | 
| 444 456 | 
             
                    Workflow.load_step dep_path
         | 
| 445 457 | 
             
                  else
         | 
| 446 | 
            -
                    new_path = relocate( | 
| 458 | 
            +
                    new_path = relocate(path, dep_path)
         | 
| 447 459 | 
             
                    Workflow.load_step new_path
         | 
| 448 460 | 
             
                  end
         | 
| 449 461 | 
             
                end
         | 
| @@ -163,6 +163,7 @@ class Step | |
| 163 163 |  | 
| 164 164 | 
             
              def set_info(key, value)
         | 
| 165 165 | 
             
                return nil if @exec or info_file.nil?
         | 
| 166 | 
            +
                return nil if ! File.writable? info_file
         | 
| 166 167 | 
             
                value = Annotated.purge value if defined? Annotated
         | 
| 167 168 | 
             
                Open.lock(info_file, :lock => info_lock) do
         | 
| 168 169 | 
             
                  i = info(false).dup
         | 
| @@ -126,10 +126,20 @@ build_dir(){ | |
| 126 126 | 
             
            compile(){
         | 
| 127 127 | 
             
                local name=$1; shift
         | 
| 128 128 | 
             
                local extra="$@"
         | 
| 129 | 
            -
             | 
| 130 | 
            -
                [ -f  | 
| 131 | 
            -
             | 
| 132 | 
            -
             | 
| 129 | 
            +
             | 
| 130 | 
            +
                if [ -f Makefile -o -f makefile ]; then
         | 
| 131 | 
            +
                    make || exit -1
         | 
| 132 | 
            +
                    make install || echo "No install"
         | 
| 133 | 
            +
                fi
         | 
| 134 | 
            +
             | 
| 135 | 
            +
                [ -f build.xml ] && (ant || exit -1)
         | 
| 136 | 
            +
             | 
| 137 | 
            +
                [ -f setup.rb ] && (ruby -Ilib/ setup.rb --prefix="$(opt_dir "$name")" $extra || exit -1)
         | 
| 138 | 
            +
             | 
| 139 | 
            +
                if [ -f setup.py ]; then 
         | 
| 140 | 
            +
                    python setup.py build &&  python setup.py install --user || exit -1
         | 
| 141 | 
            +
                    clean_build 
         | 
| 142 | 
            +
                fi
         | 
| 133 143 | 
             
            }
         | 
| 134 144 |  | 
| 135 145 | 
             
            build(){
         | 
| @@ -140,7 +150,7 @@ build(){ | |
| 140 150 |  | 
| 141 151 | 
             
                local old_pwd="`expand_path $(pwd)`"
         | 
| 142 152 | 
             
                cd "`build_dir`"
         | 
| 143 | 
            -
                echo `pwd`
         | 
| 153 | 
            +
                echo PWD: `pwd`
         | 
| 144 154 | 
             
                ls
         | 
| 145 155 |  | 
| 146 156 | 
             
                if [ -f Makefile.am -a ! -f configure ]; then
         | 
| @@ -164,6 +174,7 @@ build(){ | |
| 164 174 | 
             
                    compile "$name" $extra
         | 
| 165 175 | 
             
                    setup "$name"
         | 
| 166 176 | 
             
                    clean_build
         | 
| 177 | 
            +
                    cd "$old_pwd"
         | 
| 167 178 | 
             
                else
         | 
| 168 179 | 
             
                    compile "$name" $extra
         | 
| 169 180 | 
             
                    move_opt "$name"
         | 
| @@ -171,7 +182,6 @@ build(){ | |
| 171 182 | 
             
                    clean_build
         | 
| 172 183 | 
             
                fi
         | 
| 173 184 |  | 
| 174 | 
            -
                cd "$old_pwd"
         | 
| 175 185 | 
             
            }
         | 
| 176 186 |  | 
| 177 187 | 
             
            #{{{ SETUP
         | 
    
        data/test/rbbt/test_workflow.rb
    CHANGED
    
    | @@ -277,7 +277,27 @@ class TestWorkflow < Test::Unit::TestCase | |
| 277 277 | 
             
                other = '/home/user/.rbbt/var/jobs/TestWF/task2/Default'
         | 
| 278 278 | 
             
                real_other = '/usr/local/var/rbbt/jobs/TestWF/task2/Default'
         | 
| 279 279 |  | 
| 280 | 
            -
                assert_equal real_other, Workflow.relocate( | 
| 280 | 
            +
                assert_equal real_other, Workflow.relocate(real, other)
         | 
| 281 | 
            +
                assert_equal real_other, Workflow.relocate(real, other)
         | 
| 282 | 
            +
              end
         | 
| 283 | 
            +
             | 
| 284 | 
            +
              def test_transplant
         | 
| 285 | 
            +
                listed = '/home/user/.rbbt/var/jobs/TestWF/task1/Default'
         | 
| 286 | 
            +
                real = '/usr/local/var/rbbt/jobs/TestWF/task1/Default'
         | 
| 287 | 
            +
                other = '/home/user/.rbbt/var/jobs/TestWF/task2/Default'
         | 
| 288 | 
            +
                real_other = '/usr/local/var/rbbt/jobs/TestWF/task2/Default'
         | 
| 289 | 
            +
             | 
| 290 | 
            +
                assert_equal real_other, Workflow.transplant(listed, real, other)
         | 
| 291 | 
            +
                assert_equal real_other, Workflow.transplant(nil, real, other)
         | 
| 292 | 
            +
              end
         | 
| 293 | 
            +
             | 
| 294 | 
            +
              def test_relocate_alt
         | 
| 295 | 
            +
                listed = '/scratch/tmp/rbbt/.rbbt/var/jobs/Study/sample_gene_cnvs_focal/Bladder-TCC'
         | 
| 296 | 
            +
                real = '/home/bsc26/bsc26892/.rbbt/var/jobs/Study/sample_gene_cnvs_focal/Bladder-TCC'
         | 
| 297 | 
            +
                other = '/scratch/tmp/rbbt/scratch/bsc26892/rbbt/var/jobs/Sample/gene_cnv_status_focal/PCAWG'
         | 
| 298 | 
            +
                real_other = '/home/bsc26/bsc26892/.rbbt/var/jobs/Sample/gene_cnv_status_focal/PCAWG'
         | 
| 299 | 
            +
             | 
| 300 | 
            +
                assert_equal real_other, Workflow.relocate(real, other)
         | 
| 281 301 | 
             
              end
         | 
| 282 302 |  | 
| 283 303 | 
             
            end
         | 
    
        metadata
    CHANGED
    
    | @@ -1,14 +1,14 @@ | |
| 1 1 | 
             
            --- !ruby/object:Gem::Specification
         | 
| 2 2 | 
             
            name: rbbt-util
         | 
| 3 3 | 
             
            version: !ruby/object:Gem::Version
         | 
| 4 | 
            -
              version: 5.23. | 
| 4 | 
            +
              version: 5.23.12
         | 
| 5 5 | 
             
            platform: ruby
         | 
| 6 6 | 
             
            authors:
         | 
| 7 7 | 
             
            - Miguel Vazquez
         | 
| 8 8 | 
             
            autorequire: 
         | 
| 9 9 | 
             
            bindir: bin
         | 
| 10 10 | 
             
            cert_chain: []
         | 
| 11 | 
            -
            date: 2018-08- | 
| 11 | 
            +
            date: 2018-08-10 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: rake
         |