+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.
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
# 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
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 -
)
# 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"
--- /dev/null
+/* 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;
+}