[Tinyos-commits] CVS: tinyos-1.x/tools/scripts ident_flags,1.5,1.6

Jonathan Hui jwhui at users.sourceforge.net
Tue Jun 28 18:02:48 PDT 2005


Update of /cvsroot/tinyos/tinyos-1.x/tools/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27841

Modified Files:
	ident_flags 
Log Message:
Added a unique identifier for a program image that is essentially a
4-byte hash of (1) program name, (2) compilation time, (3) user id,
and (4) hostname.



Index: ident_flags
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/tools/scripts/ident_flags,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** ident_flags	21 Jun 2005 23:28:19 -0000	1.5
--- ident_flags	29 Jun 2005 01:02:46 -0000	1.6
***************
*** 17,21 ****
--- 17,23 ----
  (my $whoami = `whoami`) =~ s/\s//g;
  (my $hostname = `hostname`) =~ s/\s//g;
+ my $uidhash = `echo "$name$time$whoami$hostname" | sha1sum`;
  my $idhash = `echo "$whoami$hostname" | sha1sum`;
+ my $uid = ($uidhash =~/^(.{8})/) ? "0x$1" : 0;
  my $id = ($idhash =~/^(.{8})/) ? "0x$1" : 0;
  
***************
*** 42,45 ****
--- 44,48 ----
  push( @defs, "-DIDENT_USER_HASH=${id}L" );
  push( @defs, "-DIDENT_UNIX_TIME=${time}L" );
+ push( @defs, "-DIDENT_UID_HASH=${uid}L" );
  
  print join(" ", at defs) . "\n";



More information about the Tinyos-commits mailing list