From: Bruno Haible Date: Fri, 28 Mar 2003 21:50:08 +0000 (+0000) Subject: Rename copy_file to copy_file_preserving. X-Git-Tag: v0.12~139 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc6912e795fa4c22292cc3755c79566e29e7aef8;p=thirdparty%2Fgettext.git Rename copy_file to copy_file_preserving. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index 3ada6c0fb..3bfcd20a0 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,9 @@ +2003-03-28 Bruno Haible + + * copy-file.h (copy_file_preserving): Renamed from copy_file. + * copy-file.c (copy_file_preserving): Renamed from copy_file. + Preserve the owner and group as well. + 2003-02-28 Bruno Haible Support for relocatable installation. diff --git a/gettext-tools/lib/copy-file.c b/gettext-tools/lib/copy-file.c index 84b07ac86..a03047b58 100644 --- a/gettext-tools/lib/copy-file.c +++ b/gettext-tools/lib/copy-file.c @@ -50,7 +50,7 @@ #define _(str) gettext (str) void -copy_file (const char *src_filename, const char *dest_filename) +copy_file_preserving (const char *src_filename, const char *dest_filename) { int src_fd; struct stat statbuf; @@ -108,6 +108,9 @@ copy_file (const char *src_filename, const char *dest_filename) } #endif + /* Preserve the owner and group. */ + chown (dest_filename, statbuf.st_uid, statbuf.st_gid); + /* Preserve the access permissions. */ chmod (dest_filename, mode); } diff --git a/gettext-tools/lib/copy-file.h b/gettext-tools/lib/copy-file.h index 1608ab70c..3efda34b8 100644 --- a/gettext-tools/lib/copy-file.h +++ b/gettext-tools/lib/copy-file.h @@ -1,5 +1,5 @@ /* Copying of files. - Copyright (C) 2001-2002 Free Software Foundation, Inc. + Copyright (C) 2001-2003 Free Software Foundation, Inc. Written by Bruno Haible , 2001. This program is free software; you can redistribute it and/or modify @@ -18,5 +18,7 @@ /* Copy a regular file: from src_filename to dest_filename. The destination file is assumed to be a backup file. + Modification times, owner, group and access permissions are preserved as + far as possible. Exit upon failure. */ -extern void copy_file (const char *src_filename, const char *dest_filename); +extern void copy_file_preserving (const char *src_filename, const char *dest_filename); diff --git a/gettext-tools/src/ChangeLog b/gettext-tools/src/ChangeLog index 35ee8759d..b5e6084f8 100644 --- a/gettext-tools/src/ChangeLog +++ b/gettext-tools/src/ChangeLog @@ -1,3 +1,7 @@ +2003-03-28 Bruno Haible + + * msgmerge.c (main): Use copy_file_preserving instead of copy_file. + 2003-03-16 Bruno Haible * str-list.h (string_list_join): Comment out. diff --git a/gettext-tools/src/msgmerge.c b/gettext-tools/src/msgmerge.c index b134a5b70..347704423 100644 --- a/gettext-tools/src/msgmerge.c +++ b/gettext-tools/src/msgmerge.c @@ -361,7 +361,7 @@ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\ if (backup_type != none) { backup_file = find_backup_file_name (output_file, backup_type); - copy_file (output_file, backup_file); + copy_file_preserving (output_file, backup_file); } /* Write the merged message list out. */