From owner-freebsd-current Thu Sep 23 11:47:25 1999 Delivered-To: freebsd-current@freebsd.org Received: from atlrel2.hp.com (atlrel2.hp.com [156.153.255.202]) by hub.freebsd.org (Postfix) with ESMTP id 0413F14CA0 for ; Thu, 23 Sep 1999 11:47:11 -0700 (PDT) (envelope-from darrylo@sr.hp.com) Received: from postal.sr.hp.com (root@postal.sr.hp.com [15.4.46.173]) by atlrel2.hp.com (8.8.6 (PHNE_17135)/8.8.5tis) with ESMTP id OAA01040; Thu, 23 Sep 1999 14:46:13 -0400 (EDT) Received: from mina.sr.hp.com (root@mina.sr.hp.com [15.4.42.247]) by postal.sr.hp.com with ESMTP (8.8.6 (PHNE_17190)/8.7.3 TIS 5.0) id LAA05404; Thu, 23 Sep 1999 11:46:30 -0700 (PDT) Received: from localhost (darrylo@mina.sr.hp.com [15.4.42.247]) by mina.sr.hp.com with ESMTP (8.8.6 (PHNE_17135)/8.7.3 TIS 5.0) id LAA04038; Thu, 23 Sep 1999 11:46:39 -0700 (PDT) Message-Id: <199909231846.LAA04038@mina.sr.hp.com> To: Matthew Dillon Cc: Poul-Henning Kamp , freebsd-current@FreeBSD.ORG Subject: Re: ccd build failure Reply-To: Darryl Okahata Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: multipart/mixed; boundary="Multipart_Thu_Sep_23_11:46:38_1999-1" Content-Transfer-Encoding: 7bit Date: Thu, 23 Sep 1999 11:46:38 -0700 From: Darryl Okahata Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG --Multipart_Thu_Sep_23_11:46:38_1999-1 Content-Type: text/plain; charset=US-ASCII In the interests of peace and harmony (;-), I'd like to submit the attached perl script, which lists the status of cvs-controlled files. In particular, it's very useful for determining which files have been modified but not committed, like: i386/linux/linux_file.c Locally Modified kern/imgact_elf.c Locally Modified CVS is severely lacking in many areas (it is all we have, though), and one thing it is missing is an easy way of showing concise file status. As a result, it's easy to forget about locally-modified files. This perl script will list all files, in the current directory and below, that do not have a status of "Up-to-date", such as those which have been locally modified or which need updating. To use this script, just cd to some directory that contains cvs- controlled files and run the script. A list of non-up-to-date files in the current directory and below will be listed. Note that this script isn't particularly fast, as it has to execute a cvs command in each and every directory (due to cvs deficiencies). As examples, the script takes around 3 minutes to run under /usr/src/sys, and around 30 minutes for /usr/src (checked out via "cvs checkout src"). [ My (local, mirrored via cvsup) repository is accessed via pserver over 128K ISDN, and so there's a good chance that many people will see better performance. ] -- Darryl Okahata darrylo@sr.hp.com DISCLAIMER: this message is the author's personal opinion and does not constitute the support, opinion, or policy of Hewlett-Packard, or of the little green men that have been following him all day. --Multipart_Thu_Sep_23_11:46:38_1999-1 Content-Type: text/plain; charset=US-ASCII Content-Disposition: attachment; filename="cvsinfo" Content-Transfer-Encoding: quoted-printable #! /usr/bin/perl #########################################################################= ###### # # File: cvsinfo # RCS: $Header: $ # Description: = # Author: Darryl Okahata # Created: Wed Jul 15 14:52:01 1998 # Modified: Thu Sep 23 11:35:35 1999 (Darryl Okahata) darrylo@sr.hp.c= om # Language: CPerl # Package: N/A # # (C) Copyright 1998, Hewlett-Packard, all rights reserved. # #########################################################################= ###### $listfile =3D ".changed-files"; #########################################################################= ###### require 'getopts.pl'; &Getopts('ac'); $all_status =3D 1 if ($opt_a); $update_changed_file =3D 1 if ($opt_c); require "pwd.pl"; &initpwd; $top_dir =3D $ENV{'PWD'}; #########################################################################= ###### open(DIRS, "find . -type d | sort |") || die "$!"; while ($dir =3D ) { chdir($top_dir); # make sure we're in a known location chop($dir); $dir =3D~ s|^\./||; $dir =3D '.' if ($dir eq ''); # print "$dir\n"; next if (!-d "$dir/CVS"); &process_dir($dir); } close(DIRS); if ($update_changed_file) { unlink($listfile); open(OUT, ">$listfile") || die "$listfile: $!"; if ($#update_files >=3D 0) { foreach $file (sort @update_files) { print OUT "$file\n"; } } close(OUT); } exit 0; #########################################################################= ###### sub process_dir { local($dir) =3D @_; local($file, $status, $cmd); # print "$dir\n"; chdir($dir); $cmd =3D "cvs status -l"; open(IN, "$cmd 2>&1 |") || die "$!"; while () { if (/^File:\s+([^\s]+)\s+Status:\s+(.+)$/i){ $file =3D $1; $status =3D $2; if ($all_status || $status ne 'Up-to-date') { if ($status eq 'Needs Patch') { $status =3D 'Needs Updating'; } printf("%-50s %s\n", ($dir eq '.') ? $file : "$dir/$file", $status); if ($status =3D~ /Locally Modified/) { push(@update_files, $file); } } } elsif (/\[status\s+aborted\]/) { die "$_\n"; } # print; } close(IN); } --Multipart_Thu_Sep_23_11:46:38_1999-1-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message