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)
* 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
releasing version 0.3 31bab120cc259d70b3706dbd7210159b4667171d joeyh 2006-03-03 23:20:51
better abde923d30e354d96cb6673597fa538cf80476dd joeyh 2006-03-03 22:38:51
* Switch sponge to a C implementation by mithandir. * Build dep on docbook-xml. d8e27a6d4d287995a554f27605e912be38d0a75b joeyh 2006-03-03 22:26:20
releasing version 0.1 ee3eecafa0cc1a4efa0503117144205bedbdf6a1 joeyh 2006-02-19 20:33:18
update 98c3874b1b7c27921f0282e98a9b25e95c9fc13d joeyh 2006-02-19 19:39:42
add 4f1ebf7b7771af3244da916be4c6cbb33deb92d0 joeyh 2006-02-19 19:18:31
add ed168d654253279014143df3aa3c27e436cd3930 joeyh 2006-02-19 18:40:49
Commit 4671f67156c1c59c2f9f7c3ead1a2e9141375d41 - * Replaced and(1) and not(1) by combine, based on an idea by Matt Taggart.
Author: joeyh
Author date (UTC): 2006-03-08 04:04
Committer name: joeyh
Committer date (UTC): 2006-03-08 04:04
Parent(s): 1530f8ec01fe7e688946203ec19624e1609c221c
Signer:
Signing key:
Signing status: N
Tree: b093f645bc936bbf1e5309c82b229afc1ac396ab
File Lines added Lines deleted
Makefile 2 2
README 2 19
and 0 50
combine 137 0
debian/changelog 3 3
debian/control 1 2
not 0 57
File Makefile changed (mode: 100644) (index 78d111c..7cacd7e)
1 1 BINS=isutf8 sponge ifdata BINS=isutf8 sponge ifdata
2 PERLSCRIPTS=vidir vipe ts and not
3 MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 and.1 not.1 ifdata.1
2 PERLSCRIPTS=vidir vipe ts combine
3 MANS=sponge.1 vidir.1 vipe.1 isutf8.1 ts.1 combine.1 ifdata.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 2aeaa88..a69a6ec)
... ... vidir
11 11 edit a directory in your text editor edit a directory in your text editor
12 12 vipe vipe
13 13 edit a pipe using your text editor edit a pipe using your text editor
14 and
15 print lines that are present in one file and another
16 not
17 print lines that are present in one file but not another
14 combine
15 combine the lines in two files using boolean operations
18 16 ifdata ifdata
19 17 get network interface info without parsing ifconfig output get network interface info without parsing ifconfig output
20 18
 
