[Rear-users] SF.net SVN: rear:[533] trunk/usr/share/rear

Schlomo Schapiro schlomo at schapiro.org
Thu Jun 2 12:57:25 CEST 2011


Hi,

good changes (like using type -p for the getty search).

BUT. Also tab->spaces changes.

I please ask everybody involved in ReaR coding to use TABS and not spaces. Feel
free to adjust the tab width in your editor. I don't want to go over so many
files to just replace spaces with tabs. If we would be using python this would
be different, but we use bash and most of ReaR uses tabs. So please leave it so,
even if your personal style differs.

Thanks,
Schlomo

PS: And would be nice to fixup all the spaces that are already in trunk if you
happen to pass the code again...

On 02/06/11 01:06, dag- at users.sourceforge.net wrote:
> Revision: 533
>           http://rear.svn.sourceforge.net/rear/?rev=533&view=rev
> Author:   dag-
> Date:     2011-06-01 23:06:05 +0000 (Wed, 01 Jun 2011)
> 
> Log Message:
> -----------
> Fix typos and various improvements
> 
> Modified Paths:
> --------------
>     trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh
>     trunk/usr/share/rear/rescue/GNU/Linux/40_use_serial_console.sh
>     trunk/usr/share/rear/rescue/GNU/Linux/95_cfg2html.sh
> 
> Removed Paths:
> -------------
>     trunk/usr/share/rear/prep/Linux-ia64/20_getty_or_agetty.sh
> 
> Modified: trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh
> ===================================================================
> --- trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh	2011-06-01 21:38:42 UTC (rev 532)
> +++ trunk/usr/share/rear/prep/GNU/Linux/20_include_agetty.sh	2011-06-01 23:06:05 UTC (rev 533)
> @@ -15,18 +15,18 @@
>      return
>  fi
>  
> -if [ -f /sbin/getty ]; then
> -	# Debian, Ubuntu,...
> -	GETTY=getty
> -elif [ -f /sbin/agetty ]; then
> -	# Fedora, RHEL, SLES,...
> -	GETTY=agetty
> +if type -p getty &>/dev/null; then
> +    # Debian, Ubuntu,...
> +    GETTY=getty
> +elif type -p agetty &>/dev/null; then
> +    # Fedora, RHEL, SLES,...
> +    GETTY=agetty
>  else
> -	# being desperate (not sure this is the best choice?)
> -	BugError "Could not find a suitable (a)getty for serial console. Please fix
> -$SHARE_DIR/prep/GNU/Linux/20_include_agetty.sh" 
> +    # being desperate (not sure this is the best choice?)
> +    BugError "Could not find a suitable (a)getty for serial console. Please fix
> +$SHARE_DIR/prep/GNU/Linux/20_include_agetty.sh"
>  fi
> -Log "Serial Console support requested - adding required program $GETTY"
> +Log "Serial Console support requested - adding required program '$GETTY'"
>  
>  REQUIRED_PROGS=(
>  "${REQUIRED_PROGS[@]}"
> 
> Deleted: trunk/usr/share/rear/prep/Linux-ia64/20_getty_or_agetty.sh
> ===================================================================
> --- trunk/usr/share/rear/prep/Linux-ia64/20_getty_or_agetty.sh	2011-06-01 21:38:42 UTC (rev 532)
> +++ trunk/usr/share/rear/prep/Linux-ia64/20_getty_or_agetty.sh	2011-06-01 23:06:05 UTC (rev 533)
> @@ -1,14 +0,0 @@
> -# On IA64 platforms we need the getty (Debian) or agetty (RH) program
> -# to be able to connect with the server via the LAN console.
> -# Furthermore, /etc/inittab need the approriate entries
> -
> -if [ -f /sbin/getty ]; then
> -	GETTY=getty
> -elif [ -f /sbin/agetty ]; then
> -	GETTY=agetty
> -fi
> -
> -REQUIRED_PROGS=(
> -"${REQUIRED_PROGS[@]}"
> -"${GETTY}"
> -)
> 
> Modified: trunk/usr/share/rear/rescue/GNU/Linux/40_use_serial_console.sh
> ===================================================================
> --- trunk/usr/share/rear/rescue/GNU/Linux/40_use_serial_console.sh	2011-06-01 21:38:42 UTC (rev 532)
> +++ trunk/usr/share/rear/rescue/GNU/Linux/40_use_serial_console.sh	2011-06-01 23:06:05 UTC (rev 533)
> @@ -21,9 +21,9 @@
>  done
>  
>  # Default to standard console (can be changed in syslinux menu at boot-time)
> -if [[ "$cmdline" != "$KERNEL_CMDLINE" ]]; then
> +if [[ " $cmdline" != "$KERNEL_CMDLINE " ]]; then
>      KERNEL_CMDLINE="${cmdline}console=tty0"
>  fi
>  
> -Log "Serial Console support enabled - adding required entries for $GETTY in inittab"
> -Log "Modified kernel commandline to: $KERNEL_CMDLINE"
> +Log "Serial Console support enabled - adding required entries for '$GETTY' in inittab"
> +Log "Modified kernel commandline to: '$KERNEL_CMDLINE'"
> 
> Modified: trunk/usr/share/rear/rescue/GNU/Linux/95_cfg2html.sh
> ===================================================================
> --- trunk/usr/share/rear/rescue/GNU/Linux/95_cfg2html.sh	2011-06-01 21:38:42 UTC (rev 532)
> +++ trunk/usr/share/rear/rescue/GNU/Linux/95_cfg2html.sh	2011-06-01 23:06:05 UTC (rev 533)
> @@ -2,31 +2,31 @@
>  # For this cfg2html has to be installed and it has not been disabled.
>  
>  # If USE_CFG2HTML is disabled, skip this script
> -if [[ ! "$USE_CFG2HTML" =~ ^[yY1] ]] then
> +if [[ ! "$USE_CFG2HTML" =~ ^[yY1] ]]; then
> +    Log "USE_CFG2HTML not enabled ($CFG2HTML)"
>      return
>  fi
>  
>  # If SKIP_CFG2HTML is enabled, skip this script (backward compatibility)
> -if [[ -z "$USE_CFG2HTML" && -z "$SKIP2CFGHTML" ]]; then
> +if [[ -z "$USE_CFG2HTML" && -z "$SKIP_CFG2HTML" ]]; then
> +    Log "SKIP_CFG2HTML not disabled ($SKIP_CFG2HTML)"
>      return
>  fi
>  
>  # No cfg2html binary, skip this script
> -if type -p cfg2html &>/dev/null; then
> +if ! type -p cfg2html &>/dev/null; then
>      Log "cfg2html has not been found on the system, skipping cfg2html."
>      return
>  fi
>  
> -ProgressStart "Collecting general system information (cfg2html)"
> +Log "Collecting general system information (cfg2html)"
>  
>  # cfg2html recommend to keep the result private
> -mkdir -v -p -m0750 $VAR_DIR/recovery/cfg2html 1>&8
> -ProgressStopIfError $? "Could not create '$VAR_DIR/recovery/cfg2html' directory"
> +mkdir -v -p -m0750 $VAR_DIR/recovery/cfg2html
> +StopIfError "Could not create '$VAR_DIR/recovery/cfg2html' directory"
>  
> -cfg2html -o $VAR_DIR/recovery/cfg2html -p | ProgressStepSingleChar
> -ProgressStopIfError $? "An error occured when running cfg2html"
> +cfg2html -o $VAR_DIR/recovery/cfg2html
> +StopIfError "An error occured when running cfg2html"
>  
> -ProgressStop
> -
>  # Add HTML part of cfg2html to result files
>  RESULT_FILES=( "${RESULT_FILES[@]}" $(find $VAR_DIR/recovery/cfg2html -type f -name \*.html) )
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
> 
> ------------------------------------------------------------------------------
> Simplify data backup and recovery for your virtual environment with vRanger. 
> Installation's a snap, and flexible recovery options mean your data is safe,
> secure and there when you need it. Data protection magic?
> Nope - It's vRanger. Get your free trial download today. 
> http://p.sf.net/sfu/quest-sfdev2dev
> _______________________________________________
> Rear-users mailing list
> Rear-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/rear-users




More information about the rear-users mailing list