summaryrefslogtreecommitdiff
path: root/Master/setuptl/TLPM/common.pm
diff options
context:
space:
mode:
authorStaszek Wawrykiewicz <staw@gust.org.pl>2007-01-22 23:52:20 +0000
committerStaszek Wawrykiewicz <staw@gust.org.pl>2007-01-22 23:52:20 +0000
commit8027c99f372cc214604cb68dc9ed0e2643a634a0 (patch)
tree85bb0ae0c7326f653fd0ec2a8877204b6dc5dfd7 /Master/setuptl/TLPM/common.pm
parente1a058df6a05c82f595065a81b9b495776a67d86 (diff)
tlpmgui 1.61
git-svn-id: svn://tug.org/texlive/trunk@3696 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/setuptl/TLPM/common.pm')
-rw-r--r--Master/setuptl/TLPM/common.pm30
1 files changed, 21 insertions, 9 deletions
diff --git a/Master/setuptl/TLPM/common.pm b/Master/setuptl/TLPM/common.pm
index a9e9cfcfc2d..b3cfe655bc0 100644
--- a/Master/setuptl/TLPM/common.pm
+++ b/Master/setuptl/TLPM/common.pm
@@ -1,4 +1,4 @@
-# This file belongs to TLPM v2.19, TeX Live Package Manager
+# This file belongs to TLPM v2.20, TeX Live Package Manager
# Public Domain, P.Jackowski@gust.org.pl
# common procedures;
@@ -119,9 +119,11 @@ sub set
$message_prefix = '% ';
$warning_prefix = '! ';
+$messdbg_prefix = '? ';
$_message = sub {return "$message_prefix$_[0]\n"};
$_warning = sub {return "$warning_prefix$_[0]\n"};
+$_messdbg = sub {return "$messdbg_prefix$_[0]\n"};
# printing to non-existing handle produce 'Bad file descriptor' error;
# we don't have fork so printing to log and terminal needs to be parallel;
@@ -173,7 +175,24 @@ sub not2log
$warning = \&_warning;
}
-&not2log();
+sub enable_dbg
+{
+ $debug_mode = 1;
+ $messdbg = sub {print STDOUT $_messdbg -> (@_)}
+}
+
+sub disable_dbg
+{
+ $debug_mode = 0;
+ $messdbg = \&relax
+}
+
+# -)
+
+sub relax
+{
+ return; # not zero!
+}
# singular vs plural
@@ -231,11 +250,4 @@ sub percent
return sprintf("%d%%",$_[0]*100/$_[1]);
}
-# -)
-
-sub relax
-{
- return; # not zero!
-}
-
1;