Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 2013 01:32:24 +0000 (UTC)
From:      Devin Teske <dteske@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r247747 - stable/8/usr.sbin/tzsetup
Message-ID:  <201303040132.r241WOOv069252@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dteske
Date: Mon Mar  4 01:32:24 2013
New Revision: 247747
URL: http://svnweb.freebsd.org/changeset/base/247747

Log:
  MFC r230299:
  
  Fix #ifdef VERBOSE for UTC case
  
  Update verbose output to match what actually happens when selecting
  the UTC option, and when the -n option is used.
  
  Patch updated slightly for new libdialog.
  
  PR:		bin/164042
  Submitted by:	dteske

Modified:
  stable/8/usr.sbin/tzsetup/tzsetup.c

Modified: stable/8/usr.sbin/tzsetup/tzsetup.c
==============================================================================
--- stable/8/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 01:22:07 2013	(r247746)
+++ stable/8/usr.sbin/tzsetup/tzsetup.c	Mon Mar  4 01:32:24 2013	(r247747)
@@ -544,16 +544,19 @@ install_zoneinfo_file(const char *zonein
 		copymode = 1;
 
 #ifdef VERBOSE
-	if (copymode)
+	snprintf(title, sizeof(title), "Info");
+	if (zoneinfo_file == NULL)
+		snprintf(prompt, sizeof(prompt),
+		    "Removing %s", path_localtime);
+	else if (copymode)
 		snprintf(prompt, sizeof(prompt),
 		    "Copying %s to %s", zoneinfo_file, path_localtime);
 	else
 		snprintf(prompt, sizeof(prompt),
 		    "Creating symbolic link %s to %s",
-		    path_localtime,
-		    zoneinfo_file == NULL ? "(UTC)" : zoneinfo_file);
+		    path_localtime, zoneinfo_file);
 	if (usedialog)
-		dialog_notify(prompt);
+		dialog_mesgbox(title, prompt, 8, 72);
 	else
 		fprintf(stderr, "%s\n", prompt);
 #endif
@@ -584,6 +587,10 @@ install_zoneinfo_file(const char *zonein
 
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
+#ifdef VERBOSE
+			snprintf(prompt, sizeof(prompt),
+			    "Removed %s", path_localtime);
+#endif
 			return (DITEM_LEAVE_MENU);
 		}
 
@@ -682,23 +689,23 @@ install_zoneinfo_file(const char *zonein
 				return (DITEM_FAILURE | DITEM_RECREATE);
 			}
 		}
-	}
 
 #ifdef VERBOSE
-	snprintf(title, sizeof(title), "Done");
-	if (copymode)
-		snprintf(prompt, sizeof(prompt),
-		    "Copied timezone file from %s to %s", zoneinfo_file,
-		    path_localtime);
-	else
-		snprintf(prompt, sizeof(prompt),
-		    "Created symbolic link from %s to %s", zoneinfo_file,
-		    path_localtime);
-	if (usedialog)
-		dialog_mesgbox(title, prompt, 8, 72);
-	else
-		fprintf(stderr, "%s\n", prompt);
+		snprintf(title, sizeof(title), "Done");
+		if (copymode)
+			snprintf(prompt, sizeof(prompt),
+			    "Copied timezone file from %s to %s",
+			    zoneinfo_file, path_localtime);
+		else
+			snprintf(prompt, sizeof(prompt),
+			    "Created symbolic link from %s to %s",
+			    zoneinfo_file, path_localtime);
+		if (usedialog)
+			dialog_mesgbox(title, prompt, 8, 72);
+		else
+			fprintf(stderr, "%s\n", prompt);
 #endif
+	} /* reallydoit */
 
 	return (DITEM_LEAVE_MENU);
 }



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