? intltool-srcdir.diff
? intltool-update.in.in.new
Index: intltool-po-Makefile.in.in-patch-1
===================================================================
RCS file: /cvs/gnome/intltool/intltool-po-Makefile.in.in-patch-1,v
retrieving revision 1.3
diff -u -r1.3 intltool-po-Makefile.in.in-patch-1
--- intltool-po-Makefile.in.in-patch-1	2001/10/01 19:12:49	1.3
+++ intltool-po-Makefile.in.in-patch-1	2002/02/25 23:44:03
@@ -16,8 +16,8 @@
 +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
 +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
 + 
-+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --dist
-+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --pot
++MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --srcdir $(srcdir) --dist
++GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --srcdir $(srcdir) --pot
 +
  
  DEFS = @DEFS@
Index: intltool-po-Makefile.in.in-patch-2
===================================================================
RCS file: /cvs/gnome/intltool/intltool-po-Makefile.in.in-patch-2,v
retrieving revision 1.3
diff -u -r1.3 intltool-po-Makefile.in.in-patch-2
--- intltool-po-Makefile.in.in-patch-2	2001/10/01 19:12:49	1.3
+++ intltool-po-Makefile.in.in-patch-2	2002/02/25 23:44:03
@@ -8,8 +8,8 @@
 +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
 +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
 +
-+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --dist
-+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --pot
++MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --srcdir $(srcdir) --dist
++GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --srcdir $(srcdir) --pot
 +
 
  DEFS = @DEFS@
Index: intltool-po-Makefile.in.in-patch-3
===================================================================
RCS file: /cvs/gnome/intltool/intltool-po-Makefile.in.in-patch-3,v
retrieving revision 1.2
diff -u -r1.2 intltool-po-Makefile.in.in-patch-3
--- intltool-po-Makefile.in.in-patch-3	2001/10/29 20:19:51	1.2
+++ intltool-po-Makefile.in.in-patch-3	2002/02/25 23:44:03
@@ -15,8 +15,8 @@
 -MSGMERGE = PATH=../src:$$PATH msgmerge
 +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
 +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
-+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
-+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
++MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --srcdir $(srcdir) --dist
++GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --srcdir $(srcdir) --pot
  
  DEFS = @DEFS@
  CFLAGS = @CFLAGS@
Index: intltool-po-Makefile.in.in-patch-4
===================================================================
RCS file: /cvs/gnome/intltool/intltool-po-Makefile.in.in-patch-4,v
retrieving revision 1.1
diff -u -r1.1 intltool-po-Makefile.in.in-patch-4
--- intltool-po-Makefile.in.in-patch-4	2002/01/31 18:11:34	1.1
+++ intltool-po-Makefile.in.in-patch-4	2002/02/25 23:44:03
@@ -15,8 +15,8 @@
 -MSGMERGE = PATH=../src:$$PATH msgmerge
 +INTLTOOL_UPDATE = @INTLTOOL_UPDATE@
 +INTLTOOL_EXTRACT = @INTLTOOL_EXTRACT@
-+MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --dist
-+GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --pot
++MSGMERGE = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --srcdir $(srcdir) --dist
++GENPOT   = INTLTOOL_EXTRACT=$(INTLTOOL_EXTRACT) $(INTLTOOL_UPDATE) --gettext-package $(GETTEXT_PACKAGE) --srcdir $(srcdir) --pot
  
  DEFS = @DEFS@
  CFLAGS = @CFLAGS@
Index: intltool-update.in.in
===================================================================
RCS file: /cvs/gnome/intltool/intltool-update.in.in,v
retrieving revision 1.61
diff -u -r1.61 intltool-update.in.in
--- intltool-update.in.in	2002/02/25 22:40:32	1.61
+++ intltool-update.in.in	2002/02/25 23:44:03
@@ -50,6 +50,7 @@
 my $REPORT_ARG     = 0;
 my $VERBOSE	   = 0;
 my $GETTEXT_PACKAGE = "";
+my $srcdir         = ".";
 
 my @languages;
 my %po_files_by_lang = ();
@@ -90,6 +91,7 @@
  "report|r"	       => \$REPORT_ARG,
  "verbose|x"	       => \$VERBOSE,
  "gettext-package|g=s" => \$GETTEXT_PACKAGE,
