]> Devi Nivas Git - cs3210-lab1.git/commitdiff
Specify in runoff.spec which side sheet 1 is on, since it keeps changing
authorAustin Clements <amdragon@mit.edu>
Thu, 2 Sep 2010 07:57:20 +0000 (03:57 -0400)
committerAustin Clements <amdragon@mit.edu>
Thu, 2 Sep 2010 07:57:20 +0000 (03:57 -0400)
runoff
runoff.spec

diff --git a/runoff b/runoff
index 1435646f21344254dced47947408985a06fc4c5f..3dee1cc98fa62c25b00101b54e380b6b0f2b96c0 100755 (executable)
--- a/runoff
+++ b/runoff
@@ -58,6 +58,13 @@ perl -e '
                        next;
                }
                
+               if(/sheet1: (left|right)$/){
+                       print STDERR "assuming that sheet 1 is a $1 page.  double-check!\n";
+                       $left = $1 eq "left" ? "13579" : "02468";
+                       $right = $1 eq "left" ? "02468" : "13579";
+                       next;
+               }
+               
                if(/even: (.*)/){
                        $file = $1;
                        if(!defined($toc{$file})){
@@ -90,17 +97,11 @@ perl -e '
                                print STDERR "Have no toc for $file\n";
                                next;
                        }
-                       # this assumes that sheet 1 of code is a right page
-                       # double-check the PDF.  swap the two regexps below
-                       # otherwise.
-                       if(!$leftwarn++) {
-                               print STDERR "assuming that sheet 1 is a right page.  double-check!\n";
-                       }
-                       if($what eq "left" && !($toc{$file} =~ /^\d[02468]$tens/)){
+                       if($what eq "left" && !($toc{$file} =~ /^\d[$left]$tens/)){
                                print STDERR "$file does not start on a fresh left page [$toc{$file}]\n";
                        }
                        # why does this not work if I inline $x in the if?
-                       $x = ($toc{$file} =~ /^\d[13579]$tens/);
+                       $x = ($toc{$file} =~ /^\d[$right]$tens/);
                        if($what eq "right" && !$x){
                                print STDERR "$file does not start on a fresh right page [$toc{$file}] [$x]\n";
                        }
index e6f5a955cfe595698f97d9ab8414d5487b24c1de..17bb821fbb44d2ce50fb54ad902ed0ba7899e3fa 100644 (file)
@@ -1,3 +1,5 @@
+sheet1: left
+
 # types.h either
 # param.h either
 # defs.h either
@@ -16,7 +18,7 @@ even: main.c
 # odd: init.c
 
 # spinlock.h either
-right: spinlock.c  # mild preference
+left: spinlock.c  # mild preference
 even: proc.h  # mild preference
 
 # goal is to have two action-packed 2-page spreads,