Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 Jul 2013 21:40:32 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r252844 - in head/usr.sbin/bsdconfig/share: . packages
Message-ID:  <201307052140.r65LeWGK092370@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Fri Jul  5 21:40:31 2013
New Revision: 252844
URL: http://svnweb.freebsd.org/changeset/base/252844

Log:
  Add the necessary code to reinstall packages. Both scripted access
  (packageReinstall) and UI access have been tested successfully with a
  variation of different situations including:
  + Reinstall a package for which no other packages depend
  + Purposefully do thinks like reinstall a package that is not installed
  + Try to reinstall a package which other installed packages still depend
  
  NOTE: There is no "force" used; if a package is required by other packages,
  it will not be uninstalled (and therefore no reinstall is done).

Modified:
  head/usr.sbin/bsdconfig/share/packages/packages.subr
  head/usr.sbin/bsdconfig/share/script.subr

Modified: head/usr.sbin/bsdconfig/share/packages/packages.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/packages/packages.subr	Fri Jul  5 21:33:32 2013	(r252843)
+++ head/usr.sbin/bsdconfig/share/packages/packages.subr	Fri Jul  5 21:40:31 2013	(r252844)
@@ -648,7 +648,7 @@ f_package_review()
 		debug= f_getvar _mark_$varpkg mark
 		[ "$mark" = "R" ] || continue
 		f_dprintf "%s: Reinstalling %s package" $fname "$package"
-		# XXX Re-install package
+		f_package_reinstall "$package"
 	done
 	for package in $SELECTED_PACKAGES; do
 		mark=
@@ -1186,6 +1186,15 @@ f_package_delete()
 	fi
 }
 
+# f_package_reinstall $name
+#
+# A simple wrapper to f_package_delete() + f_package_add()
+#
+f_package_reinstall()
+{
+	f_package_delete "$1" && f_package_add "$1"
+}
+
 ############################################################ MAIN
 
 f_dprintf "%s: Successfully loaded." packages/packages.subr

Modified: head/usr.sbin/bsdconfig/share/script.subr
==============================================================================
--- head/usr.sbin/bsdconfig/share/script.subr	Fri Jul  5 21:33:32 2013	(r252843)
+++ head/usr.sbin/bsdconfig/share/script.subr	Fri Jul  5 21:40:31 2013	(r252844)
@@ -196,6 +196,7 @@ f_resword_new configPCNFSD	f_config_pcnf
 f_resword_new configPackages	f_package_config
 f_resword_new packageAdd	f_package_add
 f_resword_new packageDelete	f_package_delete
+f_resword_new packageReinstall	f_package_reinstall
 
 # variable.subr
 f_resword_new installVarDefaults	f_variable_set_defaults



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201307052140.r65LeWGK092370>