From f342266accee6bb5c5685bc8bd5207e60b93377003fd0e3ba9ec8a7073edff55 Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Tue, 18 Sep 2012 11:01:25 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/file?expand=0&rev=51 --- file-5.11-nitpick.dif | 50 +++++++++++++++++++++++++++++++++++++++++++ file.changes | 7 ++++++ file.spec | 6 ++++-- 3 files changed, 61 insertions(+), 2 deletions(-) create mode 100644 file-5.11-nitpick.dif diff --git a/file-5.11-nitpick.dif b/file-5.11-nitpick.dif new file mode 100644 index 0000000..57444c1 --- /dev/null +++ b/file-5.11-nitpick.dif @@ -0,0 +1,50 @@ +--- src/file.c ++++ src/file.c 2012-09-18 10:27:51.094936322 +0000 +@@ -94,10 +94,12 @@ private const char *separator = ":"; /* + private const struct option long_options[] = { + #define OPT(shortname, longname, opt, doc) \ + {longname, opt, NULL, shortname}, ++#define OPT_POSIX OPT + #define OPT_LONGONLY(longname, opt, doc) \ + {longname, opt, NULL, 0}, + #include "file_opts.h" + #undef OPT ++#undef OPT_POSIX + #undef OPT_LONGONLY + {0, 0, NULL, 0} + }; +@@ -487,16 +489,21 @@ usage(void) + private void + help(void) + { ++ const unsigned long posix = (unsigned long)getenv("POSIXLY_CORRECT"); + (void)fputs( + "Usage: file [OPTION...] [FILE...]\n" + "Determine type of FILEs.\n" + "\n", stdout); + #define OPT(shortname, longname, opt, doc) \ + fprintf(stdout, " -%c, --" longname doc, shortname); ++#define OPT_POSIX(shortname, longname, opt, doc) \ ++ fprintf(stdout, " -%c, --" longname doc "%s\n", shortname, \ ++ (shortname == 'L') ? (posix ? " (default)" : "") : (posix ? "" : " (default)")); + #define OPT_LONGONLY(longname, opt, doc) \ + fprintf(stdout, " --" longname doc); + #include "file_opts.h" + #undef OPT ++#undef OPT_POSIX + #undef OPT_LONGONLY + fprintf(stdout, "\nReport bugs to http://bugs.gw.com/\n"); + exit(0); +--- src/file_opts.h ++++ src/file_opts.h 2012-09-18 10:14:38.438397131 +0000 +@@ -34,8 +34,8 @@ OPT_LONGONLY("mime-encoding", 0, " + OPT('k', "keep-going", 0, " don't stop at the first match\n") + #ifdef S_IFLNK + OPT('l', "list", 0, " list magic strength\n") +-OPT('L', "dereference", 0, " follow symlinks (default)\n") +-OPT('h', "no-dereference", 0, " don't follow symlinks\n") ++OPT_POSIX('L', "dereference", 0, " follow symlinks") ++OPT_POSIX('h', "no-dereference", 0, " don't follow symlinks") + #endif + OPT('n', "no-buffer", 0, " do not buffer output\n") + OPT('N', "no-pad", 0, " do not pad output\n") diff --git a/file.changes b/file.changes index e4ed8de..defb54c 100644 --- a/file.changes +++ b/file.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Tue Sep 18 10:24:58 UTC 2012 - werner@suse.de + +- Add small patch to make clear if file follows symbloc links or not + as tihs depend on the environment variable POSIXLY_CORRECT +- Remove the README file as this is for packagers and not for users + ------------------------------------------------------------------- Sun Aug 19 19:22:01 UTC 2012 - giecrilj@stegny.2a.pl diff --git a/file.spec b/file.spec index 575712b..3b742d1 100644 --- a/file.spec +++ b/file.spec @@ -59,6 +59,7 @@ Patch31: file-5.07-biorad.dif Patch32: file-5.07-clicfs.dif Patch33: file-ocloexec.patch Patch34: file-endian.patch +Patch35: file-5.11-nitpick.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _miscdir %{_datadir}/misc @@ -107,8 +108,9 @@ to develop applications that require the magic "file" interface. %patch31 -p0 -b .biorad %patch32 -p0 -b .clicfs %patch33 -p0 -b .clexe +%patch34 -p0 -b .endian +%patch35 -p0 -b .nitpick %patch -b .0 -%patch34 %build export LANG=POSIX export LC_ALL=POSIX @@ -155,7 +157,7 @@ unset LD_LIBRARY_PATH %{_miscdir}/magic.mgc %doc %{_mandir}/man1/file.1.gz %doc %{_mandir}/man5/magic.5.gz -%doc README COPYING AUTHORS NEWS ChangeLog +%doc COPYING AUTHORS NEWS ChangeLog %files -n file-devel %defattr (644,root,root,755)