Accepting request 18878 from Base:System

Copy from Base:System/popt based on submit request 18878 from user mlschroe

OBS-URL: https://build.opensuse.org/request/show/18878
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/popt?expand=0&rev=1
This commit is contained in:
OBS User autobuild 2009-08-28 13:08:07 +00:00 committed by Git OBS Bridge
commit 58620f6be6
8 changed files with 259 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
.osc

2
baselibs.conf Normal file
View File

@ -0,0 +1,2 @@
libpopt0
arch ppc package popt-devel

119
popt-1.13-popt_fprintf.diff Normal file
View File

@ -0,0 +1,119 @@
Patch by Jeff Johnson <jbj@rpm5.org> for popt >= 1.13, which reverts all POPT_fprintf()
usage cases to avoid broken umlauts in --help output at some non-UTF8 locales. It should
not break anything, just restore the behaviour of popt 1.12 again to not introduce a new
regression. Clueless modified by Robert Scheck <robert@rpm5.org> to hide the last found
two locale regression as well.
--- popt-1.13/popthelp.c 2007-11-04 16:46:25.000000000 +0100
+++ popt-1.13/popthelp.c.popt_fprintf 2007-12-30 22:10:24.000000000 +0100
@@ -281,7 +281,6 @@
char * left;
size_t nb = maxLeftCol + 1;
int displaypad = 0;
- int xx;
/* Make sure there's more than enough room in target buffer. */
if (opt->longName) nb += strlen(opt->longName);
@@ -406,9 +405,9 @@
}
if (help)
- xx = POPT_fprintf(fp," %-*s ", (int)(maxLeftCol+displaypad), left);
+ fprintf(fp," %-*s ", (int)(maxLeftCol+displaypad), left);
else {
- xx = POPT_fprintf(fp," %s\n", left);
+ fprintf(fp," %s\n", left);
goto out;
}
@@ -428,18 +427,19 @@
if (ch == help) break; /* give up */
while (ch > (help + 1) && _isspaceptr(ch))
ch = POPT_prev_char (ch);
- ch++;
+ ch = POPT_next_char(ch);
sprintf(format, "%%.%ds\n%%%ds", (int) (ch - help), (int) indentLength);
/*@-formatconst@*/
- xx = POPT_fprintf(fp, format, help, " ");
+ fprintf(fp, format, help, " ");
/*@=formatconst@*/
help = ch;
- while (_isspaceptr(help) && *help) help++;
+ while (_isspaceptr(help) && *help)
+ help = POPT_next_char(help);
helpLength = strlen(help);
}
- if (helpLength) xx = POPT_fprintf(fp, "%s\n", help);
+ if (helpLength) fprintf(fp, "%s\n", help);
help = NULL;
out:
@@ -553,7 +553,6 @@
{
const struct poptOption * opt;
const char *sub_transdom;
- int xx;
if (table == poptAliasOptions) {
itemHelp(fp, con->aliases, con->numAliases, columns, NULL);
@@ -577,7 +576,7 @@
sub_transdom = translation_domain;
if (opt->descrip)
- xx = POPT_fprintf(fp, "\n%s\n", D_(sub_transdom, opt->descrip));
+ fprintf(fp, "\n%s\n", D_(sub_transdom, opt->descrip));
singleTableHelp(con, fp, opt->arg, columns, sub_transdom);
}
@@ -767,7 +766,7 @@
translation_domain = (const char *)opt->arg;
} else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) {
if (done) {
- int i;
+ int i = done->nopts;
if (done->opts != NULL)
for (i = 0; i < done->nopts; i++) {
const void * that = done->opts[i];
--- popt-1.13/poptint.c 2007-11-04 16:56:24.000000000 +0100
+++ popt-1.13/poptint.c.popt_fprintf 2007-12-30 22:10:24.000000000 +0100
@@ -124,6 +124,18 @@
}
}
+char *
+POPT_next_char (const char *str)
+{
+ char *p = (char *)str;
+
+ while (1) {
+ p++;
+ if ((*p & 0xc0) != (char)0x80)
+ return (char *)p;
+ }
+}
+
int
POPT_fprintf (FILE* stream, const char *format, ...)
{
--- popt-1.13/poptint.h 2007-12-11 19:02:29.000000000 +0100
+++ popt-1.13/poptint.h.popt_fprintf 2007-12-30 22:10:24.000000000 +0100
@@ -144,11 +144,14 @@
#endif
#endif
+char *POPT_prev_char (/*@returned@*/ const char *str)
+ /*@*/;
+
+char *POPT_next_char (/*@returned@*/ const char *str)
+ /*@*/;
+
int POPT_fprintf (FILE* stream, const char *format, ...)
/*@globals fileSystem @*/
/*@modifies stream, fileSystem @*/;
-char *POPT_prev_char (/*@returned@*/ const char *str)
- /*@*/;
-
#endif

3
popt-1.13.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:722b939b14e8b510bbb24e3109a075c7d86b33bec05cb583e76769df9ef2661f
size 682438

10
popt.changes Normal file
View File

@ -0,0 +1,10 @@
-------------------------------------------------------------------
Wed Aug 26 16:08:58 CEST 2009 - mls@suse.de
- add baselibs.conf
-------------------------------------------------------------------
Fri Aug 21 19:30:12 CEST 2009 - mls@suse.de
- initial release

101
popt.spec Normal file
View File

@ -0,0 +1,101 @@
#
# spec file for package popt (Version 1.13)
#
# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: popt
Version: 1.13
Release: 1
#!BuildIgnore: rpmlint-Factory
License: MIT
Summary: A C library for parsing command line parameters
Group: System Environment/Libraries
Url: http://www.rpm5.org/
Source: popt-%{version}.tar.gz
Patch: popt-1.13-popt_fprintf.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Popt is a C library for parsing command line parameters. Popt was
heavily influenced by the getopt() and getopt_long() functions. It
improves on them by allowing more powerful argument expansion. Popt can
parse arbitrary argv[] style arrays and automatically set variables
based on command line arguments. Popt allows command line arguments to
be aliased via configuration files and includes utility functions for
parsing arbitrary strings into argv[] arrays using shell-like rules.
%package -n libpopt0
License: MIT
Summary: A C library for parsing command line parameters
Group: System Environment/Libraries
Provides: popt = %{version}-%{release}
Obsoletes: popt < %{version}
%description -n libpopt0
Popt is a C library for parsing command line parameters. Popt was
heavily influenced by the getopt() and getopt_long() functions. It
improves on them by allowing more powerful argument expansion. Popt can
parse arbitrary argv[] style arrays and automatically set variables
based on command line arguments. Popt allows command line arguments to
be aliased via configuration files and includes utility functions for
parsing arbitrary strings into argv[] arrays using shell-like rules.
%package devel
License: MIT
Summary: Development files for the popt library
Group: Development/Libraries
Requires: libpopt0 = %{version}
%description devel
The popt-devel package includes header files and libraries necessary
for developing programs which use the popt C library. It contains the
API documentation of the popt library, too.
%prep
%setup -q
%patch -p1
%build
%configure --libdir=/%{_lib}
make
%install
make DESTDIR=$RPM_BUILD_ROOT install
rm -f $RPM_BUILD_ROOT/%_lib/libpopt.a
rm -f $RPM_BUILD_ROOT/%_lib/libpopt.la
%clean
rm -rf $RPM_BUILD_ROOT
%post -n libpopt0 -p /sbin/ldconfig
%postun -n libpopt0 -p /sbin/ldconfig
%files -n libpopt0
%defattr(-,root,root)
%doc CHANGES COPYING
/%{_lib}/libpopt.so.*
/usr/share/locale/*/LC_MESSAGES/popt.mo
%files devel
%defattr(-,root,root)
%doc README
/%{_lib}/libpopt.so
%{_includedir}/popt.h
%{_mandir}/man3/popt.3*
%changelog

0
ready Normal file
View File