nicolas / debian.moreutils (public) (License: GPL-2, GPL-2+, Expat, BSD-2-Clause, Public Domain) (since 2018-09-25) (hash sha1)
Debian packaging of joeyh's moreutils
List of commits:
Subject Hash Author Date (UTC)
* ifdata: patch from Adam Lackorzynski to translate French error messages to English and to convert some #defines to enums. * ifdata: patch from Adam Lackorzynski to avoid printing info for bogus interface. Closes: #360433 * Add zrun, contributed by Chung-chieh Shan (you might prefer to alias it to "z"). 830a7b56d7c03e6819e2ccdd65b5015a2606ebd1 joeyh 2006-04-02 22:32:24
releasing version 0.9 64f0d162b040d66fd21c4ec8c7b5e9792866febc joeyh 2006-03-27 18:48:20
* Typo fixes. Closes: #359039, #359040 * pee: don't send a copy of every line sent to every command to stdout. Seems best for it not to output anything to stdout on its on at all. Closes: #359041 67ccef6db58b56bdfed8d1a96d3a7d298f42c625 joeyh 2006-03-27 18:45:08
* ifdata: robustness patch from Adam Lackorzynski, in particular deal with /proc not mounted. Closes: #358930 78133bda9c752e761ae00b6a43d2ddf5c67af53f joeyh 2006-03-25 17:52:25
releasing version 0.8 7e8e057cd10ca3d436f786003c0c34e5074074dd joeyh 2006-03-25 02:01:45
* ifdata: patch from its author to make it behave properly on big endian systems. Closes: #358860 eb2a08e762578bb86e0e6135c5808a0d82e91a8c joeyh 2006-03-25 01:51:39
* tss.1, ifdata.1: typo fix. Closes: #358557, #358556 77f42d643d76d6aa7d884fe9c6eadd7fcc57bc64 joeyh 2006-03-23 08:47:52
* Back to Mithandir's C sponge, now fixed. 5942eb1d3bd089b4f01daab04ca0ad8518e8b2ef joeyh 2006-03-23 07:18:36
* ifdata: Patch from KELEMEN Peter to add support for printing hardware interface. Closes: #357646 824b3e16d5f3962f7bdba0ff3159363afad3cc68 joeyh 2006-03-18 19:17:43
er yeah, let's check in the right stuff fa7787ccb87cc8c47f118c65d5bbada602323a68 joeyh 2006-03-16 17:08:29
* Add pee (pipe tee) contributed by Miek Gieben. 93b625d8288ff9ec522460dac489a170ef130d8c joeyh 2006-03-14 23:08:19
releasing version 0.6 84cc0252d7bf1cc8514ef347e150e9c8b930f0bd joeyh 2006-03-13 17:06:37
typo 7b031cc5149b6558cb5964b8db55538792de3ea6 joeyh 2006-03-10 20:26:29
releasing version 0.5 538cb394703d148130ec9a7f60da677996a4857a joeyh 2006-03-08 04:09:50
* Replaced and(1) and not(1) by combine, based on an idea by Matt Taggart. 4671f67156c1c59c2f9f7c3ead1a2e9141375d41 joeyh 2006-03-08 04:04:34
* README updates based on user feedback. 1530f8ec01fe7e688946203ec19624e1609c221c joeyh 2006-03-08 03:25:58
* Indentation improvements. d8c8aa26cb9f1f4bd411056ad3049ed0357ae3e4 joeyh 2006-03-08 03:19:40
rename c996e056d782796fba098b546f16d7ead1ea9d78 joeyh 2006-03-08 03:03:37
* Added ifinfo, by Benjamin BAYART (originally called ifcfg). * Made ifinfo -Wall clean. * Made ifinfo support -h and print usage on unknown options. * Cleaned up ifinfo's behavior when asked to print info for nonexistant devices. Still needs improvement. e50ccc1b36213de52ae78c2703d391ea8941a7b1 joeyh 2006-03-08 02:59:27
releasing version 0.4 6a7f34809e87a940cd30c7e9de160db4ee9e65ca joeyh 2006-03-06 03:33:23
Commit 830a7b56d7c03e6819e2ccdd65b5015a2606ebd1 - * ifdata: patch from Adam Lackorzynski to translate French error messages to English and to convert some #defines to enums. * ifdata: patch from Adam Lackorzynski to avoid printing info for bogus interface. Closes: #360433 * Add zrun, contributed by Chung-chieh Shan (you might prefer to alias it to "z").
Author: joeyh
Author date (UTC): 2006-04-02 22:32
Committer name: joeyh
Committer date (UTC): 2006-04-02 22:32
Parent(s): 64f0d162b040d66fd21c4ec8c7b5e9792866febc
Signer:
Signing key:
Signing status: N
Tree: bc3f9289a4a439c666b99d34ef2dd98259b64958
File Lines added Lines deleted
Makefile 2 2
README 2 7
debian/changelog 11 0
debian/control 1 0
debian/copyright 3 0
debian/rules 4 0
ifdata.c 58 72
zrun 82 0
File Makefile changed (mode: 100644) (index ffed4b9..e8d92ee)
1 1 BINS=isutf8 ifdata pee sponge BINS=isutf8 ifdata pee sponge
2 PERLSCRIPTS=vidir vipe ts combine
3 MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 pee.1
2 PERLSCRIPTS=vidir vipe ts combine zrun
3 MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.1 pee.1 zrun.1
4 4 CFLAGS=-O2 -g -Wall CFLAGS=-O2 -g -Wall
5 5
6 6 all: $(BINS) $(MANS) all: $(BINS) $(MANS)
File README changed (mode: 100644) (index 1f6c287..6cd29f3)
... ... ifdata
17 17 get network interface info without parsing ifconfig output get network interface info without parsing ifconfig output
18 18 pee pee
19 19 tee standard input to pipes tee standard input to pipes
20
20 zrun
21 automatically uncompress arguments to command
21 22
22 23 Your suggestions of additional tools to add to this collection are Your suggestions of additional tools to add to this collection are
23 24 apprecitated. Here are some that are under consideration but have not yet apprecitated. Here are some that are under consideration but have not yet
 
