---
 texmf-dist/scripts/tetex/updmap.pl |   22 ++++++++++++++++++++--
 1 file changed, 20 insertions(+), 2 deletions(-)

--- texlive-base-2012.20121112.orig/texmf-dist/scripts/tetex/updmap.pl
+++ texlive-base-2012.20121112/texmf-dist/scripts/tetex/updmap.pl
@@ -29,7 +29,7 @@
     exit 1;
   }
   chomp($TEXMFROOT);
-  unshift (@INC, "$TEXMFROOT/tlpkg");
+  unshift (@INC, "/usr/share/texlive/tlpkg");
 }
 
 
@@ -299,8 +299,11 @@
     #
     if (@tmlused) {
       my @tmp;
+      chomp(my $TEXMFDEBIAN =`kpsewhich --var-value=TEXMFDEBIAN`);
       for my $f (@used_files) {
-        if ($f =~ m!\Q$TEXMFMAIN/\E!) {
+        # make sure that TEXMFLOCAL is also moved above TEXMFDEBIAN
+        # and do not push it two times!
+        if ($f =~ m!\Q$TEXMFMAIN/\E|\Q$TEXMFDEBIAN/\E!) {
           push @tmp, @tmlused;
           push @tmp, $f;
         } else {
@@ -395,6 +398,21 @@
         print "\t$m (in $orig)\n";
       }
       print "in $changes_config_file\n";
+      print "
+On Debian systems it is not recommendable to use --syncwithtrees.
+We recommend the following actions, according to in which updmap.cfg 
+the map is listed:
+  /usr/share/texmf/web2c/updmap.cfg
+  /usr/share/texlive/texmf-dist/web2c/updmap.cfg
+      -> please run (as root) update-updmap
+  /etc/texmf/web2c/updmap.cfg
+  /usr/local/share/web2c/updmap.cfg
+      -> edit the file and remove the line
+  any other place (esp under your home directory)
+      -> only used if you have user only fonts activated, otherwise
+         this file should not be there
+      -> edit it by hand
+";
       print "Do you really want to continue (y/N)? ";
       my $answer = <STDIN>;
       $answer = "n" if !defined($answer);
