]> TLD Linux GIT Repositories - packages/coreutils.git/blob - coreutils-getgid.patch
- merged 9.5 from PLD
[packages/coreutils.git] / coreutils-getgid.patch
1 diff -urNp -x '*.orig' coreutils-8.32.org/README coreutils-8.32/README
2 --- coreutils-8.32.org/README   2020-01-01 15:13:12.000000000 +0100
3 +++ coreutils-8.32/README       2021-03-21 00:28:40.313899186 +0100
4 @@ -9,7 +9,7 @@ The programs that can be built with this
5  
6    [ arch b2sum base32 base64 basename basenc cat chcon chgrp chmod chown
7    chroot cksum comm coreutils cp csplit cut date dd df dir dircolors dirname
8 -  du echo env expand expr factor false fmt fold groups head hostid hostname
9 +  du echo env expand expr factor false fmt fold getgid groups head hostid hostname
10    id install join kill link ln logname ls md5sum mkdir mkfifo mknod mktemp
11    mv nice nl nohup nproc numfmt od paste pathchk pinky pr printenv printf ptx
12    pwd readlink realpath rm rmdir runcon seq sha1sum sha224sum sha256sum
13 diff -urNp -x '*.orig' coreutils-8.32.org/build-aux/gen-lists-of-programs.sh coreutils-8.32/build-aux/gen-lists-of-programs.sh
14 --- coreutils-8.32.org/build-aux/gen-lists-of-programs.sh       2018-12-31 13:19:23.000000000 +0100
15 +++ coreutils-8.32/build-aux/gen-lists-of-programs.sh   2021-03-21 00:28:40.314899186 +0100
16 @@ -71,6 +71,7 @@ normal_progs='
17      false
18      fmt
19      fold
20 +    getgid
21      ginstall
22      groups
23      head
24 diff -urNp -x '*.orig' coreutils-8.32.org/man/getgid.1 coreutils-8.32/man/getgid.1
25 --- coreutils-8.32.org/man/getgid.1     1970-01-01 01:00:00.000000000 +0100
26 +++ coreutils-8.32/man/getgid.1 2021-03-21 00:28:40.314899186 +0100
27 @@ -0,0 +1,22 @@
28 +.TH GETGID "1" "October 2002" "getgid (coreutils) 4.5.3" "User Commands"
29 +.SH NAME
30 +getgid \- print ID of given group
31 +.SH SYNOPSIS
32 +.B getgid
33 +\fIGROUPNAME\fR
34 +.SH DESCRIPTION
35 +.PP
36 +Print group ID for GROUPNAME.
37 +.PP
38 +Without any OPTION, print usage information.
39 +.SH AUTHOR
40 +Written by Artur Frysiak.
41 +.SH "REPORTING BUGS"
42 +Report bugs to <feedback@pld-linux.org>.
43 +.SH COPYRIGHT
44 +Copyright \(co 1999 Artur Frysiak.
45 +.br
46 +This is free software; see the source for copying conditions.  There is NO
47 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
48 +.SH "SEE ALSO"
49 +.BR id (1)
50 diff -urNp -x '*.orig' coreutils-8.32.org/man/getgid.x coreutils-8.32/man/getgid.x
51 --- coreutils-8.32.org/man/getgid.x     1970-01-01 01:00:00.000000000 +0100
52 +++ coreutils-8.32/man/getgid.x 2021-03-21 00:28:40.314899186 +0100
53 @@ -0,0 +1,4 @@
54 +[NAME]
55 +getgid \- print ID of given group
56 +[DESCRIPTION]
57 +.\" Add any additional description here
58 diff -urNp -x '*.orig' coreutils-8.32.org/man/pl/getgid.1 coreutils-8.32/man/pl/getgid.1
59 --- coreutils-8.32.org/man/pl/getgid.1  1970-01-01 01:00:00.000000000 +0100
60 +++ coreutils-8.32/man/pl/getgid.1      2021-03-21 00:28:40.314899186 +0100
61 @@ -0,0 +1,22 @@
62 +.TH GETGID "1" "Pa?dziernik 2002" "getgid (coreutils) 4.5.3" "Polecenia u?ytkownika"
63 +.SH NAZWA
64 +getgid \- wypisuje identyfikator podanej grupy
65 +.SH SK?ADNIA
66 +.B getgid
67 +\fINAZWA-GRUPY\fR
68 +.SH OPIS
69 +.PP
70 +Wypisuje identyfikator grupy NAZWA-GRUPY.
71 +.PP
72 +Bez ?adnych opcji podaje spos?b u?ycia.
73 +.SH AUTOR
74 +Napisane przez Artura Frysiaka.
75 +.SH "ZG?ASZANIE B??D?W"
76 +B??dy prosz? zg?asza? (w j?z. polskim lub angielskim) pod <feedback@pld-linux.org>.
77 +.SH COPYRIGHT
78 +Copyright \(co 1999 Artur Frysiak.
79 +.br
80 +This is free software; see the source for copying conditions.  There is NO
81 +warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
82 +.SH ZOBACZ TAK?E
83 +.BR id (1)
84 diff -urNp -x '*.orig' coreutils-8.32.org/po/POTFILES.in coreutils-8.32/po/POTFILES.in
85 --- coreutils-8.32.org/po/POTFILES.in   2020-01-01 15:13:12.000000000 +0100
86 +++ coreutils-8.32/po/POTFILES.in       2021-03-21 00:28:40.314899186 +0100
87 @@ -66,6 +66,7 @@ src/false.c
88  src/find-mount-point.c
89  src/fmt.c
90  src/fold.c
91 +src/getgid.c
92  src/getlimits.c
93  src/group-list.c
94  src/groups.c
95 diff -urNp -x '*.orig' coreutils-8.32.org/po/pl.po coreutils-8.32/po/pl.po
96 --- coreutils-8.32.org/po/pl.po 2021-03-21 00:28:39.617899186 +0100
97 +++ coreutils-8.32/po/pl.po     2021-03-21 00:28:40.316899186 +0100
98 @@ -4199,6 +4199,15 @@ msgstr "przy czytaniu nazw na wejściu p
99  msgid "invalid zero-length file name"
100  msgstr "błędna nazwa pliku o zerowej długości"
101  
102 +#: src/getgid.c:37
103 +#, c-format
104 +msgid ""
105 +"Usage:\n"
106 +"\t%s groupname\n"
107 +msgstr ""
108 +"Składnia:\n"
109 +"\t%s nazwa-grupy\n"
110 +
111  #. This is a proper name. See the gettext manual, section Names.
112  #: src/echo.c:27
113  msgid "Brian Fox"
114 diff -urNp -x '*.orig' coreutils-8.32.org/src/getgid.c coreutils-8.32/src/getgid.c
115 --- coreutils-8.32.org/src/getgid.c     1970-01-01 01:00:00.000000000 +0100
116 +++ coreutils-8.32/src/getgid.c 2021-03-21 00:28:40.317899186 +0100
117 @@ -0,0 +1,88 @@
118 +/* getgid - print GID of given group
119 +   Copyright (C) 1999 Artur Frysiak <wiget@pld-linux.org>
120 +
121 +   This program is free software; you can redistribute it and/or modify
122 +   it under the terms of the GNU General Public License as published by
123 +   the Free Software Foundation; either version 2, or (at your option)
124 +   any later version.
125 +
126 +   This program is distributed in the hope that it will be useful,
127 +   but WITHOUT ANY WARRANTY; without even the implied warranty of
128 +   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
129 +   GNU General Public License for more details.
130 +
131 +   You should have received a copy of the GNU General Public License
132 +   along with this program; if not, write to the Free Software Foundation,
133 +   Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
134 +
135 +#include <config.h>
136 +#include <grp.h>
137 +#include <getopt.h>
138 +#include <sys/types.h>
139 +
140 +#include "system.h"
141 +#include "error.h"
142 +#include "long-options.h"
143 +#include "quote.h"
144 +
145 +/* The official name of this program (e.g., no 'g' prefix).  */
146 +#define PROGRAM_NAME "getgid"
147 +
148 +#define AUTHORS proper_name ("Artur Frysiak")
149 +
150 +void
151 +usage (int status)
152 +{
153 +  if (status != EXIT_SUCCESS)
154 +    emit_try_help ();
155 +  else
156 +    {
157 +      printf (_("Usage: %s [OPTION]... [GROUPNAME]...\n"), program_name);
158 +      fputs (_("\
159 +Prints ID of given group name.\
160 +\n\
161 +"), stdout);
162 +      fputs (HELP_OPTION_DESCRIPTION, stdout);
163 +      fputs (VERSION_OPTION_DESCRIPTION, stdout);
164 +      emit_ancillary_info (PROGRAM_NAME);
165 +    }
166 +  exit (status);
167 +}
168 +
169 +int
170 +main (int argc, char **argv)
171 +{
172 +  struct group *gr;
173 +
174 +  initialize_main (&argc, &argv);
175 +  set_program_name (argv[0]);
176 +  setlocale (LC_ALL, "");
177 +  bindtextdomain (PACKAGE, LOCALEDIR);
178 +  textdomain (PACKAGE);
179 +
180 +  atexit (close_stdout);
181 +
182 +  parse_long_options (argc, argv, PROGRAM_NAME, PACKAGE_NAME, Version,
183 +                      usage, AUTHORS, (char const *) NULL);
184 +  if (getopt_long (argc, argv, "", NULL, NULL) != -1)
185 +    usage (EXIT_FAILURE);
186 +
187 +  if (argc < optind + 1)
188 +    {
189 +      error (0, 0, _("missing operand"));
190 +      usage (EXIT_FAILURE);
191 +    }
192 +
193 +  if (optind + 2 < argc)
194 +    {
195 +      error (0, 0, _("extra operand %s"), quote (argv[optind + 2]));
196 +      usage (EXIT_FAILURE);
197 +    }
198 +
199 +  gr = getgrnam(argv[optind]);
200 +  if (gr == NULL)
201 +    error (EXIT_FAILURE, errno, _("cannot find group name %s"), quote (argv[optind]));
202 +  else
203 +    printf("%lu\n", (unsigned long int) gr->gr_gid);
204 +  exit(EXIT_SUCCESS);
205 +}
206 diff -urNp -x '*.orig' coreutils-8.32.org/src/local.mk coreutils-8.32/src/local.mk
207 --- coreutils-8.32.org/src/local.mk     2020-02-25 13:54:28.000000000 +0100
208 +++ coreutils-8.32/src/local.mk 2021-03-21 00:28:40.317899186 +0100
209 @@ -130,6 +130,7 @@ src_factor_LDADD = $(LDADD)
210  src_false_LDADD = $(LDADD)
211  src_fmt_LDADD = $(LDADD)
212  src_fold_LDADD = $(LDADD)
213 +src_getgid_LDADD = $(LDADD)
214  src_getlimits_LDADD = $(LDADD)
215  src_ginstall_LDADD = $(LDADD)
216  src_groups_LDADD = $(LDADD)