home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / lib / partman / active_partition / 83copy / do_option < prev   
Encoding:
Text File  |  2006-08-30  |  1.3 KB  |  73 lines

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