View | Details | Raw Unified | Return to bug 268686
Collapse All | Expand All

(-)freebsd-update-spaces.sh (-73 / +73 lines)
Lines 136-143 Link Here
136
136
137
# Set the working directory.
137
# Set the working directory.
138
config_WorkDir () {
138
config_WorkDir () {
139
	if [ -z ${WORKDIR} ]; then
139
	if [ -z "${WORKDIR}" ]; then
140
		WORKDIR=$1
140
		WORKDIR="$1"
141
	else
141
	else
142
		return 1
142
		return 1
143
	fi
143
	fi
Lines 276-283 Link Here
276
276
277
# Work on a FreeBSD installation mounted under $1
277
# Work on a FreeBSD installation mounted under $1
278
config_BaseDir () {
278
config_BaseDir () {
279
	if [ -z ${BASEDIR} ]; then
279
	if [ -z "${BASEDIR}" ]; then
280
		BASEDIR=$1
280
		BASEDIR="$1"
281
	else
281
	else
282
		return 1
282
		return 1
283
	fi
283
	fi
Lines 330-336 Link Here
330
	JAIL=$1
330
	JAIL=$1
331
	UNAME_r=$(freebsd-version -j ${JAIL})
331
	UNAME_r=$(freebsd-version -j ${JAIL})
332
	BASEDIR=$(jls -j ${JAIL} -h path | awk 'NR == 2 {print}')
332
	BASEDIR=$(jls -j ${JAIL} -h path | awk 'NR == 2 {print}')
333
	if [ -z ${BASEDIR} ] || [ -z ${UNAME_r} ]; then
333
	if [ -z "${BASEDIR}" ] || [ -z ${UNAME_r} ]; then
334
		echo "The specified jail either doesn't exist or" \
334
		echo "The specified jail either doesn't exist or" \
335
		      "does not have freebsd-version."
335
		      "does not have freebsd-version."
336
		exit 1
336
		exit 1
Lines 500-534 Link Here
500
		# Configuration file equivalents
500
		# Configuration file equivalents
501
		-b)
501
		-b)
502
			if [ $# -eq 1 ]; then usage; fi; shift
502
			if [ $# -eq 1 ]; then usage; fi; shift
503
			config_BaseDir $1 || usage
503
			config_BaseDir "$1" || usage
504
			;;
504
			;;
505
		-d)
505
		-d)
506
			if [ $# -eq 1 ]; then usage; fi; shift
506
			if [ $# -eq 1 ]; then usage; fi; shift
507
			config_WorkDir $1 || usage
507
			config_WorkDir "$1" || usage
508
			;;
508
			;;
509
		-j)
509
		-j)
510
			if [ $# -eq 1 ]; then usage; fi; shift
510
			if [ $# -eq 1 ]; then usage; fi; shift
511
			config_TargetJail $1 || usage
511
			config_TargetJail "$1" || usage
512
			;;
512
			;;
513
		-k)
513
		-k)
514
			if [ $# -eq 1 ]; then usage; fi; shift
514
			if [ $# -eq 1 ]; then usage; fi; shift
515
			config_KeyPrint $1 || usage
515
			config_KeyPrint "$1" || usage
516
			;;
516
			;;
517
		-s)
517
		-s)
518
			if [ $# -eq 1 ]; then usage; fi; shift
518
			if [ $# -eq 1 ]; then usage; fi; shift
519
			config_ServerName $1 || usage
519
			config_ServerName "$1" || usage
520
			;;
520
			;;
521
		-r)
521
		-r)
522
			if [ $# -eq 1 ]; then usage; fi; shift
522
			if [ $# -eq 1 ]; then usage; fi; shift
523
			config_TargetRelease $1 || usage
523
			config_TargetRelease "$1" || usage
524
			;;
524
			;;
525
		-t)
525
		-t)
526
			if [ $# -eq 1 ]; then usage; fi; shift
526
			if [ $# -eq 1 ]; then usage; fi; shift
527
			config_MailTo $1 || usage
527
			config_MailTo "$1" || usage
528
			;;
528
			;;
529
		-v)
529
		-v)
530
			if [ $# -eq 1 ]; then usage; fi; shift
530
			if [ $# -eq 1 ]; then usage; fi; shift
531
			config_VerboseLevel $1 || usage
531
			config_VerboseLevel "$1" || usage
532
			;;
532
			;;
533
533
534
		# Aliases for "-v debug" and "-v nostats"
534
		# Aliases for "-v debug" and "-v nostats"
Lines 566-572 Link Here
566
	if [ ! -z "${CONFFILE}" ] && [ ! -r "${CONFFILE}" ]; then
566
	if [ ! -z "${CONFFILE}" ] && [ ! -r "${CONFFILE}" ]; then
567
		echo -n "File does not exist "
567
		echo -n "File does not exist "
568
		echo -n "or is not readable: "
568
		echo -n "or is not readable: "
569
		echo ${CONFFILE}
569
		echo "${CONFFILE}"
570
		exit 1
570
		exit 1
571
	fi
571
	fi
572
572
Lines 596-602 Link Here
596
			echo "==> ${LINE}"
596
			echo "==> ${LINE}"
597
			exit 1
597
			exit 1
598
		fi
598
		fi
599
	done < ${CONFFILE}
599
	done < "${CONFFILE}"
600
600
601
	# Merge the settings read from the configuration file with those
601
	# Merge the settings read from the configuration file with those
602
	# provided at the command line.
602
	# provided at the command line.
Lines 692-709 Link Here
692
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
692
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
693
		echo -n "`basename $0`: "
693
		echo -n "`basename $0`: "
694
		echo -n "${_WORKDIR_bad}"
694
		echo -n "${_WORKDIR_bad}"
695
		echo ${WORKDIR}
695
		echo "${WORKDIR}"
696
		exit 1
696
		exit 1
697
	fi
697
	fi
698
	case `df -T ${WORKDIR}` in */dev/md[0-9]* | *tmpfs*)
698
	case `df -T "${WORKDIR}"` in */dev/md[0-9]* | *tmpfs*)
699
		echo -n "`basename $0`: "
699
		echo -n "`basename $0`: "
700
		echo -n "${_WORKDIR_bad2}"
700
		echo -n "${_WORKDIR_bad2}"
701
		echo ${WORKDIR}
701
		echo "${WORKDIR}"
702
		exit 1
702
		exit 1
703
		;;
703
		;;
704
	esac
704
	esac
705
	chmod 700 ${WORKDIR}
705
	chmod 700 "${WORKDIR}"
706
	cd ${WORKDIR} || exit 1
706
	cd "${WORKDIR}" || exit 1
707
707
708
	# Generate release number.  The s/SECURITY/RELEASE/ bit exists
708
	# Generate release number.  The s/SECURITY/RELEASE/ bit exists
709
	# to provide an upgrade path for FreeBSD Update 1.x users, since
709
	# to provide an upgrade path for FreeBSD Update 1.x users, since
Lines 769-775 Link Here
769
	fetch_setup_verboselevel
769
	fetch_setup_verboselevel
770
770
771
	# Construct a unique name from ${BASEDIR}
771
	# Construct a unique name from ${BASEDIR}
772
	BDHASH=`echo ${BASEDIR} | sha256 -q`
772
	BDHASH=`echo "${BASEDIR}" | sha256 -q`
773
}
773
}
774
774
775
# Perform sanity checks etc. before fetching updates.
775
# Perform sanity checks etc. before fetching updates.
Lines 853-865 Link Here
853
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
853
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
854
		echo -n "`basename $0`: "
