From: Bruno Haible Date: Thu, 25 Jul 2002 12:43:37 +0000 (+0000) Subject: Easier maintenance of archive.tar.gz. X-Git-Tag: v0.11.4~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=60d87aaac75ab59427b5ad0bed9bedbb11921aad;p=thirdparty%2Fgettext.git Easier maintenance of archive.tar.gz. --- diff --git a/misc/ChangeLog b/misc/ChangeLog index 7ee96865a..95c8cb909 100644 --- a/misc/ChangeLog +++ b/misc/ChangeLog @@ -1,3 +1,11 @@ +2002-07-25 Bruno Haible + + * 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 * autopoint.in: Unset also CVS_IGNORE_REMOTE_ROOT and CVSIGNORE. diff --git a/misc/Makefile.am b/misc/Makefile.am index 97b17dd2b..89c27b16e 100644 --- a/misc/Makefile.am +++ b/misc/Makefile.am @@ -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 diff --git a/misc/add-to-autopoint-files b/misc/add-to-archive similarity index 78% rename from misc/add-to-autopoint-files rename to misc/add-to-archive index a2beabcb1..c31e8eb70 100755 --- a/misc/add-to-autopoint-files +++ b/misc/add-to-archive @@ -17,12 +17,12 @@ # 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 index 000000000..67e6ae394 --- /dev/null +++ b/misc/cvsuser.c @@ -0,0 +1,40 @@ +/* Enable a variable CVSUSER for cvs. */ +/* See cvs/subr.c: getcaller(). */ + +#include +#include +#include + +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; +}