chiark / gitweb /
show instance in upload emails
[ypp-sc-tools.db-test.git] / pctb / dictionary-update-receiver
index 6641dddf9de1f51c504c7fa1f1a3fd268704909c..99a580e46888280c1c589a442edff38c6ea662cc 100755 (executable)
@@ -193,6 +193,18 @@ $dict= $&;
 my ($ctx,$def,$image,$key,$val, $width,$icon,$whole,$entry)=
     &{"parseentryin__$kind"}($entry_in, @xa);
 
+my $du=$ENV{'YPPSC_DICTUPDATES'};
+chdir $du or die "$du $!"
+    if defined $du;
+
+my $instance= $du;
+$instance =~ s,ypp-sc-tools,,ig;
+$instance =~ s,ypp,,ig;
+$instance =~ s,pctb,,ig;
+$instance =~ s,/\W+/,/,g;
+$instance =~ s,/+$,,;
+$instance =~ s,^.*/,,;
+
 #---------- compute the email to send ----------
 
 my $whoami= `whoami`; $? and die $?;
@@ -200,7 +212,7 @@ chomp $whoami;
 
 my $email= <<END
 To: $whoami
-Subject: pctb $dict $ctx $def [ypp-sc-tools]
+Subject: pctb /$instance/ $dict $ctx $def [ypp-sc-tools]
 
 Pirate:     $pirate
 Caller:     $caller
@@ -240,11 +252,6 @@ $email .= $cutline.$entry.$cutline;
 
 #---------- prepare the database entry ----------
 
-my $du=$ENV{'YPPSC_DICTUPDATES'};
-chdir $du or die "$du $!"
-    if defined $du;
-
-
 my $fn_t= "_update.$$-xxxxxxxxxxxxxxxx.tmp";
 open F, "> $fn_t" or die "$fn_t $!";
 (stat F) or die $!;