From aa0123794a6743408f0de9d1792bdb7cc2eda733 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 16 Apr 2010 21:56:17 +0200 Subject: change infofy calls to inform, because libui-sh changed function name --- src/core/libs/lib-blockdevices-filesystems.sh | 52 +++++++++++++-------------- src/core/libs/lib-misc.sh | 4 +-- src/core/libs/lib-pacman.sh | 2 +- src/core/libs/lib-software.sh | 2 +- src/core/libs/lib-ui-interactive.sh | 8 ++--- src/core/procedures/automatic | 4 +-- 6 files changed, 36 insertions(+), 36 deletions(-) (limited to 'src/core') diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 9a7d5d4..0022128 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -65,12 +65,12 @@ target_special_fs () # Disable swap and umount all mounted filesystems for the target system in the correct order. (eg first $var_TARGET_DIR/a/b/c, then $var_TARGET_DIR/a/b, then $var_TARGET_DIR/a until lastly $var_TARGET_DIR target_umountall() { - infofy "Disabling all swapspace..." disks + inform "Disabling all swapspace..." disks swapoff -a >/dev/null 2>&1 declare target=${var_TARGET_DIR//\//\\/} # escape all slashes otherwise awk complains for mountpoint in $(mount | awk "/\/$target/ {print \$3}" | sort | tac ) do - infofy "Unmounting mountpoint $mountpoint" disks + inform "Unmounting mountpoint $mountpoint" disks umount $mountpoint >/dev/null 2>$LOG done } @@ -268,7 +268,7 @@ findblockdevices() { # taken from setup get_grub_map() { rm $TMP_DEV_MAP &>/dev/null #TODO: this doesn't exist? is this a problem? ASKDEV - infofy "Generating GRUB device map...\nThis could take a while.\n\n Please be patient." + inform "Generating GRUB device map...\nThis could take a while.\n\n Please be patient." $var_TARGET_DIR/sbin/grub --no-floppy --device-map $TMP_DEV_MAP >/tmp/grub.log 2>&1 <Still need to do it: Making the filesystem on a vg volume" - infofy "Making $fs_type filesystem on $part" disks + inform "Making $fs_type filesystem on $part" disks process_filesystem $part $fs_type $fs_create $fs_mountpoint no_mount $fs_opts $fs_label $fs_params && done_filesystems+=("$fs_id") || returncode=1 elif [ "$part_type" != lvm-pv -a -b "$part" ] # $part is not a lvm PV and it exists then debug 'FS' "$fs_id ->Still need to do it: Making the filesystem on a non-pv volume" - infofy "Making $fs_type filesystem on $part" disks + inform "Making $fs_type filesystem on $part" disks process_filesystem $part $fs_type $fs_create $fs_mountpoint no_mount $fs_opts $fs_label $fs_params && done_filesystems+=("$fs_id") || returncode=1 elif [ "$part_type" = lvm-pv ] && pvdisplay ${fs_params//:/ } >/dev/null # $part is a lvm PV. all needed lvm pv's exist. note that pvdisplay exits 5 as long as one of the args doesn't exist then debug 'FS' "$fs_id ->Still need to do it: Making the filesystem on a pv volume" - infofy "Making $fs_type filesystem on $part" disks + inform "Making $fs_type filesystem on $part" disks process_filesystem ${part/+/} $fs_type $fs_create $fs_mountpoint no_mount $fs_opts $fs_label $fs_params && done_filesystems+=("$fs_id") || returncode=1 else debug 'FS' "$fs_id ->Cannot do right now..." @@ -497,22 +497,22 @@ process_filesystems () # phase 2: mount all filesystems in the vfs in the correct order. (also swapon where appropriate) - infofy "Phase 2: Mounting filesystems" disks + inform "Phase 2: Mounting filesystems" disks while read part part_type part_label fs_type fs_create fs_mountpoint fs_mount fs_opts fs_label fs_params do if [ "$fs_mountpoint" != no_mountpoint ] then - infofy "Mounting $part ($fs_type) on $fs_mountpoint" disks + inform "Mounting $part ($fs_type) on $fs_mountpoint" disks process_filesystem $part $fs_type no $fs_mountpoint $fs_mount $fs_opts $fs_label $fs_params || returncode=1 elif [ "$fs_type" = swap ] then - infofy "Swaponning $part" disks + inform "Swaponning $part" disks process_filesystem $part $fs_type no $fs_mountpoint $fs_mount $fs_opts $fs_label $fs_params || returncode=1 fi done < <(sort -t \ -k 6 $TMP_FILESYSTEMS) BLOCK_ROLLBACK_USELESS=0 - [ $returncode -eq 0 ] && infofy "Done processing filesystems/blockdevices" disks 1 && return 0 + [ $returncode -eq 0 ] && inform "Done processing filesystems/blockdevices" disks 1 && return 0 return $returncode } @@ -520,7 +520,7 @@ process_filesystems () # Roll back all "filesystems" (normal ones and dm-mapper based stuff) specified in $BLOCK_DATA. Not partitions. Doesn't restore data after you erased it, of course. rollback_filesystems () { - infofy "Rolling back filesystems..." disks + inform "Rolling back filesystems..." disks generate_filesystem_list local warnings= rm -f $TMP_FSTAB @@ -528,20 +528,20 @@ rollback_filesystems () # phase 1: destruct all mounts in the vfs and swapoff swap volumes who are listed in $BLOCK_DATA # re-order list so that we umount in the correct order. eg first umount /a/b/c, then /a/b. we sort alphabetically, which has the side-effect of sorting by stringlength, hence by vfs dependencies. - infofy "Phase 1: Umounting all specified mountpoints" disks + inform "Phase 1: Umounting all specified mountpoints" disks done_umounts= # We translate some devices back to their original (eg /dev/sda3+ -> /dev/sda3 for lvm PV's). No need to bother user twice for such devices. while read part part_type part_label fs_type fs_create fs_mountpoint fs_mount fs_opts fs_label fs_params do if [ "$fs_type" = swap ] then - infofy "(Maybe) Swapoffing $part" disks + inform "(Maybe) Swapoffing $part" disks swapoff $part &>/dev/null # could be that it was not swappedon yet. that's not a problem at all. elif [ "$fs_mountpoint" != no_mountpoint ] then part_real=${part/+/} if ! check_is_in "$part_real" "${done_umounts[@]}" then - infofy "(Maybe) Umounting $part_real" disks + inform "(Maybe) Umounting $part_real" disks if mount | grep -q "^$part_real " # could be that this was not mounted yet. no problem, we can just skip it then. then if umount $part_real >$LOG @@ -566,7 +566,7 @@ rollback_filesystems () # -> easier (implemented) - infofy "Phase 2: destructing relevant blockdevices" disks + inform "Phase 2: destructing relevant blockdevices" disks for i in `seq 1 10` do open_items=0 @@ -580,7 +580,7 @@ rollback_filesystems () # there is probably a nice regex to check this but i'm bad at regexes. if echo "$fs_string" | grep -q ';yes;/' || echo "$fs_string" | grep -q ';yes;no_mountpoint' then - infofy "Skipping destruction of $part ($part_type) because one of the filesystems on it contains data you want to keep" + inform "Skipping destruction of $part ($part_type) because one of the filesystems on it contains data you want to keep" # TODO: it's possible that if we don't clear a blockdevice here because there is something on it with valuable data, that this blockdevice itself is hosted on some other blockdevice (eg lvm VG,PV or dm_crypt), \ # that blockdevice cannot be cleared as well because it depends on this one, so after 10 iterations the user will get a warning that not everything is cleared. so we should fix this someday. elif [ "$part_type" = dm_crypt ] # Can be in use for: lvm-pv or raw. we don't need to care about raw (it will be unmounted so it can be destroyed) @@ -592,7 +592,7 @@ rollback_filesystems () debug 'FS' "$part ->Cannot do right now..." open_items=1 else - infofy "Attempting destruction of device $part (type $part_type)" disks + inform "Attempting destruction of device $part (type $part_type)" disks if ! cryptsetup luksClose $real_part &>$LOG then warnings="$warnings\nCould not cryptsetup luksClose $real_part" @@ -611,7 +611,7 @@ rollback_filesystems () debug 'FS' "$part ->Cannot do right now..." open_items=1 else - infofy "Attempting destruction of device $part (type $part_type)" disks + inform "Attempting destruction of device $part (type $part_type)" disks if ! pvremove $real_part &>$LOG then warnings="$warnings\nCould not pvremove $part" @@ -631,7 +631,7 @@ rollback_filesystems () debug 'FS' "$part ->Cannot do right now..." open_items=1 else - infofy "Attempting destruction of device $part (type $part_type)" disks + inform "Attempting destruction of device $part (type $part_type)" disks if ! vgremove $part &>$LOG # we shouldn't need -f because we clean up the lv's first. then warnings="$warnings\nCould not vgremove $part" @@ -650,7 +650,7 @@ rollback_filesystems () debug 'FS' "$part ->Cannot do right now..." open_items=1 else - infofy "Attempting destruction of device $part (type $part_type)" disks + inform "Attempting destruction of device $part (type $part_type)" disks if ! lvremove -f $part &>$LOG then warnings="$warnings\nCould not lvremove -f $part" @@ -672,8 +672,8 @@ rollback_filesystems () warnings="$warnings\nCould not destruct all filesystems/blockdevices. It appears some depending filesystems/blockdevices could not be cleared in 10 iterations" show_warning "Filesystem/blockdevice processor problem" "Warning: Could not destruct all filesystems/blockdevices. It appears some depending filesystems/blockdevices could not be cleared in 10 iterations" fi - [ -n "$warnings" ] && infofy "Rollback failed" disks 1 && show_warning "Rollback problems" "Some problems occurred while rolling back: $warnings.\n Thisk needs to be fixed before retrying disk/filesystem creation or restarting the installer" && return 1 - infofy "Rollback succeeded" disks 1 + [ -n "$warnings" ] && inform "Rollback failed" disks 1 && show_warning "Rollback problems" "Some problems occurred while rolling back: $warnings.\n Thisk needs to be fixed before retrying disk/filesystem creation or restarting the installer" && return 1 + inform "Rollback succeeded" disks 1 done_filesystems= BLOCK_ROLLBACK_USELESS=1 return 0 @@ -738,9 +738,9 @@ process_filesystem () ;; dm_crypt) [ -z "$fs_params" ] && fs_params='-c aes-xts-plain -y -s 512'; fs_params=${fs_params//_/ } - infofy "Please enter your passphrase to encrypt the device (with confirmation)" + inform "Please enter your passphrase to encrypt the device (with confirmation)" cryptsetup $fs_params $opts luksFormat -q $part >$LOG 2>&1 < /dev/tty ; ret=$? #hack to give cryptsetup the approriate stdin. keep in mind we're in a loop (see process_filesystems where something else is on stdin) - infofy "Please enter your passphrase to unlock the device" + inform "Please enter your passphrase to unlock the device" cryptsetup luksOpen $part $fs_label >$LOG 2>&1 < /dev/tty; ret=$? || ( show_warning 'cryptsetup' "Error luksOpening $part on /dev/mapper/$fs_label" ) ;; lvm-pv) pvcreate $fs_opts $part >$LOG 2>&1; ret=$? ;; lvm-vg) # $fs_params: ':'-separated list of PV's diff --git a/src/core/libs/lib-misc.sh b/src/core/libs/lib-misc.sh index 681cf70..d45f8ca 100644 --- a/src/core/libs/lib-misc.sh +++ b/src/core/libs/lib-misc.sh @@ -112,13 +112,13 @@ cleanup_runtime () # $2 direction (systohc or hctosys) dohwclock() { # TODO: we probably only need to do this once and then actually use adjtime on next invocations - infofy "Resetting hardware clock adjustment file" + inform "Resetting hardware clock adjustment file" [ ! -d /var/lib/hwclock ] && mkdir -p /var/lib/hwclock if [ ! -f /var/lib/hwclock/adjtime ]; then echo "0.0 0 0.0" > /var/lib/hwclock/adjtime fi - infofy "Syncing clocks ($2), hc being $1 ..." + inform "Syncing clocks ($2), hc being $1 ..." if [ "$1" = "UTC" ]; then hwclock --$2 --utc else diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 3932640..91a54ad 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -85,7 +85,7 @@ done [ ! -d "${var_TARGET_DIR}/var/cache/pacman/pkg" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/cache/pacman/pkg" [ ! -d "${var_TARGET_DIR}/var/lib/pacman" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/lib/pacman" - infofy "Refreshing package database..." + inform "Refreshing package database..." $PACMAN_TARGET -Sy >$LOG 2>&1 || return 1 #TODO: make sure this also goes into the logfile. actually we should do this for many commands. return 0 } diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index 93a3c15..caf5d92 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -78,6 +78,6 @@ target_configure_initial_locale() target_locale-gen () { - infofy "Generating glibc base locales..." + inform "Generating glibc base locales..." chroot ${var_TARGET_DIR} locale-gen >/dev/null } \ No newline at end of file diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 5a3b848..15a752a 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -121,7 +121,7 @@ interactive_configure_system() interactive_timezone () { ask_timezone || return 1 TIMEZONE=$ANSWER_TIMEZONE - infofy "Setting Timezone to $TIMEZONE" + inform "Setting Timezone to $TIMEZONE" if [ -n "$TIMEZONE" -a -e "/usr/share/zoneinfo/$TIMEZONE" ] then # This changes probably also the systemtime (UTC->$TIMEZONE)! @@ -154,7 +154,7 @@ interactive_time () { "return" "Looks good. back to main menu" "${EXTRA[@]}" "manual" "Set time and date manually" || return 1 if [ "$ANSWER_OPTION" = ntp ] then - infofy "Syncing clock with internet pool ..." + inform "Syncing clock with internet pool ..." if ntpdate pool.ntp.org >/dev/null then notify "Synced clock with internet pool successfully." @@ -222,7 +222,7 @@ interactive_prepare_disks () then if rollback_filesystems #TODO: this part doesn't belong here. move it to ui-interactive. (interactive_rollback) then - infofy "Rollback succeeded" + inform "Rollback succeeded" else show_warning "Rollback failed" "Rollback failed" fi @@ -811,7 +811,7 @@ interactive_runtime_network() { if ask_yesno "Do you want to use DHCP?" then - infofy "Please wait. Polling for DHCP server on $INTERFACE..." + inform "Please wait. Polling for DHCP server on $INTERFACE..." dhcpcd -k $INTERFACE >$LOG 2>&1 if ! dhcpcd $INTERFACE >$LOG 2>&1 then diff --git a/src/core/procedures/automatic b/src/core/procedures/automatic index d807942..596aed3 100644 --- a/src/core/procedures/automatic +++ b/src/core/procedures/automatic @@ -75,7 +75,7 @@ worker_runtime_network () #then # interactive_runtime_network #else - # infofy "Ok. skipping network config" + # inform "Ok. skipping network config" #fi } @@ -92,7 +92,7 @@ worker_prepare_disks () rollback_filesystems && txt='ended successfully' die_error "Something failed while processing the filesystem. A rollback was executed, which $txt" fi - infofy "Partitions and filesystems made successfully" + inform "Partitions and filesystems made successfully" # TODO: fstab? auto-add to fstab with libs? auto mkdir's on target_dir? true -- cgit v1.2.3-54-g00ecf