changes to fold xfs_support code back into XFS (the other sgi projects
[xfstests-dev.git] / tools / srcdiff
index 8721c73059908c270a0531032b452b5fda65dcaf..c22dfb5e59b94b7f2d62dc52eb89bba0bb0935e2 100755 (executable)
@@ -20,7 +20,7 @@ use strict;
 #     > s/^.* (xfs\w+|\*xfs\w+|xlog\w+|\*xlog\w+) \(.*/\1/ && { $count++ }'
 #     > echo $file
 #     > done
 #     > s/^.* (xfs\w+|\*xfs\w+|xlog\w+|\*xlog\w+) \(.*/\1/ && { $count++ }'
 #     > echo $file
 #     > done
-# (compare this to "srcdiff | fgrep Total:") ... repeat for logprint.
+# (compare this to "srcdiff | fgrep Total:")
 # 
 
 die "WORKAREA not set" unless defined $ENV{'WORKAREA'};
 # 
 
 die "WORKAREA not set" unless defined $ENV{'WORKAREA'};
@@ -30,12 +30,12 @@ my $quiet=0;
 my $usage=0;
 
 foreach (@ARGV) {
 my $usage=0;
 
 foreach (@ARGV) {
-    if (/^-q$/) {
-        $quiet++;
-    } else {
-        print STDERR "Illegal option $_\n";
-        $usage++;
-    }
+       if (/^-q$/) {
+               $quiet++;
+       } else {
+               print STDERR "Illegal option $_\n";
+               $usage++;
+       }
 }
 
 if ($usage) {
 }
 
 if ($usage) {
@@ -43,6 +43,7 @@ if ($usage) {
     exit 1;
 }
 
     exit 1;
 }
 
+my @pkglist = qw( attr acl dmapi xfsdump xfsprogs );
 my @difflist = qw(
        xfs_ag.h  xfs_alloc.h  xfs_alloc_btree.h xfs_arch.h
        xfs_attr_leaf.h  xfs_attr_sf.h  xfs_bit.h  xfs_bmap.h
 my @difflist = qw(
        xfs_ag.h  xfs_alloc.h  xfs_alloc_btree.h xfs_arch.h
        xfs_attr_leaf.h  xfs_attr_sf.h  xfs_bit.h  xfs_bmap.h
@@ -62,27 +63,31 @@ sub straightdiff {
        my ( $file, $prefix1, $prefix2 ) = @_;
 
        `diff $prefix1/$file $prefix2/$file >/dev/null 2>&1`;
        my ( $file, $prefix1, $prefix2 ) = @_;
 
        `diff $prefix1/$file $prefix2/$file >/dev/null 2>&1`;
-        if (!$quiet) {
-           print sprintf("\t%-35s ... ", $file);
-           if ($? != 0)        { print "FAILED\n"; }
-           else                { print "ok\n"; }
-        } elsif ($? != 0) { 
+       if (!$quiet) {
+               print sprintf("\t%-35s ... ", $file);
+               if ($? != 0)    { print "FAILED\n"; }
+               else            { print "ok\n"; }
+       } elsif ($? != 0) { 
                printf("\t%-35s ... ", $file);
                printf("\t%-35s ... ", $file);
-                print "FAILED\n"; 
-        }
+               print "FAILED\n"; 
+       }
 }
 
 }
 
+my $first = shift @pkglist;
+foreach (@pkglist) {
+       print "\n=== Checking $_ package ===\n";
+       straightdiff 'buildrules', "cmd/$first/include", "cmd/$_/include";
+       straightdiff 'buildmacros', "cmd/$first/include", "cmd/$_/include";
+}
 print "\n=== Checking headers ===\n";
 foreach (@difflist) {
        straightdiff $_, 'cmd/xfsprogs/include', 'linux/fs/xfs';
 }
 straightdiff 'xfs_cred.h', 'cmd/xfsprogs/include', 'linux/fs/xfs/linux';
 straightdiff 'xfs_fs.h', 'cmd/xfsprogs/include', 'linux/include/linux';
 print "\n=== Checking headers ===\n";
 foreach (@difflist) {
        straightdiff $_, 'cmd/xfsprogs/include', 'linux/fs/xfs';
 }
 straightdiff 'xfs_cred.h', 'cmd/xfsprogs/include', 'linux/fs/xfs/linux';
 straightdiff 'xfs_fs.h', 'cmd/xfsprogs/include', 'linux/include/linux';
-straightdiff 'attr_kern.h', 'cmd/attr/include', 'linux/fs/xfs/linux';
-straightdiff 'attributes.h', 'cmd/attr/include', 'linux/include/linux';
 straightdiff 'dmapi_kern.h', 'cmd/dmapi/include', 'linux/include/linux';
 straightdiff 'dmapi.h', 'cmd/dmapi/include', 'linux/include/linux';
 straightdiff 'dmapi_kern.h', 'cmd/dmapi/include', 'linux/include/linux';
 straightdiff 'dmapi.h', 'cmd/dmapi/include', 'linux/include/linux';
-straightdiff 'arch.h', 'cmd/xfsprogs/include', 'linux/fs/xfs_support';
+straightdiff 'arch.h', 'cmd/xfsprogs/include', 'linux/include/linux/xfs/support';
 straightdiff 'xqm.h', 'cmd/xfsprogs/include', 'linux/include/linux';
 
 # 
 straightdiff 'xqm.h', 'cmd/xfsprogs/include', 'linux/include/linux';
 
 # 
@@ -250,7 +255,7 @@ sub functiondiff {
        print "( Total: $count routine$plural checked in $file )\n" unless ($quiet);
 }
 
        print "( Total: $count routine$plural checked in $file )\n" unless ($quiet);
 }
 
-# cmd/xfsprogs/{libxfs,logprint}/* fs/xfs/*
+# cmd/xfsprogs/{libxfs,libxlog}/* fs/xfs/*
 my @funclist = qw(
        xfs_alloc.c  xfs_alloc_btree.c  xfs_attr_leaf.c  xfs_bit.c
        xfs_bmap.c  xfs_bmap_btree.c  xfs_btree.c  xfs_da_btree.c
 my @funclist = qw(
        xfs_alloc.c  xfs_alloc_btree.c  xfs_attr_leaf.c  xfs_bit.c
        xfs_bmap.c  xfs_bmap_btree.c  xfs_btree.c  xfs_da_btree.c
@@ -265,5 +270,5 @@ print "\n=== Checking libxfs code ===\n";
 foreach (@funclist) {
        functiondiff $_, 'cmd/xfsprogs/libxfs', 'linux/fs/xfs';
 }
 foreach (@funclist) {
        functiondiff $_, 'cmd/xfsprogs/libxfs', 'linux/fs/xfs';
 }
-print "\n=== Checking logprint code ===\n";
-functiondiff 'xfs_log_recover.c', 'cmd/xfsprogs/logprint', 'linux/fs/xfs';
+print "\n=== Checking libxlog code ===\n";
+functiondiff 'xfs_log_recover.c', 'cmd/xfsprogs/libxlog', 'linux/fs/xfs';