- Timestamp:
- Apr 4, 2023, 8:18:25 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/eam/rawfix.20230221/src/fix_chip_locations.pl
r42430 r42441 18 18 # for each chip, target a single host? 19 19 20 my ($fulldate, $dateword, $chiplist, $stage ) = &parse_cmdopts;21 my ($neb_dbh) = &parse_db_config ( 'nebulous.config');20 my ($fulldate, $dateword, $chiplist, $stage, $topdir) = &parse_cmdopts; 21 my ($neb_dbh) = &parse_db_config ("$topdir/nebulous.config"); 22 22 23 23 # read the list of chip_ids: … … 42 42 foreach my $chip_id (@chip_ids) { 43 43 44 my $urifile = "$ dateword/$chip_id.uris.txt";45 open (FILE, "$urifile");44 my $urifile = "$topdir/$dateword/$chip_id.uris.txt"; 45 open (FILE, $urifile); 46 46 my @lines = <FILE>; 47 47 close (FILE); … … 71 71 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 72 72 unless ($newxattr == 1) { die "new instance is not at ATRC? $ext_id : $newfile : $newhost : $newxattr\n"; } 73 open (OUTFILE, ">>$ dateword/$newhost.inst.$stage.txt");73 open (OUTFILE, ">>$topdir/$dateword/$newhost.inst.$stage.txt"); 74 74 print OUTFILE "$newfile $datast $md5sum\n"; 75 75 close (OUTFILE); … … 85 85 my ($newfile, $newhost, $newxattr) = &get_new_instance ($ext_id); 86 86 unless ($newxattr == 0) { die "new instance is not at ITC? $ext_id : $newfile : $newhost : $newxattr\n"; } 87 open (OUTFILE, ">>$ dateword/$newhost.inst.$stage.txt");87 open (OUTFILE, ">>$topdir/$dateword/$newhost.inst.$stage.txt"); 88 88 print OUTFILE "$newfile $datast $md5sum\n"; 89 89 close (OUTFILE); … … 170 170 my @chip_ids; 171 171 172 open(CHIPS, $chiplist) or die "cannot open file $chiplist\n";172 open(CHIPS,"$topdir/$chiplist") or die "cannot open file $chiplist\n"; 173 173 174 174 my @lines = <CHIPS>; … … 189 189 sub parse_cmdopts { 190 190 191 my ($dateobs, $chiplist, $stage );192 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, ' stage=s' => \$stage) || pod2usage(2);191 my ($dateobs, $chiplist, $stage, $topdir); 192 GetOptions( 'dateobs=s' => \$dateobs, 'chiplist=s' => \$chiplist, 'topdir=s' => \$topdir, 'stage=s' => \$stage) || pod2usage(2); 193 193 194 194 pod2usage( -msg => "Cannot determine target date, use --dateobs YYYY/MM/DD", -exitval => 2) unless defined $dateobs; 195 195 pod2usage( -msg => "Provide a list of chips with --chiplist", -exitval => 2) unless defined $chiplist; 196 196 pod2usage( -msg => "Define the stage (v0, v1, etc) with --stage", -exitval => 2) unless defined $stage; 197 pod2usage( -msg => "Specify the top-level output directory with --topdir", -exitval => 2) unless defined $topdir; 197 198 198 199 # check the date format (require YYYY/MM/DD and use that from 00:00:00 to 23:59:59 or take start and end?) … … 207 208 my $dateword = sprintf ("%4d%02d%02d", $date_year, $date_month, $date_day); 208 209 209 return ($fulldate, $dateword, $chiplist, $stage );210 return ($fulldate, $dateword, $chiplist, $stage, $topdir); 210 211 } 211 212
Note:
See TracChangeset
for help on using the changeset viewer.
