Skip to content
Snippets Groups Projects
Select Git revision
  • 05d0e7210c443a004c65f00f776b15f896ba50d3
  • master default protected
  • staging protected
  • dev protected
  • prio
  • 25720_user_avatar
  • T15340
  • Add_GetColleagues
  • T11623_-_Backend_ActiveCollab_Create_new_error
  • test4
  • test2_br
  • test3
  • test_br
  • 0.175.0
  • 0.174.0
  • 0.173.0
  • 0.172.0
  • 0.171.0
  • 0.170.0
  • 0.169.0
  • 0.168.0
  • 0.167.0
  • 0.166.0
  • 0.165.0
  • 0.164.0
  • 0.163.0
  • 0.162.0
  • 0.161.0
  • 0.160.0
  • 0.159.0
  • 0.158.0
  • 0.157.0
  • 0.156.0
33 results

migrate

Blame
  • migrate 10.71 KiB
    # This file describe operations needed for migration between versions,
    # both for UPGRADE and DOWNGRADE.
    #
    # Documentation about syntax of this file:
    # https://metacpan.org/pod/App::migrate#SYNTAX
    #
    # You shouldn't modify anything in this file BEFORE LAST "VERSION" LINE!
    # If you will do this you'll likely BREAK DOWNGRADE for some version.
    # Exceptions from this rule are:
    # - git rebase
    # - add/remove comments, empty lines or do other visual/formatting changes
    # - add new DEFINEs
    # - modification of downgrade/after_downgrade operations needed to FIX
    #   BROKEN DOWNGRADE
    #
    # You shouldn't manually add "VERSION" lines - run narada-release instead.
    # Exceptions from this rule are some advanced use cases like:
    # - squashing several patches into one
    # - merging different release branches like 1.x and 2.x
    
    # INSTALL
    # - usually it will be automatically added by ./release, and you shouldn't
    #   add it manually
    # - this operation must be the last one, right before VERSION - to make
    #   sure patch&tgz will be applied exactly between before_upgrade and
    #   upgrade operations, and will be reversed exactly between downgrade and
    #   after_downgrade operations
    DEFINE2 INSTALL
    before_upgrade
      if test -f .release/${MIGRATE_NEXT_VERSION}.patch; then
        GIT_DIR=.git git apply .release/${MIGRATE_NEXT_VERSION}.patch
      fi
      if test -f .release/${MIGRATE_PREV_VERSION}.tgz; then
        files='m{\A[.]/\n}&&next;s/\n/\0/;s/(\\.)/"\"$1\""/gee;m{/\0}||print'
         dirs='m{\A[.]/\n}&&next;s/\n/\0/;s/(\\.)/"\"$1\""/gee;m{/\0}&&print'
        names=$(tar tzf .release/${MIGRATE_PREV_VERSION}.tgz)
        echo "$names" |       perl -ne "$files" | xargs -0 -r rm -f
        echo "$names" | tac | perl -ne "$dirs"  | xargs -0 -r rmdir --ignore-fail-on-non-empty
      fi
      if test -f .release/${MIGRATE_NEXT_VERSION}.tgz; then
        tar xzvpf .release/${MIGRATE_NEXT_VERSION}.tgz
      fi
      narada-bg-killall
    after_downgrade
      if test -f .release/${MIGRATE_PREV_VERSION}.patch; then
        GIT_DIR=.git git apply -R .release/${MIGRATE_PREV_VERSION}.patch
      fi
      if test -f .release/${MIGRATE_PREV_VERSION}.tgz; then
        files='m{\A[.]/\n}&&next;s/\n/\0/;s/(\\.)/"\"$1\""/gee;m{/\0}||print'
         dirs='m{\A[.]/\n}&&next;s/\n/\0/;s/(\\.)/"\"$1\""/gee;m{/\0}&&print'
        names=$(tar tzf .release/${MIGRATE_PREV_VERSION}.tgz)
        echo "$names" |       perl -ne "$files" | xargs -0 -r rm -f
        echo "$names" | tac | perl -ne "$dirs"  | xargs -0 -r rmdir --ignore-fail-on-non-empty
      fi
      if test -f .release/${MIGRATE_NEXT_VERSION}.tgz; then
        tar xzvpf .release/${MIGRATE_NEXT_VERSION}.tgz
      fi
      narada-bg-killall
    
    DEFINE2 only_before_upgrade
    upgrade
    downgrade true
    
    DEFINE2 only_upgrade
    upgrade
    downgrade true
    
    DEFINE2 only_downgrade
    upgrade true
    downgrade