From 9f34485bed2aa77e312575dc0217d9ad672755d4 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Sun, 12 Dec 2010 19:59:14 +0100 Subject: cleanup some TODO's and other cruft --- src/core/libs/lib-pacman.sh | 19 +------------------ src/core/libs/lib-software.sh | 3 +-- src/core/libs/lib-ui-interactive.sh | 12 +++++------- 3 files changed, 7 insertions(+), 27 deletions(-) (limited to 'src/core/libs') diff --git a/src/core/libs/lib-pacman.sh b/src/core/libs/lib-pacman.sh index 2eb1264..21c944c 100644 --- a/src/core/libs/lib-pacman.sh +++ b/src/core/libs/lib-pacman.sh @@ -87,7 +87,7 @@ done [ ! -d "${var_TARGET_DIR}/var/lib/pacman" ] && mkdir -m 755 -p "${var_TARGET_DIR}/var/lib/pacman" 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. + $PACMAN_TARGET -Sy >$LOG 2>&1 || return 1 return 0 } @@ -118,21 +118,6 @@ ${3} EOF } - -# taken from quickinst. TODO: figure this one out ASKDEV -pacman_what_is_this_for () -{ - PKGLIST= - # fix pacman list! - sed -i -e 's/-i686//g' -e 's/-x86_64//g' $PKGFILE - for i in $(cat $PKGFILE | grep 'base/' | cut -d/ -f2); do - nm=${i%-*-*} - PKGLIST="$PKGLIST $nm" - done - ! [ -d $var_TARGET_DIR/var/lib/pacman ] && mkdir -p $var_TARGET_DIR/var/lib/pacman - ! [ -d /var/lib/pacman ] && mkdir -p /var/lib/pacman -} - list_package_groups () { $PACMAN_TARGET -Sg @@ -143,7 +128,6 @@ list_package_groups () # packagename [version, if $1=repo] # $1 repo or group # $2 one or more repo or group names -# TODO: check the validity of the specified names in $2 list_packages () { [ "$1" = repo -o "$1" = group ] || die_error "list_packages \$1 must be repo or group. not $1!" @@ -155,7 +139,6 @@ list_packages () # $1 packages separated by spaces # output format: multiple lines, each line like: # -# TODO: check $1 which_group () { PACKAGE_GROUPS=`LANG=C $PACMAN_TARGET -Si $1| awk '/^Name/{ printf("%s ",$3) } /^Group/{ print $3 }'` diff --git a/src/core/libs/lib-software.sh b/src/core/libs/lib-software.sh index caf5d92..467e658 100644 --- a/src/core/libs/lib-software.sh +++ b/src/core/libs/lib-software.sh @@ -44,7 +44,6 @@ installpkg() { notify "Package installation will begin now. You can watch the output in the progress window. Please be patient." - #TODO: There may be something wrong here. See http://projects.archlinux.org/?p=installer.git;a=commitdiff;h=f504e9ecfb9ecf1952bd8dcce7efe941e74db946 ASKDEV (Simo) run_controlled pacman_installpkg "$PACMAN_TARGET --noconfirm -S $ALL_PACKAGES" $TMP_PACMAN_LOG "Installing... Please Wait" local _result='' @@ -80,4 +79,4 @@ target_locale-gen () { 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 5a87b9a..3fd1665 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -1,6 +1,5 @@ #!/bin/bash -#TODO: get backend code out of here!! - +# A library which allows you to do backend stuff by using user interfaces # check if a worker has completed successfully. if not -> tell user he must do it + return 1 # if ok -> don't warn anything and return 0 @@ -200,7 +199,6 @@ interactive_prepare_disks () default=no [ -n "$NEXTITEM" ] && default="$NEXTITEM" - #TODO: inform user (using dialog's --item-help or so) that autoprepare uses 1 disk and uses it in a "fairly regular" (though somewhat customizable) manner. ask_option $default "Prepare Hard Drive" '' required \ "1" "Auto-Prepare (erases an ENTIRE hard drive and sets up partitions, filesystems and mountpoints)" \ "2" "Manually Partition Hard Drives" \ @@ -211,7 +209,7 @@ interactive_prepare_disks () case $ANSWER_OPTION in "1") [ "$BLOCK_ROLLBACK_USELESS" = "0" ] && ask_yesno "You should probably rollback your last changes first, otherwise this will probably fail. Go back to menu to do rollback?" && NEXTITEM=4 && continue - interactive_autoprepare && NEXTITEM=5 && ret=0 && DISK_CONFIG_TYPE=auto;; #TODO: for some reason. if this completes $?=0, next item will be 1 :/ + interactive_autoprepare && NEXTITEM=5 && ret=0 && DISK_CONFIG_TYPE=auto;; "2") [ "$BLOCK_ROLLBACK_USELESS" = "0" ] && ask_yesno "You should probably rollback your last changes first, otherwise this will probably fail. Go back to menu to do rollback?" && NEXTITEM=4 && continue interactive_partition && ret=1 && NEXTITEM=3 && DISK_CONFIG_TYPE=manual @@ -228,7 +226,7 @@ interactive_prepare_disks () fi if [ $? -eq 0 -o "$BLOCK_ROLLBACK_USELESS" = "0" ] then - if rollback_filesystems #TODO: this part doesn't belong here. move it to ui-interactive. (interactive_rollback) + if rollback_filesystems then inform "Rollback succeeded" else @@ -281,7 +279,7 @@ interactive_autoprepare() do ask_number "Enter the size (MiB) of your / partition. Recommended size:7500. The /home partition will use the remaining space.\n\nDisk space left: $BLOCKDEVICE_SIZE MiB" 1 $BLOCKDEVICE_SIZE 7500 || return 1 ROOT_PART_SIZE=$ANSWER_NUMBER - ask_yesno "$(($BLOCKDEVICE_SIZE-$ROOT_PART_SIZE)) MiB will be used for your /home partition. Is this OK?" yes && ROOT_PART_SET=1 #TODO: when doing yes, cli mode prints option JFS all the time, dia mode goes back to disks menu + ask_yesno "$(($BLOCKDEVICE_SIZE-$ROOT_PART_SIZE)) MiB will be used for your /home partition. Is this OK?" yes && ROOT_PART_SET=1 done ask_option no 'Filesystem selection' "Select a filesystem for / and /home:" required ${FSOPTS[@]} || return 1 @@ -384,7 +382,7 @@ interactive_filesystem () ask_option edit "Change $fs_type filesystem settings on $part ?" \ "Change $fs_type filesystem settings (create:$fs_create, label:$fs_label, mountpoint:$fs_mountpoint) on $part (type:$part_type, label:$part_label) ?" required \ - edit EDIT delete DELETE #TODO: nicer display if label is empty etc + edit EDIT delete DELETE # Don't alter, and return if user cancels [ $? -gt 0 ] && NEW_FILESYSTEM=$fs_string && return 0 -- cgit v1.2.3-54-g00ecf