... ... Your suggestions of additional tools to add to this collection are
23 21 apprecitated. Here are some that are under consideration but have not yet apprecitated. Here are some that are under consideration but have not yet
24 22 been included, I also welcome feedback on which of these to include. been included, I also welcome feedback on which of these to include.
25 23
26 _
27 Matt Taggart suggests that and(1) and not(1) be integrated into one
28 utility taking a page from test(1)/[. It would work like this:
29
30 _ file1 and file2
31 _ file1 not file2
32
33 Where any file can be "-" for stdin. Could also add "or", "xor",
34 etc to this. This makes it much clearer which file is on which side
35 of the boolean expression.
36
37 If it's called "_" that should probably be an alias for something
38 longer, such as lcombine. What exactly to call it is the unresolved
39 question -- is "_" something moreutils can justify taking for this?
40
41 24 mime mime
42 25 determines the mime type of a file using the gnome mine database determines the mime type of a file using the gnome mine database
43 26
File and deleted (index 4165410..0000000)
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 and - print lines that are present in one file and another
6
7 =head1 SYNOPSIS
8
9 and file
10
11 and [file|-] [file|-] ...
12
13 =head1 DESCRIPTION
14
15 B<and> reads the specified files and prints out the lines that are common
16 to all files, in the order they are listed in the last file. Use "-" to
17 make it read a file from standard input. If only one file is specified,
18 B<and> first reads standard input, and compares it with the specified file.
19
20 =head1 AUTHOR
21
22 Copyright 2006 by Joey Hess <joey@kitenet.net>
23
24 Licensed under the GNU GPL.
25
26 =cut
27
28 use warnings;
29 use strict;
30
31 if (@ARGV == 0) {
32 die "usage: and [file|-] [file|-] ...\n";
33 }
34
35 if (@ARGV == 1) {
36 unshift @ARGV, "-";
37 }
38
39 my %seen;
40 foreach my $fn (@ARGV) {
41 open (IN, $fn) || die "and: read $fn: $!\n";
42 while (<IN>) {
43 chomp;
44 $seen{$_}++;
45 if ($seen{$_} == @ARGV) {
46 print "$_\n";
47 }
48 }
49 close IN;
50 }
File combine added (mode: 100755) (index 0000000..ad61f52)
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 combine - combine the lines in two files using boolean operations
6
7 =head1 SYNOPSIS
8
9 combine file1 and file2
10
11 combine file1 not file2
12
13 combine file1 or file2
14
15 combine file1 xor file2
16
17 _ file1 and file2 _
18
19 _ file1 not file2 _
20
21 _ file1 or file2 _
22
23 _ file1 xor file2 _
24
25 =head1 DESCRIPTION
26
27 B<combine> conbines the lines in two files. Depending on the boolean
28 operation specified, the contents will be combined in different ways:
29
30 =over 4
31
32 =item and
33
34 Outputs lines that are common to both files.
35
36 =item not
37
38 Outputs lines that are in file1 but not in file2.
39
40 =item or
41
42 Outputs lines that are in file1 or file2.
43
44 =item xor
45
46 Outputs lines that are in either file1 or file2, but not in both files.
47
48 =back
49
50 "-" can be specified for either file to read stdin for that file.
51
52 The input files need not be sorted, and the lines are output in the order
53 they accur in file1 (or file2 for the two "or" operations).
54
55 Note that this program can be installed as "_" to allow for the syntactic
56 sugar shown in the latter half of the synopsis (similar to the test/[
57 command). It is not currently installed as "_" by default.
58
59 =head1 AUTHOR
60
61 Copyright 2006 by Joey Hess <joey@kitenet.net>
62
63 Licensed under the GNU GPL.
64
65 =cut
66
67 use warnings;
68 use strict;
69
70 sub filemap {
71 my $file=shift;
72 my $sub=shift;
73
74 open (IN, $file) || die "$file: $!\n";
75 while (<IN>) {
76 chomp;
77 $sub->();
78 }
79 close IN;
80 }
81
82 sub hashify {
83 my $file=shift;
84
85 my %seen;
86 filemap $file, sub { $seen{$_}++ };
87 return \%seen;
88 }
89
90 sub compare_or {
91 my ($file1, $file2) = @_;
92
93 my $seen;
94 filemap $file1, sub { print "$_\n"; $seen->{$_}++ };
95 filemap $file2, sub { print "$_\n" unless $seen->{$_} };
96 }
97
98 sub compare_xor {
99 my ($file1, $file2) = @_;
100
101 compare_not($file1, $file2);
102 compare_not($file2, $file1);
103 }
104
105 sub compare_not {
106 my ($file1, $file2) = @_;
107
108 my $seen=hashify($file2);
109 filemap $file1, sub { print "$_\n" unless $seen->{$_} };
110 }
111
112 sub compare_and {
113 my ($file1, $file2) = @_;
114
115 my $seen=hashify($file2);
116 filemap $file1, sub { print "$_\n" if $seen->{$_} };
117 }
118
119 if (@ARGV >= 4 && $ARGV[3] eq "_") {
120 delete $ARGV[3];
121 }
122
123 if (@ARGV != 3) {
124 die "usage: combine file1 OP file2\n";
125 }
126
127 my $file1=shift;
128 my $op=shift;
129 my $file2=shift;
130
131 if ($::{"compare_$op"}) {
132 no strict 'refs';
133 "compare_$op"->($file1, $file2);
134 }
135 else {
136 die "unknown operation, $op\n";
137 }
File debian/changelog changed (mode: 100644) (index e563801..9eeedd9)
1 moreutils (0.5) UNRELEASED; urgency=low
1 moreutils (0.5) unstable; urgency=low
2 2
3 3 * Added ifdata, by Benjamin BAYART (originally called ifcfg). * Added ifdata, by Benjamin BAYART (originally called ifcfg).
4 4 * Made ifdata -Wall clean. * Made ifdata -Wall clean.
 
... ... moreutils (0.5) UNRELEASED; urgency=low
6 6 * Cleaned up ifdata's behavior when asked to print info for nonexistant * Cleaned up ifdata's behavior when asked to print info for nonexistant
7 7 devices. Still needs improvement. devices. Still needs improvement.
8 8 * Indentation improvements. * Indentation improvements.
9 * README updates based on user feedback.
9 * Replaced and(1) and not(1) by combine, based on an idea by Matt Taggart.
10 10
11 -- Joey Hess <joeyh@debian.org> Tue, 7 Mar 2006 21:54:45 -0500
11 -- Joey Hess <joeyh@debian.org> Tue, 7 Mar 2006 23:02:14 -0500
12 12
13 13 moreutils (0.4) unstable; urgency=low moreutils (0.4) unstable; urgency=low
14 14
File debian/control changed (mode: 100644) (index 44b6d2d..d0c752e)
... ... Description: additional unix utilities
18 18 - ts: timestamp standard input - ts: timestamp standard input
19 19 - vidir: edit a directory in your text editor - vidir: edit a directory in your text editor
20 20 - vipe: edit a pipe using your text editor - vipe: edit a pipe using your text editor
21 - and: print lines that are present in one file and another
22 - not: print lines that are present in one file but not another
21 - combine: combine the lines in two files using boolean operations
23 22 - ifdata: get network interface info without parsing ifconfig output - ifdata: get network interface info without parsing ifconfig output
File not deleted (index c67467c..0000000)
1 #!/usr/bin/perl
2
3 =head1 NAME
4
5 not - print lines that are present in one file but not another
6
7 =head1 SYNOPSIS
8
9 not file
10
11 not [file|-] [file|-] ...
12
13 =head1 DESCRIPTION
14
15 B<not> reads the specified files and prints out the lines that are present
16 in the first but not in subsequent files. Use "-" to make it read a file
17 from standard input. If only one file is specified, B<not> first reads
18 standard input, and compares it with the specified file.
19
20 =head1 AUTHOR
21
22 Copyright 2006 by Joey Hess <joey@kitenet.net>
23
24 Licensed under the GNU GPL.
25
26 =cut
27
28 use warnings;
29 use strict;
30
31 if (@ARGV == 0) {
32 die "usage: not [file|-] [file|-] ...\n";
33 }
34
35 if (@ARGV == 1) {
36 unshift @ARGV, "-";
37 }
38
39 my $first=shift;
40
41 my %seen;
42 foreach my $fn (@ARGV) {
43 open (IN, $fn) || die "and: read $fn: $!\n";
44 while (<IN>) {
45 chomp;
46 $seen{$_}++;
47 }
48 close IN;
49 }
50
51
52 open (IN, $first) || die "and: read $first: $!\n";
53 while (<IN>) {
54 chomp;
55 print "$_\n" if ! $seen{$_};
56 }
57 close IN;
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