home *** CD-ROM | disk | FTP | other *** search
/ Mac Easy 2010 May / Mac Life Ubuntu.iso / casper / filesystem.squashfs / lib / partman / active_partition / 83copy / do_option < prev   
Encoding:
Text File  |  2009-04-19  |  1.1 KB  |  60 lines

  1. #!/bin/sh
  2.  
  3. . /lib/partman/lib/base.sh
  4. . /lib/partman/lib/commit.sh
  5.  
  6. dev=$2
  7. id=$3
  8.  
  9. cd $dev
  10.  
  11. db_set partman-partitioning/confirm_copy false
  12. db_input critical partman-partitioning/confirm_copy || true
  13. db_go || exit 0
  14. db_get partman-partitioning/confirm_copy
  15.  
  16. [ "$RET" = true ] || exit 0
  17.  
  18. ask_for_source () {
  19.     local noninteractive
  20.     noninteractive=true
  21.     while true; do
  22.         source_dev=''
  23.         source_id=''
  24.         while [ ! "$source_id" ]; do
  25.             choices=$(partition_tree_choices)
  26.             debconf_select critical partman-partitioning/source_partition "$choices" asdfasdfasdf
  27.             case $? in
  28.                 1)
  29.                 $noninteractive
  30.                 ;;
  31.                 255)
  32.                 return 1
  33.                 ;;
  34.             esac
  35.             noninteractive='return 1'
  36.             source_dev=${RET%//*}
  37.             source_id=${RET#*//}
  38.         done
  39.         source_dev=${source_dev##*/}
  40.         if perform_copying; then break; fi
  41.     done
  42.     return 0
  43. }
  44.  
  45. perform_copying () {
  46.     commit_changes partman-partitioning/copy_commit_failed || exit 0
  47.  
  48.     name_progress_bar partman-partitioning/progress_copying
  49.     open_dialog COPY_PARTITION $id $source_dev $source_id
  50.     close_dialog
  51.  
  52.     for s in /lib/partman/init.d/*; do
  53.         if [ -x $s ]; then
  54.             $s || exit 0
  55.         fi
  56.     done
  57. }
  58.  
  59. ask_for_source
  60.