From 95a31272493ae4d74180aa9cfaffe6dd2b3c2231 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=A2=B3=E7=A2=A7=E6=B9=96=E7=9A=84=E7=A0=8D=E6=9F=B4?= =?UTF-8?q?=E4=BA=BA?= Date: Thu, 9 Jan 2020 15:58:01 +0800 Subject: [PATCH] remove useless patch --- libpaper-file-leak.patch | 22 --------- libpaper-useglibcfallback.patch | 80 --------------------------------- libpaper.spec | 11 ++--- 3 files changed, 4 insertions(+), 109 deletions(-) delete mode 100644 libpaper-file-leak.patch delete mode 100644 libpaper-useglibcfallback.patch diff --git a/libpaper-file-leak.patch b/libpaper-file-leak.patch deleted file mode 100644 index 47b878b..0000000 --- a/libpaper-file-leak.patch +++ /dev/null @@ -1,22 +0,0 @@ -diff -up libpaper-1.1.24+nmu5/lib/paper.c.file-leak libpaper-1.1.24+nmu5/lib/paper.c ---- libpaper-1.1.24+nmu5/lib/paper.c.file-leak 2018-03-09 16:21:01.028345956 +0100 -+++ libpaper-1.1.24+nmu5/lib/paper.c 2018-03-09 16:40:57.824279357 +0100 -@@ -140,7 +140,7 @@ char* systempapername(void) { - char* paperstr; - char* paperenv; - const char* paperdef; -- FILE* ps; -+ FILE* ps = NULL; - struct stat statbuf; - const struct paper* pp; - int c; -@@ -224,6 +224,9 @@ PAPERSIZEVAR, fall-back to the old behav - } - } - -+ if (ps) -+ fclose(ps); -+ - paperdef = defaultpapername(); - paperstr = malloc((strlen(paperdef) + 1) * sizeof(char)); - diff --git a/libpaper-useglibcfallback.patch b/libpaper-useglibcfallback.patch deleted file mode 100644 index 1216055..0000000 --- a/libpaper-useglibcfallback.patch +++ /dev/null @@ -1,80 +0,0 @@ -diff -up libpaper-1.1.24+nmu3/lib/paper.c.useglibcfallback libpaper-1.1.24+nmu3/lib/paper.c ---- libpaper-1.1.24+nmu3/lib/paper.c.useglibcfallback 2010-04-24 08:12:11.000000000 -0400 -+++ libpaper-1.1.24+nmu3/lib/paper.c 2014-04-22 15:58:33.120039001 -0400 -@@ -20,6 +20,9 @@ - - #include - -+#include -+#include -+ - #include "paper.h" - - struct paper { -@@ -108,6 +111,27 @@ in PAPERCONFVAR, fall-back to the old be - } - - const char* defaultpapername(void) { -+#if defined(LC_PAPER) && defined(_GNU_SOURCE) -+ -+#define NL_PAPER_GET(x) \ -+ ((union { char *string; unsigned int word; })nl_langinfo(x)).word -+ -+#define PT_TO_MM(v) (unsigned int)((v * 2.54 * 10 / 72) + 0.5) -+ -+ const struct paper* pp; -+ -+ unsigned int w = NL_PAPER_GET(_NL_PAPER_WIDTH); -+ unsigned int h = NL_PAPER_GET(_NL_PAPER_HEIGHT); -+ -+ for (pp = paperfirst(); pp; pp = papernext(pp)) { -+ if ( -+ PT_TO_MM(pp->pswidth) == w && -+ PT_TO_MM(pp->psheight) == h -+ ) { -+ return pp->name; -+ } -+ } -+#endif - return PAPERSIZE; - } - -diff -up libpaper-1.1.24+nmu3/man/paperconf.1.in.useglibcfallback libpaper-1.1.24+nmu3/man/paperconf.1.in ---- libpaper-1.1.24+nmu3/man/paperconf.1.in.useglibcfallback 2014-04-22 15:58:33.121038995 -0400 -+++ libpaper-1.1.24+nmu3/man/paperconf.1.in 2014-04-22 16:00:15.973428376 -0400 -@@ -48,10 +48,12 @@ looking in order at the - .B @PAPERSIZEVAR@ - environment variable, at the contents of the file specified by the - .B @PAPERCONFVAR@ --environment variable, at the contents of -+environment variable, at the contents of the file - .B @PAPERCONF@ --or by using --.B letter -+, consulting the values controlled by the -+.B LC_PAPER -+locale setting, or by using -+.B @PAPERSIZE@ - as a fall-back value if none of the other alternatives are successful. - By default, width and height of the paper are printed in PostScript points. - .SH OPTIONS -diff -up libpaper-1.1.24+nmu3/src/paperconf.c.useglibcfallback libpaper-1.1.24+nmu3/src/paperconf.c ---- libpaper-1.1.24+nmu3/src/paperconf.c.useglibcfallback 2012-05-03 15:05:12.000000000 -0400 -+++ libpaper-1.1.24+nmu3/src/paperconf.c 2014-04-22 15:58:33.121038995 -0400 -@@ -13,6 +13,7 @@ - #include - - #include -+#include - - - /* needed for GNU/Hurd */ -@@ -99,6 +100,8 @@ int main(int argc, char** argv) - - const char* progname; - -+ setlocale(LC_ALL, ""); -+ - progname = strrchr(*argv, '/'); - if (progname) { - ++progname; diff --git a/libpaper.spec b/libpaper.spec index 9d79cff..0662d78 100644 --- a/libpaper.spec +++ b/libpaper.spec @@ -1,17 +1,11 @@ Name: libpaper Version: 1.1.24 -Release: 23 +Release: 24 Summary: Library for handling paper characteristics License: GPLv2 URL: http://packages.qa.debian.org/libp/libpaper.html Source0: http://ftp.debian.org/debian/pool/main/libp/libpaper/%{name}_%{version}+nmu4.tar.gz -# Patch to let libpaper fallback through LC_PAPER before defaulting to "letter" -# http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=481213 -Patch0: libpaper-useglibcfallback.patch -# Memory leak -Patch1: libpaper-file-leak.patch - BuildRequires: gcc, libtool, gettext, gawk %description @@ -81,5 +75,8 @@ done %{_mandir}/man3/* %changelog +* Thu Jan 05 2020 openEuler Buildteam - 1.1.24-24 +- remove useless patch + * Thu Sep 05 2019 openEuler Buildteam - 1.1.24-23 - Package init -- Gitee