854
		echo -n "`basename $0`: "
855
		echo -n "${_WORKDIR_bad}"
855
		echo -n "${_WORKDIR_bad}"
856
		echo ${WORKDIR}
856
		echo "${WORKDIR}"
857
		exit 1
857
		exit 1
858
	fi
858
	fi
859
	cd ${WORKDIR} || exit 1
859
	cd "${WORKDIR}" || exit 1
860
860
861
	# Construct a unique name from ${BASEDIR}
861
	# Construct a unique name from ${BASEDIR}
862
	BDHASH=`echo ${BASEDIR} | sha256 -q`
862
	BDHASH=`echo "${BASEDIR}" | sha256 -q`
863
863
864
	# Check that we have updates ready to install
864
	# Check that we have updates ready to install
865
	if ! [ -L ${BDHASH}-install ]; then
865
	if ! [ -L ${BDHASH}-install ]; then
Lines 943-955 Link Here
943
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
943
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
944
		echo -n "`basename $0`: "
944
		echo -n "`basename $0`: "
945
		echo -n "${_WORKDIR_bad}"
945
		echo -n "${_WORKDIR_bad}"
946
		echo ${WORKDIR}
946
		echo "${WORKDIR}"
947
		exit 1
947
		exit 1
948
	fi
948
	fi