... ... mime
29 30 (More useful than file(1) in many cases but would add a lot of (More useful than file(1) in many cases but would add a lot of
30 31 gnome libraries to the package's dependency chain.) gnome libraries to the package's dependency chain.)
31 32
32 z
33 makes another program understand compressed files
34 ex: z zxgv file.bmp.gz
35
36 (Dare I take the "z" name?)
37
38 33 tmp tmp
39 34 puts stdin into a temp file and passes it to the specified program puts stdin into a temp file and passes it to the specified program
40 35 ex: zcat file.bmp.gz | tmp zxgv ex: zcat file.bmp.gz | tmp zxgv
File debian/changelog changed (mode: 100644) (index 3470b9c..df19875)
1 moreutils (0.10) UNRELEASED; urgency=low
2
3 * ifdata: patch from Adam Lackorzynski to translate French error messages
4 to English and to convert some #defines to enums.
5 * ifdata: patch from Adam Lackorzynski to avoid printing info for
6 bogus interface. Closes: #360433
7 * Add zrun, contributed by Chung-chieh Shan (you might prefer to alias it to
8 "z").
9
10 -- Joey Hess <joeyh@debian.org> Sun, 2 Apr 2006 16:15:35 -0400
11
1 12 moreutils (0.9) unstable; urgency=low moreutils (0.9) unstable; urgency=low
2 13
3 14 * ifdata: robustness patch from Adam Lackorzynski, in particular deal with * ifdata: robustness patch from Adam Lackorzynski, in particular deal with
File debian/control changed (mode: 100644) (index 176a10e..2b2dde0)
... ... Description: additional unix utilities
21 21 - combine: combine the lines in two files using boolean operations - combine: combine the lines in two files using boolean operations
22 22 - ifdata: get network interface info without parsing ifconfig output - ifdata: get network interface info without parsing ifconfig output
23 23 - pee: tee standard input to pipes - pee: tee standard input to pipes
24 - zrun: automatically uncompress arguments to command
File debian/copyright changed (mode: 100644) (index 53ecc6c..b53bfaf)
... ... http://edgard.dyn.fdn.fr/developpements/ifcfg.shtml
13 13
14 14 pee is Copyright (c) Miek Gieben, 2006, under the terms of the GPL. pee is Copyright (c) Miek Gieben, 2006, under the terms of the GPL.
15 15
16 zrun is Copyright (c) Chung-chieh Shan, under the terms of the GPL, version
17 2 or later.
18
16 19 Everything else is copyright 2006 by Joey Hess, under the terms of GPL. Everything else is copyright 2006 by Joey Hess, under the terms of GPL.
17 20 The full text of the GNU GPL can be found in /usr/share/common-licenses/GPL The full text of the GNU GPL can be found in /usr/share/common-licenses/GPL
18 21 on Debian systems. on Debian systems.
File debian/rules changed (mode: 100755) (index 1c0a9b7..10f0e79)
... ... binary-arch: build
34 34 dh_md5sums dh_md5sums
35 35 dh_builddeb dh_builddeb
36 36
37 # Not intended for use by anyone except the author.
38 announcedir:
39 @echo ${HOME}/src/joeywiki/code/moreutils/news
40
37 41 binary: binary-indep binary-arch binary: binary-indep binary-arch
38 42 .PHONY: build clean binary-indep binary-arch binary .PHONY: build clean binary-indep binary-arch binary
File ifdata.c changed (mode: 100644) (index c9a4622..b81424c)
12 12 #include <string.h> #include <string.h>
13 13 #include <unistd.h> #include <unistd.h>
14 14 #include <ctype.h> #include <ctype.h>
15 //#include <linux/socket.h>
16 15
17 #define DO_EXISTS 1
18 #define DO_PEXISTS 2
19 #define DO_PADDRESS 3
20 #define DO_PMASK 4
21 #define DO_PMTU 5
22 #define DO_PCAST 6
23 #define DO_PALL 7
24 #define DO_PFLAGS 8
25 #define DO_SINPACKETS 9
26 #define DO_SINBYTES 10
27 #define DO_SINERRORS 11
28 #define DO_SINDROPS 12
29 #define DO_SINALL 13
30 #define DO_SINFIFO 14
31 #define DO_SINFRAME 15
32 #define DO_SINCOMPRESSES 16
33 #define DO_SINMULTICAST 17
34 #define DO_SOUTALL 18
35 #define DO_SOUTBYTES 19
36 #define DO_SOUTPACKETS 20
37 #define DO_SOUTERRORS 21
38 #define DO_SOUTDROPS 22
39 #define DO_SOUTFIFO 23
40 #define DO_SOUTCOLLS 24
41 #define DO_SOUTCARRIER 25
42 #define DO_SOUTMULTICAST 26
43 #define DO_PNETWORK 27
44 #define DO_PHWADDRESS 28
16 enum {
17 DO_EXISTS = 1,
18 DO_PEXISTS,
19 DO_PADDRESS,
20 DO_PMASK,
21 DO_PMTU,
22 DO_PCAST,
23 DO_PALL,
24 DO_PFLAGS,
25 DO_SINPACKETS,
26 DO_SINBYTES,
27 DO_SINERRORS,
28 DO_SINDROPS,
29 DO_SINALL,
30 DO_SINFIFO,
31 DO_SINFRAME,
32 DO_SINCOMPRESSES,
33 DO_SINMULTICAST,
34 DO_SOUTALL,
35 DO_SOUTBYTES,
36 DO_SOUTPACKETS,
37 DO_SOUTERRORS,
38 DO_SOUTDROPS,
39 DO_SOUTFIFO,
40 DO_SOUTCOLLS,
41 DO_SOUTCARRIER,
42 DO_SOUTMULTICAST,
43 DO_PNETWORK,
44 DO_PHWADDRESS,
45 };
45 46
46 47 struct if_stat { struct if_stat {
47 48 unsigned long long int in_packets; unsigned long long int in_packets;
 
... ... void if_hwaddr(char *iface) {
152 153
153 154 PREPARE_SOCK(iface); PREPARE_SOCK(iface);
154 155 CALL_IOCTL(SIOCGIFHWADDR); CALL_IOCTL(SIOCGIFHWADDR);
155 if (res < 0) {
156 CALL_ERROR();
157 }
156 CALL_ERROR(return);
158 157 hwaddr = (unsigned char *)req.ifr_hwaddr.sa_data; hwaddr = (unsigned char *)req.ifr_hwaddr.sa_data;
159 158 printf("%02X:%02X:%02X:%02X:%02X:%02X", printf("%02X:%02X:%02X:%02X:%02X:%02X",
160 159 hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]); hwaddr[0], hwaddr[1], hwaddr[2], hwaddr[3], hwaddr[4], hwaddr[5]);
 
... ... int if_mtu(char *iface) {
211 210 return req.ifr_mtu; return req.ifr_mtu;
212 211 } }
213 212
214 #define START 1
215 #define SKIP_LINE 2
216 #define START_LINE 3
217 #define START_IFNAME 4
218 #define IFACE_FOUND 5
219 #define RX_BYTES 6
220 #define WAIT_RX_PACKETS 7
221 #define RX_PACKETS 8
222 #define WAIT_RX_ERRORS 9
223 #define RX_ERRORS 10
224 #define WAIT_RX_DROPS 11
225 #define RX_DROPS 12
226 #define WAIT_RX_FIFO 13
227 #define RX_FIFO 14
228 #define WAIT_RX_FRAME 15
229 #define RX_FRAME 16
230 #define WAIT_RX_COMPRESS 17
231 #define RX_COMPRESS 18
232 #define WAIT_RX_MULTICAST 19
233 #define RX_MULTICAST 20
234 #define WAIT_TX_BYTES 21
235 #define TX_BYTES 22
236 #define WAIT_TX_PACKETS 23
237 #define TX_PACKETS 24
238 #define WAIT_TX_ERRORS 25
239 #define TX_ERRORS 26
240 #define WAIT_TX_DROPS 27
241 #define TX_DROPS 28
242 #define WAIT_TX_FIFO 29
243 #define TX_FIFO 30
244 #define WAIT_TX_COLLS 31
245 #define TX_COLLS 32
246 #define WAIT_TX_CARRIER 33
247 #define TX_CARRIER 34
248 #define WAIT_TX_MULTICAST 35
249 #define TX_MULTICAST 36
213 enum {
214 START = 1,
215 SKIP_LINE,
216 START_LINE,
217 START_IFNAME,
218 IFACE_FOUND,
219 RX_BYTES,
220 WAIT_RX_PACKETS, RX_PACKETS,
221 WAIT_RX_ERRORS, RX_ERRORS,
222 WAIT_RX_DROPS, RX_DROPS,
223 WAIT_RX_FIFO, RX_FIFO,
224 WAIT_RX_FRAME, RX_FRAME,
225 WAIT_RX_COMPRESS, RX_COMPRESS,
226 WAIT_RX_MULTICAST, RX_MULTICAST,
227 WAIT_TX_BYTES, TX_BYTES,
228 WAIT_TX_PACKETS, TX_PACKETS,
229 WAIT_TX_ERRORS, TX_ERRORS,
230 WAIT_TX_DROPS, TX_DROPS,
231 WAIT_TX_FIFO, TX_FIFO,
232 WAIT_TX_COLLS, TX_COLLS,
233 WAIT_TX_CARRIER, TX_CARRIER,
234 WAIT_TX_MULTICAST, TX_MULTICAST,
235 };
250 236
251 237 #define FIRST_DIGIT(val,digit) do {val=digit-'0'; } while(0) #define FIRST_DIGIT(val,digit) do {val=digit-'0'; } while(0)
252 238 #define NEXT_DIGIT(val,digit) do {val*=10; val+=digit-'0'; } while(0) #define NEXT_DIGIT(val,digit) do {val*=10; val+=digit-'0'; } while(0)
 
... ... struct if_stat *get_stats(char *iface) {
340 326 READ_INT(TX_CARRIER,res->out_carrier,WAIT_TX_MULTICAST); READ_INT(TX_CARRIER,res->out_carrier,WAIT_TX_MULTICAST);
341 327 READ_INT(TX_MULTICAST,res->out_carrier,SKIP_LINE); READ_INT(TX_MULTICAST,res->out_carrier,SKIP_LINE);
342 328 default: default:
343 fprintf(stderr,"Mon totomate est po bon!\n");
329 fprintf(stderr,"Internal state machine error!\n");
344 330 break; break;
345 331 } }
346 332 } }
 
