New commits:
commit 11a4e0cbb8a0d147dd0a4a6bddc0d2a6eb5c224b
Author: Sukneet Basuta <sukneet AT sourcemage.org>
Commit: Sukneet Basuta <sukneet AT sourcemage.org>
tzdata: add config_query to ask if sorcery should manage /etc/localtime
- only install local timezone if requested to
- remove files that should be hard linked, in the case they are actual
files and not links (should adress Arjan's issue)
* hard_linked_files: added, list of files that should be hard links
* FINAL: added, provide instructions if the SA decided to manually manage
/etc/localtime
diff --git a/libs/tzdata/CONFIGURE b/libs/tzdata/CONFIGURE
index 7e40427..dd0700b 100755
--- a/libs/tzdata/CONFIGURE
+++ b/libs/tzdata/CONFIGURE
@@ -1,11 +1,15 @@
-message "\nThe answer to the next query is saved - you do not need to
reselect your" &&
-message "local time zone, unless this spell was cast with the reconfigure
flag." &&
-if query "Would you like to select your local time zone? (otherwise UTC will
be selected)" n; then
- persistent_add LOCAL_TIMEZONE &&
- LOCAL_TIMEZONE=`dialog --backtitle "Time Zone Configuration" \
- --title "Time Zone Selection" \
- --stdout \
- --radiolist "Please select your local time
zone.\nUTC will be selected if nothing else is." \
- 0 0 0 \
- --file "$SCRIPT_DIRECTORY"/timezones`
+config_query SET_LOCALTIME "Would you like sorcery to manage your local time
zone (/etc/localtime)?" y &&
+
+if [ $SET_LOCALTIME == "y" ]; then
+ message "\nThe answer to the next query is saved - you do not need to
reselect your" &&
+ message "local time zone, unless this spell was cast with the reconfigure
flag." &&
+ if query "Would you like to select your local time zone? (otherwise UTC
will be selected)" n; then
+ persistent_add LOCAL_TIMEZONE &&
+ LOCAL_TIMEZONE=`dialog --backtitle "Time Zone Configuration"
\
+ --title "Time Zone Selection"
\
+ --stdout
\
+ --radiolist "Please select your local time
zone.\nUTC will be selected if nothing else is." \
+ 0 0 0
\
+ --file "$SCRIPT_DIRECTORY"/timezones`
+ fi
fi
diff --git a/libs/tzdata/FINAL b/libs/tzdata/FINAL
new file mode 100755
index 0000000..484c584
--- /dev/null
+++ b/libs/tzdata/FINAL
@@ -0,0 +1,10 @@
+if [ $SET_LOCALTIME == "n" ]; then
+ message "${MESSAGE_COLOR}/etc/localtime was not set."
+ message "To manually link /etc/localtime to your local time zone,"
+ message "either create a symlink with ln"
+ message "(i.e. ln -sf /usr/share/zoneinfo/your/timezone /etc/localtime)"
+ message "or with zic -l your/timezone. Note that zic may fail on systems"
+ message "with /usr mounted on a separate partition."
+ message "Alternatively, you may copy your local time zone to
/etc/localtime."
+ message "Look under /usr/share/zoneinfo for the available time
zones.${DEFAULT_COLOR}"
+fi
diff --git a/libs/tzdata/HISTORY b/libs/tzdata/HISTORY
index 31c6cfb..368cf4d 100644
--- a/libs/tzdata/HISTORY
+++ b/libs/tzdata/HISTORY
@@ -1,3 +1,12 @@
+2012-05-22 Sukneet Basuta <sukneet AT sourcemage.org>
+ * CONFIGURE: add config_query to ask if sorcery should manage
/etc/localtime
+ * INSTALL: only install local timezone if requested to
+ remove files that should be hard linked, in the case they
+ are actual files and not links
+ * hard_linked_files: added, list of files that should be hard links
+ * FINAL: added, provide instructions if the SA decided to manually
+ manage /etc/localtime
+
2012-05-19 Arjan Bouter <abouter AT sourcemage.org>
* INSTALL: use ln instead of zic -l to avoid failure if /etc and /usr
are on
different partitions
diff --git a/libs/tzdata/INSTALL b/libs/tzdata/INSTALL
index db96231..215f31a 100755
--- a/libs/tzdata/INSTALL
+++ b/libs/tzdata/INSTALL
@@ -4,19 +4,31 @@ TIMEZONES=('africa' 'antarctica' 'asia' 'australasia'
'backward' 'etcetera' \
'europe' 'factory' 'northamerica' 'pacificnew' 'solar87' \
'solar88' 'solar89' 'southamerica' 'systemv')
-if [ -z "$LOCAL_TIMEZONE" ]; then
- LOCAL_TIMEZONE="UTC"
+# Remove files that should be hard linked, in case they are not
+if [ -d ${INSTALL_ROOT}/usr/share/zoneinfo ]; then
+ while read FILE; do
+ if [ -e $FILE ]; then
+ rm ${INSTALL_ROOT}/$FILE
+ fi
+ done < ${SCRIPT_DIRECTORY}/hl
fi &&
-echo "Local TIme Zone: " $LOCAL_TIMEZONE &&
zic -y ./yearistype -d ${INSTALL_ROOT}/usr/share/zoneinfo ${TIMEZONES[@]}
&&
zic -y ./yearistype -d ${INSTALL_ROOT}/usr/share/zoneinfo/posix
${TIMEZONES[@]} &&
zic -y ./yearistype -d ${INSTALL_ROOT}/usr/share/zoneinfo/right -L
leapseconds ${TIMEZONES[@]} &&
-# zic -l breaks if /etc and /usr are on different partitions
-#zic -y ./yearistype -d ${INSTALL_ROOT}/usr/share/zoneinfo -l
"$LOCAL_TIMEZONE" &&
-ln -sf ${INSTALL_ROOT}/usr/share/zoneinfo/$LOCAL_TIMEZONE
${INSTALL_ROOT}/etc/localtime &&
#If you want POSIX compatibility, use "America/New_York".
zic -y ./yearistype -d ${INSTALL_ROOT}/usr/share/zoneinfo -p
America/New_York &&