+ "srcdir=s"            => \$srcdir,
  ) or &print_error_invalid_option;
 
 my $MODULE;
@@ -247,7 +249,7 @@
 	push @buf_i18n_ini, "$File::Find::name" if /\.($ini_extension)$/ 
 	}, "..";
 
-    open POTFILES, "POTFILES.in" || die "$PROGRAM:  there's no POTFILES.in!\n";
+    open POTFILES, "$srcdir/POTFILES.in" || die "$PROGRAM:  there's no $srcdir/POTFILES.in!\n";
 
     @buf_potfiles = grep /^[^#]/, <POTFILES>;
 			    
@@ -255,7 +257,7 @@
 
     ## Check if we should ignore some found files, when
     ## comparing with POTFILES.in
-    foreach my $ignore ("POTFILES.skip", "POTFILES.ignore") {
+    foreach my $ignore ("$srcdir/POTFILES.skip", "$srcdir/POTFILES.ignore") {
         if (-s $ignore) {
             open FILE, $ignore;
             while (<FILE>) {
@@ -415,7 +417,7 @@
     }
     else
     {
-        open FILE, "<POTFILES.in";
+        open FILE, "<$srcdir/POTFILES.in";
         while (<FILE>) {
            chomp;
 
@@ -445,10 +447,10 @@
 
     print "Building the $MODULE.pot...\n" if $VERBOSE;
 
-    move ("POTFILES.in", "POTFILES.in.old");
+    move ("$srcdir/POTFILES.in", "$srcdir/POTFILES.in.old");
 
-    open INFILE, "<POTFILES.in.old";
-    open OUTFILE, ">POTFILES.in";
+    open INFILE, "<$srcdir/POTFILES.in.old";
+    open OUTFILE, ">$srcdir/POTFILES.in";
     while (<INFILE>) {
         s/\.($xml_extension|$ini_extension)$/$&.h/;
         s/^\[.*]\s*(.*)/$1.h/;
@@ -458,24 +460,24 @@
     close INFILE;
 
     system ("xgettext", "--default-domain\=$MODULE", 
-			"--directory\=\.\.",
+			"--directory\=$srcdir/\.\.",
 	   		"--add-comments", 
 			"--keyword\=\_", 
 			"--keyword\=N\_", 
 			"--keyword\=U\_",
-	   		"--files-from\=\.\/POTFILES\.in");
+	   		"--files-from\=$srcdir\/POTFILES\.in");
 
     -e "$MODULE.po" || die "$PROGRAM: $MODULE.po does not exist.\n";
-    system ("rm", "-f", "$MODULE.pot");
-    move ("$MODULE.po", "$MODULE.pot") || die "$PROGRAM: couldn't move $MODULE.po to $MODULE.pot.\n";
+    system ("rm", "-f", "$srcdir/$MODULE.pot");
+    move ("$MODULE.po", "$srcdir/$MODULE.pot") || die "$PROGRAM: couldn't move $MODULE.po to $MODULE.pot.\n";
 
-    print "Wrote $MODULE.pot\n" if $VERBOSE;
+    print "Wrote $srcdir/$MODULE.pot\n" if $VERBOSE;
 
-    move ("POTFILES.in.old", "POTFILES.in");
+    move ("$srcdir/POTFILES.in.old", "$srcdir/POTFILES.in");
 
     print "Removing generated header (.h) files..." if $VERBOSE;
 
-    open FILE, "<POTFILES.in";
+    open FILE, "<$srcdir/POTFILES.in";
 
     while (<FILE>)
     {
@@ -493,12 +495,12 @@
 
     print "Merging $lang.po with $MODULE.pot..." if $VERBOSE;
 
-    copy ("$lang.po", "$lang.po.old") || die "copy failed: $!";
+    copy ("$srcdir/$lang.po", "$srcdir/$lang.po.old") || die "copy failed: $!";
 
     # Perform merge, remove backup file and the "messages" trash file 
     # generated by gettext
-    system ("msgmerge", "$lang.po.old", "$MODULE.pot", "-o", "$lang.po");
-    unlink "$lang.po.old";
+    system ("msgmerge", "$srcdir/$lang.po.old", "$srcdir/$MODULE.pot", "-o", "$srcdir/$lang.po");
+    unlink "$srcdir/$lang.po.old";
     unlink "messages";
 }
 