... ... void please_do(int ndo, int *todo, char *ifname) {
392 378 struct sockaddr *sadr; struct sockaddr *sadr;
393 379 struct if_stat *stats=NULL; struct if_stat *stats=NULL;
394 380 if (!ndo) return; if (!ndo) return;
395 // printf("J'ai %d actions a r�aliser\n",ndo);
381 // printf("I have %d items in my queue.\n",ndo);
396 382 for (i=0; i<ndo; i++) { for (i=0; i<ndo; i++) {
397 383 switch (todo[i]) { switch (todo[i]) {
398 384 case DO_EXISTS: case DO_EXISTS:
 
... ... void please_do(int ndo, int *todo, char *ifname) {
553 539 stats->out_multicast); stats->out_multicast);
554 540 break; break;
555 541 default: default:
556 printf("Je comprends pas ce que je dois faire: %d\n",todo[i]);
542 printf("Unknown command: %d\n",todo[i]);
557 543 break; break;
558 544 } }
559 545 printf("\n"); printf("\n");
 
... ... int main(int argc, char *argv[]) {
649 635 usage(me); usage(me);
650 636 return 1; return 1;
651 637 } }
652 // printf("Je travaille sur l'interface %s\n",ifname);
638 // printf("Interface %s\n",ifname);
653 639 please_do(ndo,todo,ifname); please_do(ndo,todo,ifname);
654 640 return 0; return 0;
655 641 } }
File zrun added (mode: 100755) (index 0000000..8e6d159)
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 zrun - automatically uncompress arguments to command
6
7 =head1 SYNOPSIS
8
9 zrun command file.gz [...]
10
11 =head1 DESCRIPTION
12
13 Prefixing a shell command with "zrun" causes any compressed files that are
14 arguments of the command to be transparently uncompressed to temp files
15 (not pipes) and the uncompressed files fed to the command.
16
17 This is a quick way to run a command that does not itself support
18 compressed files, without manually uncompressing the files.
19
20 =head1 BUGS
21
22 Modifications to the uncompressed temporary file are not fed back into the
23 input file, so using this as a quick way to make an editor support
24 compressed files won't work.
25
26 =head1 AUTHOR
27
28 Copyright 2006 by Chung-chieh Shan <ccshan@post.harvard.edu>
29
30 =cut
31
32 use warnings;
33 use strict;
34 use IO::Handle;
35 use File::Temp qw{tempfile};
36
37 my $program = shift;
38
39 my @argument;
40 my %child;
41 foreach my $argument (@ARGV) {
42 if ($argument =~ m{^(.*/)?([^/]*)\.(gz|Z|bz2)$}s) {
43 my $suffix = "-$2";
44 my @preprocess = $3 eq "bz2" ? qw(bzip2 -d -c) : qw(gzip -d -c);
45
46 my ($fh, $tmpname) = tempfile(SUFFIX => $suffix, UNLINK => 1)
47 or die "zrun: cannot create temporary file: $!\n";
48
49 if (my $child = fork) {
50 $child{$child} = $argument;
51 $argument = $tmpname;
52 }
53 elsif (defined $child) {
54 STDOUT->fdopen($fh, "w");
55 exec @preprocess, $argument;
56 }
57 else {
58 die "zrun: cannot fork to handle $argument: $!\n";
59 }
60 }
61 push @argument, $argument;
62 }
63
64 while (%child and (my $pid = wait) != -1) {
65 if (defined(my $argument = delete $child{$pid})) {
66 if ($? & 255) {
67 die "zrun: preprocessing for $argument terminated abnormally: $?\n";
68 }
69 elsif (my $code = $? >> 8) {
70 die "zrun: preprocessing for $argument terminated with code $code\n";
71 }
72 }
73 }
74
75 my $status = system $program ($program, @argument);
76 if ($status & 255) {
77 die "zrun: $program terminated abnormally: $?\n";
78 }
79 else {
80 my $code = $? >> 8;
81 exit $code;
82 }
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/nicolas/debian.moreutils

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/nicolas/debian.moreutils

Clone this repository using git:
git clone git://git.rocketgit.com/user/nicolas/debian.moreutils

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main