949
	cd ${WORKDIR} || exit 1
949
	cd "${WORKDIR}" || exit 1
950
950
951
	# Construct a unique name from ${BASEDIR}
951
	# Construct a unique name from ${BASEDIR}
952
	BDHASH=`echo ${BASEDIR} | sha256 -q`
952
	BDHASH=`echo "${BASEDIR}" | sha256 -q`
953
953
954
	# Check that we have updates ready to rollback
954
	# Check that we have updates ready to rollback
955
	if ! [ -L ${BDHASH}-rollback ]; then
955
	if ! [ -L ${BDHASH}-rollback ]; then
Lines 998-1007 Link Here
998
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
998
	if ! [ -d "${WORKDIR}" -a -w "${WORKDIR}" ]; then
999
		echo -n "`basename $0`: "
999
		echo -n "`basename $0`: "
1000
		echo -n "${_WORKDIR_bad}"
1000
		echo -n "${_WORKDIR_bad}"
1001
		echo ${WORKDIR}
1001
		echo "${WORKDIR}"
1002
		exit 1
1002
		exit 1
1003
	fi
1003
	fi
1004
	cd ${WORKDIR} || exit 1
1004
	cd "${WORKDIR}" || exit 1
1005
1005
1006
	# Generate release number.  The s/SECURITY/RELEASE/ bit exists
1006
	# Generate release number.  The s/SECURITY/RELEASE/ bit exists
1007
	# to provide an upgrade path for FreeBSD Update 1.x users, since
1007
	# to provide an upgrade path for FreeBSD Update 1.x users, since
Lines 1618-1628 Link Here
1618
	# sorted by device and inode number.
1618
	# sorted by device and inode number.
1619
	while read F; do
1619
	while read F; do
1620
		# If the symlink/file/directory does not exist, record this.
1620
		# If the symlink/file/directory does not exist, record this.
1621
		if ! [ -e ${BASEDIR}/${F} ]; then
1621
		if ! [ -e "${BASEDIR}"/${F} ]; then
1622
			echo "${F}|-||||||"
1622
			echo "${F}|-||||||"
1623
			continue
1623
			continue
1624
		fi
1624
		fi
1625
		if ! [ -r ${BASEDIR}/${F} ]; then
1625
		if ! [ -r "${BASEDIR}"/${F} ]; then
1626
			echo "Cannot read file: ${BASEDIR}/${F}"	\
1626
			echo "Cannot read file: ${BASEDIR}/${F}"	\
1627
			    >/dev/stderr
1627
			    >/dev/stderr
1628
			touch .err
1628
			touch .err
Lines 1630-1646 Link Here
1630
		fi
1630
		fi
1631
1631
1632
		# Otherwise, output an index line.
1632
		# Otherwise, output an index line.
1633
		if [ -L ${BASEDIR}/${F} ]; then
1633
		if [ -L "${BASEDIR}"/${F} ]; then
1634
			echo -n "${F}|L|"
1634
			echo -n "${F}|L|"
