]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Easier maintenance of archive.tar.gz.
authorBruno Haible <bruno@clisp.org>
Thu, 25 Jul 2002 12:43:37 +0000 (12:43 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:08:41 +0000 (12:08 +0200)
misc/ChangeLog
misc/Makefile.am
misc/add-to-archive [moved from misc/add-to-autopoint-files with 78% similarity]
misc/cvsuser.c [new file with mode: 0644]

index 7ee96865af83de3f3e399942d4b3c4869d045853..95c8cb909a08a63c39cf29357f81e5a0c6cc436f 100644 (file)
@@ -1,3 +1,11 @@
+2002-07-25  Bruno Haible  <bruno@clisp.org>
+
+       * add-to-archive: New file.
+       * add-to-autopoint-files: Remove file.
+       * cvsuser.c: New file.
+       * Makefile.am (EXTRA_DIST): Remove add-to-autopoint-files. Add
+       add-to-archive, cvsuser.c.
+
 2002-07-25  Bruno Haible  <bruno@clisp.org>
 
        * autopoint.in: Unset also CVS_IGNORE_REMOTE_ROOT and CVSIGNORE.
index 97b17dd2b0ae5c64d8b6e8a810db9c93221a714a..89c27b16e42aae568467e4ca7b55356d3caf241e 100644 (file)
@@ -19,7 +19,7 @@
 
 AUTOMAKE_OPTIONS = 1.2 gnits
 
-EXTRA_DIST = gettext.perl gettext-sh tcl_gettext.c README-Tcl add-to-autopoint-files archive.tar.gz $(lisp_LISP)
+EXTRA_DIST = gettext.perl gettext-sh tcl_gettext.c README-Tcl add-to-archive cvsuser.c archive.tar.gz $(lisp_LISP)
 DISTCLEANFILES = gettextize autopoint
 lisp_LISP = po-mode.el po-compat.el
 
similarity index 78%
rename from misc/add-to-autopoint-files
rename to misc/add-to-archive
index a2beabcb102ca3ccafbcbe35174fc9759840774f..c31e8eb70307b3edeab5dc3694f3b832e2272377 100755 (executable)
 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 #
 
-# Usage: add-to-autopoint-files /somewhere/gettext-0.xx.yy.tar.gz
-# Adds the infrastructure files for gettext version 0.xx.yy to the
-# CVS repository in the archive directory.
+# Usage: add-to-archive /somewhere/gettext-0.xx.yy.tar.gz
+# Adds the infrastructure files for gettext version 0.xx.yy to the compressed
+# CVS repository in the archive.tar.gz file.
 
 if test $# != 1; then
-  echo "Usage: add-to-autopoint-files /somewhere/gettext-0.xx.yy.tar.gz"
+  echo "Usage: add-to-archive /somewhere/gettext-0.xx.yy.tar.gz"
   exit 1
 fi
 
@@ -39,6 +39,11 @@ fi
 pack=`echo "$pack_ver" | sed -e 's/^\([^-]*\)-.*/\1/'`
 ver=`echo "$pack_ver" | sed -e 's/^[^-]*-\(.*\)/\1/'`
 
+# Set a nonstandard variable, for a good-looking cvs history.
+cvsuser=bruno
+gcc -shared -O cvsuser.c -o cvsuser.so
+cvsuser_hack=`pwd`/cvsuser.so
+
 # Unpack, build and install the source distribution.
 myprefix=`pwd`/${pack_ver}-inst
 gunzip -c < "$sourcetgz" | tar xvf -
@@ -87,14 +92,20 @@ work_archive=`pwd`/"$work_dir/archive"
 )
 
 # Add the contents of this directory to the repository.
-CVSROOT=`pwd`/autopoint-files
-export CVSROOT
+cvsroot=`pwd`/autopoint-files
+mkdir "$cvsroot"
+cvs -d "$cvsroot" init
+(cd autopoint-files && tar xvfz ../archive.tar.gz)
 cvsver=$pack-`echo "$ver" | sed -e 's/\./_/g'`
 (cd "$work_archive"
- cvs import -m "Import $pack_ver" archive release "$cvsver"
+ CVSUSER=$cvsuser LD_PRELOAD=$cvsuser_hack \
+ cvs -d "$cvsroot" import -m "Import $pack_ver" archive release "$cvsver"
 )
+(cd autopoint-files && tar cvfz ../archive.tar.gz --owner=root --group=root archive)
+(cd autopoint-files && du archive)
 
 # Clean up.
+rm -rf "$cvsroot"
 rm -rf "$work_dir"
 rm -rf "$myprefix"
 
diff --git a/misc/cvsuser.c b/misc/cvsuser.c
new file mode 100644 (file)
index 0000000..67e6ae3
--- /dev/null
@@ -0,0 +1,40 @@
+/* Enable a variable CVSUSER for cvs.  */
+/* See cvs/subr.c: getcaller().  */
+
+#include <stdlib.h>
+#include <string.h>
+#include <pwd.h>
+
+int getuid (void)
+{
+  return 0;
+}
+
+char * getlogin (void)
+{
+  char *s;
+
+  s = getenv ("CVSUSER");
+  if (s && *s)
+    return s;
+  s = getenv ("USER");
+  if (s && *s)
+    return s;
+  return NULL;
+}
+
+struct passwd * getpwnam (const char *name)
+{
+  static struct passwd pw;
+  static char namebuf[100];
+
+  pw.pw_name = strcpy (namebuf, name);
+  pw.pw_passwd = "*";
+  pw.pw_uid = 100;
+  pw.pw_gid = 100;
+  pw.pw_gecos = "";
+  pw.pw_dir = "/";
+  pw.pw_shell = "/bin/sh";
+
+  return &pw;
+}