From d491ac3a2199cb1f3cdcd4f2f6b3d877b3a65a65 Mon Sep 17 00:00:00 2001 From: Yaakov Nemoy Date: Sun, 28 Sep 2008 10:29:00 -0400 Subject: Make the shell functions a bit more modular for scripting --- rebuild-scripts/add_owner | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 rebuild-scripts/add_owner (limited to 'rebuild-scripts/add_owner') diff --git a/rebuild-scripts/add_owner b/rebuild-scripts/add_owner new file mode 100755 index 0000000..e419d42 --- /dev/null +++ b/rebuild-scripts/add_owner @@ -0,0 +1,28 @@ +#!/usr/bin/env perl +# $Id: add_owner,v 1.1.1.1 2006/10/06 22:22:02 c4chris Exp $ +use strict; +local *IN; +my %OWN; +open IN, "/home/chris/src/isrec/fedora/owners/owners.list" + or die "Couldn't open owners.list: $!"; +while ( ) { + next if /^#/; + s/\s+$//; + my @F = split /\|/; + next if $F[1] eq ""; + $OWN{$F[1]} = \@F; +} +close IN; +while ( <> ) { + s/\s+$//; + my @F = split; + my $name = $F[5]; + my $e = $OWN{$name}; + if (defined $e) { + push @F, $$e[3]; + } else { + push @F, "Unknown"; + } + print join(" ", @F), "\n"; +} +exit 0; -- cgit