1635
			stat -n -f '%d-%i|%u|%g|%Mp%Lp|%Of|' ${BASEDIR}/${F};
1635
			stat -n -f '%d-%i|%u|%g|%Mp%Lp|%Of|' "${BASEDIR}"/${F};
1636
			readlink ${BASEDIR}/${F};
1636
			readlink "${BASEDIR}"/${F};
1637
		elif [ -f ${BASEDIR}/${F} ]; then
1637
		elif [ -f "${BASEDIR}"/${F} ]; then
1638
			echo -n "${F}|f|"
1638
			echo -n "${F}|f|"
1639
			stat -n -f '%d-%i|%u|%g|%Mp%Lp|%Of|' ${BASEDIR}/${F};
1639
			stat -n -f '%d-%i|%u|%g|%Mp%Lp|%Of|' "${BASEDIR}"/${F};
1640
			sha256 -q ${BASEDIR}/${F};
1640
			sha256 -q "${BASEDIR}"/${F};
1641
		elif [ -d ${BASEDIR}/${F} ]; then
1641
		elif [ -d "${BASEDIR}"/${F} ]; then
1642
			echo -n "${F}|d|"
1642
			echo -n "${F}|d|"
1643
			stat -f '%d-%i|%u|%g|%Mp%Lp|%Of|' ${BASEDIR}/${F};
1643
			stat -f '%d-%i|%u|%g|%Mp%Lp|%Of|' "${BASEDIR}"/${F};
1644
		else
1644
		else
1645
			echo "Unknown file type: ${BASEDIR}/${F}"	\
1645
			echo "Unknown file type: ${BASEDIR}/${F}"	\
1646
			    >/dev/stderr
1646
			    >/dev/stderr
Lines 2281-2287 Link Here
2281
		cut -f 1-3 -d '|' < INDEX-ALL |
2281
		cut -f 1-3 -d '|' < INDEX-ALL |
2282
		    tr '|' ' ' |
2282
		    tr '|' ' ' |
2283
		    while read C S F; do
2283
		    while read C S F; do
2284
			if [ -e ${BASEDIR}/${F} ]; then
2284
			if [ -e "${BASEDIR}"/${F} ]; then
2285
				echo "+ ${C}|${S}"
2285
				echo "+ ${C}|${S}"
2286
			fi
2286
			fi
2287
			echo "= ${C}|${S}"
2287
			echo "= ${C}|${S}"
Lines 2544-2550 Link Here
2544
manually...
2544
manually...
2545
			EOF
2545
			EOF
2546
			read dummy </dev/tty
2546
			read dummy </dev/tty
2547
			${EDITOR} `pwd`/merge/new/${F} < /dev/tty
2547
			${EDITOR} "$PWD/merge/new/${F}" < /dev/tty
2548
		done < failed.merges
2548
		done < failed.merges
2549
		rm failed.merges
2549
		rm failed.merges
2550
2550
Lines 2787-2798 Link Here
2787
2787
2788
	# Remove flags
2788
	# Remove flags
2789
	while read F; do
2789
	while read F; do
2790
		if ! [ -e ${BASEDIR}/${F} ]; then
2790
		if ! [ -e "${BASEDIR}/${F}" ]; then
2791
			continue
2791
			continue
2792
		else
2792
		else
2793
			echo ${BASEDIR}/${F}
2793
			echo "${BASEDIR}/${F}"
2794
		fi
2794
		fi
2795
	done < filelist | xargs chflags noschg || return 1
2795
	done < filelist | tr '\n' '\0' | xargs -0 chflags noschg || return 1
2796
2796
2797
	# Clean up
2797
	# Clean up
2798
	rm filelist
2798
	rm filelist
Lines 2804-2817 Link Here
2804
	while true ; do
2804
	while true ; do
2805
		# Pathname does not exist, so it is OK use that name
2805
		# Pathname does not exist, so it is OK use that name
2806
		# for backup directory.
2806
		# for backup directory.
2807
		if [ ! -e $BASEDIR/$BACKUPKERNELDIR ]; then
2807
		if [ ! -e "$BASEDIR"/$BACKUPKERNELDIR ]; then
2808
			return 0
2808
			return 0
2809
		fi
2809
		fi
2810
2810
2811
		# If directory do exist, we only use if it has our
2811
		# If directory do exist, we only use if it has our
2812
		# marker file.
2812
		# marker file.
2813
		if [ -d $BASEDIR/$BACKUPKERNELDIR -a \
2813
		if [ -d "$BASEDIR"/$BACKUPKERNELDIR -a \
2814
			-e $BASEDIR/$BACKUPKERNELDIR/.freebsd-update ]; then
2814
			-e "$BASEDIR"/$BACKUPKERNELDIR/.freebsd-update ]; then
2815
			return 0
2815
			return 0
2816
		fi
2816
		fi
2817
2817
Lines 2846-2862 Link Here
2846
	# Remove old kernel backup files.  If $BACKUPKERNELDIR was
2846
	# Remove old kernel backup files.  If $BACKUPKERNELDIR was
2847
	# "not ours", backup_kernel_finddir would have exited, so
2847
	# "not ours", backup_kernel_finddir would have exited, so
2848
	# deleting the directory content is as safe as we can make it.
2848
	# deleting the directory content is as safe as we can make it.
2849
	if [ -d $BASEDIR/$BACKUPKERNELDIR ]; then
2849
	if [ -d "$BASEDIR"/$BACKUPKERNELDIR ]; then
2850
		rm -fr $BASEDIR/$BACKUPKERNELDIR
2850
		rm -fr "$BASEDIR"/$BACKUPKERNELDIR
2851
	fi
2851
	fi
2852
2852
2853
	# Create directories for backup.
2853
	# Create directories for backup.
2854
	mkdir -p $BASEDIR/$BACKUPKERNELDIR
2854
	mkdir -p "$BASEDIR"/$BACKUPKERNELDIR
2855
	mtree -cdn -p "${BASEDIR}/${KERNELDIR}" | \
2855
	mtree -cdn -p "${BASEDIR}/${KERNELDIR}" | \
2856
	    mtree -Ue -p "${BASEDIR}/${BACKUPKERNELDIR}" > /dev/null
2856
	    mtree -Ue -p "${BASEDIR}/${BACKUPKERNELDIR}" > /dev/null
2857
2857
2858
	# Mark the directory as having been created by freebsd-update.
2858
	# Mark the directory as having been created by freebsd-update.
2859
	touch $BASEDIR/$BACKUPKERNELDIR/.freebsd-update
2859
	touch "$BASEDIR"/$BACKUPKERNELDIR/.freebsd-update
2860
	if [ $? -ne 0 ]; then
2860
	if [ $? -ne 0 ]; then
2861
		echo "Could not create kernel backup directory"
2861
		echo "Could not create kernel backup directory"
2862
		exit 1
2862
		exit 1
Lines 2874-2881 Link Here
2874
	fi
2874
	fi
2875
2875
2876
	# Backup all the kernel files using hardlinks.
2876
	# Backup all the kernel files using hardlinks.
2877
	(cd ${BASEDIR}/${KERNELDIR} && find . -type f $FINDFILTER -exec \
2877
	(cd "${BASEDIR}"/${KERNELDIR} && find . -type f $FINDFILTER -exec \
2878
	    cp -pl '{}' ${BASEDIR}/${BACKUPKERNELDIR}/'{}' \;)
2878
	    cp -pl '{}' "${BASEDIR}"/${BACKUPKERNELDIR}/'{}' \;)
2879
2879
2880
	# Re-enable patchname expansion.
2880
	# Re-enable patchname expansion.
2881
	set +f
2881
	set +f
Lines 2892-2914 Link Here
2892
		d)
2892
		d)
2893
			# Create a directory
2893
			# Create a directory
2894
			install -d -o ${OWNER} -g ${GROUP}		\
2894
			install -d -o ${OWNER} -g ${GROUP}		\
2895
			    -m ${PERM} ${BASEDIR}/${FPATH}
2895
			    -m ${PERM} "${BASEDIR}"/${FPATH}
2896
			;;
2896
			;;
2897
		f)
2897
		f)
2898
			if [ -z "${LINK}" ]; then
2898
			if [ -z "${LINK}" ]; then
2899
				# Create a file, without setting flags.
2899
				# Create a file, without setting flags.
2900
				gunzip < files/${HASH}.gz > ${HASH}
2900
				gunzip < files/${HASH}.gz > ${HASH}
2901
				install -S -o ${OWNER} -g ${GROUP}	\
2901
				install -S -o ${OWNER} -g ${GROUP}	\
2902
				    -m ${PERM} ${HASH} ${BASEDIR}/${FPATH}
2902
				    -m ${PERM} ${HASH} "${BASEDIR}"/${FPATH}
2903
				rm ${HASH}
2903
				rm ${HASH}
2904
			else
2904
			else
2905
				# Create a hard link.
2905
				# Create a hard link.
2906
				ln -f ${BASEDIR}/${LINK} ${BASEDIR}/${FPATH}
2906
				ln -f "${BASEDIR}"/${LINK} "${BASEDIR}"/${FPATH}
2907
			fi
2907
			fi
2908
			;;
2908
			;;
2909
		L)
2909
		L)
2910
			# Create a symlink
2910
			# Create a symlink
2911
			ln -sfh ${HASH} ${BASEDIR}/${FPATH}
2911
			ln -sfh ${HASH} "${BASEDIR}"/${FPATH}
2912
			;;
2912
			;;
2913
		esac
2913
		esac
2914
	    done
2914
	    done
Lines 2918-2924 Link Here
2918
	    while read FPATH TYPE OWNER GROUP PERM FLAGS HASH LINK; do
2918
	    while read FPATH TYPE OWNER GROUP PERM FLAGS HASH LINK; do
2919
		if [ ${TYPE} = "f" ] &&
2919
		if [ ${TYPE} = "f" ] &&
2920
		    ! [ ${FLAGS} = "0" ]; then
2920
		    ! [ ${FLAGS} = "0" ]; then
2921
			chflags ${FLAGS} ${BASEDIR}/${FPATH}
2921
			chflags ${FLAGS} "${BASEDIR}"/${FPATH}
2922
		fi
2922
		fi
2923
	    done
2923
	    done
2924
}
2924
}
Lines 2940-2952 Link Here
2940
	while read FPATH TYPE; do
2940
	while read FPATH TYPE; do
2941
		case ${TYPE} in
2941
		case ${TYPE} in
2942
		d)
2942
		d)
2943
			rmdir ${BASEDIR}/${FPATH}
2943
			rmdir "${BASEDIR}"/${FPATH}
2944
			;;
2944
			;;
2945
		f)
2945
		f)
2946
			rm ${BASEDIR}/${FPATH}
2946
			rm "${BASEDIR}"/${FPATH}
2947
			;;
2947
			;;
2948
		L)
2948
		L)
2949
			rm ${BASEDIR}/${FPATH}
2949
			rm "${BASEDIR}"/${FPATH}
2950
			;;
2950
			;;
2951
		esac
2951
		esac
2952
	done < killfiles
2952
	done < killfiles
Lines 2973-2979 Link Here
2973
2973
2974
		# Update linker.hints if necessary
2974
		# Update linker.hints if necessary
2975
		if [ -s INDEX-OLD -o -s INDEX-NEW ]; then
2975
		if [ -s INDEX-OLD -o -s INDEX-NEW ]; then
2976
			kldxref -R ${BASEDIR}/boot/ 2>/dev/null
2976
			kldxref -R "${BASEDIR}"/boot/ 2>/dev/null
2977
		fi
2977
		fi
2978
2978
2979
		# We've finished updating the kernel.
2979
		# We've finished updating the kernel.
Lines 3025-3047 Link Here
3025
3025
3026
		# Rehash certs if we actually have certctl installed.
3026
		# Rehash certs if we actually have certctl installed.
3027
		if which certctl>/dev/null; then
3027
		if which certctl>/dev/null; then
3028
			env DESTDIR=${BASEDIR} certctl rehash
3028
# 			env DESTDIR="${BASEDIR}" certctl rehash
3029
		fi
3029
		fi
3030
3030
3031
		# Rebuild generated pwd files and /etc/login.conf.db.
3031
		# Rebuild generated pwd files and /etc/login.conf.db.
3032
		pwd_mkdb -d ${BASEDIR}/etc -p ${BASEDIR}/etc/master.passwd
3032
		pwd_mkdb -d "${BASEDIR}"/etc -p "${BASEDIR}"/etc/master.passwd
3033
		cap_mkdb ${BASEDIR}/etc/login.conf
3033
		cap_mkdb "${BASEDIR}"/etc/login.conf
3034
3034
3035
		# Rebuild man page databases, if necessary.
3035
		# Rebuild man page databases, if necessary.
3036
		for D in /usr/share/man /usr/share/openssl/man; do
3036
		for D in /usr/share/man /usr/share/openssl/man; do
3037
			if [ ! -d ${BASEDIR}/$D ]; then
3037
			if [ ! -d "${BASEDIR}"/$D ]; then
3038
				continue
3038
				continue
3039
			fi
3039
			fi
3040
			if [ -f ${BASEDIR}/$D/mandoc.db ] && \
3040
			if [ -f "${BASEDIR}"/$D/mandoc.db ] && \
3041
			    [ -z "$(find ${BASEDIR}/$D -type f -newer ${BASEDIR}/$D/mandoc.db)" ]; then
3041
			    [ -z "$(find "${BASEDIR}/$D" -type f -newer "${BASEDIR}/$D/mandoc.db")" ]; then
3042
				continue;
3042
				continue;
3043
			fi
3043
			fi
3044
			makewhatis ${BASEDIR}/$D
3044
			makewhatis "${BASEDIR}"/$D
3045
		done
3045
		done
3046
3046
3047
		# We've finished installing the world and deleting old files
3047
		# We've finished installing the world and deleting old files
Lines 3369-3375 Link Here
3369
# set all the parameters which are needed later.
3369
# set all the parameters which are needed later.
3370
get_params () {
3370
get_params () {
3371
	init_params
3371
	init_params
3372
	parse_cmdline $@
3372
	parse_cmdline "$@"
3373
	parse_conffile
3373
	parse_conffile
3374
	default_params
3374
	default_params
3375
}
3375
}
Lines 3426-3435 Link Here
3426
	fi
3426
	fi
3427
	
3427
	
3428
	# Change into working directory (fail if no permission/directory etc.)
3428
	# Change into working directory (fail if no permission/directory etc.)
3429
	cd ${WORKDIR} || exit 1
3429
	cd "${WORKDIR}" || exit 1
3430
3430
3431
	# Construct a unique name from ${BASEDIR}
3431
	# Construct a unique name from ${BASEDIR}
3432
	BDHASH=`echo ${BASEDIR} | sha256 -q`
3432
	BDHASH=`echo "${BASEDIR}" | sha256 -q`
3433
3433
3434
	# Check that we have updates ready to install
3434
	# Check that we have updates ready to install
3435
	if ! [ -L ${BDHASH}-install ]; then
3435
	if ! [ -L ${BDHASH}-install ]; then
Lines 3484-3490 Link Here
3484
# Set LC_ALL in order to avoid problems with character ranges like [A-Z].
3484
# Set LC_ALL in order to avoid problems with character ranges like [A-Z].
3485
export LC_ALL=C
3485
export LC_ALL=C
3486
3486
3487
get_params $@
3487
get_params "$@"
3488
for COMMAND in ${COMMANDS}; do
3488
for COMMAND in ${COMMANDS}; do
3489
	cmd_${COMMAND}
3489
	cmd_${COMMAND}
3490
done
3490
done

Return to bug 268686