pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/sysutils/decode-dimms Update the patch file to not att...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/16be5f82d233
branches:  trunk
changeset: 310826:16be5f82d233
user:      pgoyette <pgoyette%pkgsrc.org@localhost>
date:      Wed Jul 25 02:36:08 2018 +0000

description:
Update the patch file to not attempt to change CVS keywords

diffstat:

 sysutils/decode-dimms/distinfo                   |    4 +-
 sysutils/decode-dimms/patches/patch-decode-dimms |  132 ++++++++++------------
 2 files changed, 64 insertions(+), 72 deletions(-)

diffs (221 lines):

diff -r 1d6ac6cc0a61 -r 16be5f82d233 sysutils/decode-dimms/distinfo
--- a/sysutils/decode-dimms/distinfo    Wed Jul 25 02:11:40 2018 +0000
+++ b/sysutils/decode-dimms/distinfo    Wed Jul 25 02:36:08 2018 +0000
@@ -1,8 +1,8 @@
-$NetBSD: distinfo,v 1.5 2018/07/25 02:05:26 pgoyette Exp $
+$NetBSD: distinfo,v 1.6 2018/07/25 02:36:08 pgoyette Exp $
 
 SHA1 (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 0765225f1f7ee63d0ebb3a3881ad819fa9d48d9e
 RMD160 (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 0e1f9c86e5005bf8534789e4dea532bc8dda522a
 SHA512 (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 4cd57f6cc4424888fe4e7bede28b7a5e15e7f658b57fa4df528cc3636cd5124036a69492de9636d81478e58b660275df2dee239999bd5ea0bec13313b240b352
 Size (i2c-tools-84da8192c7c409f37c1906b60ef166c58aafc847.tar.gz) = 95860 bytes
-SHA1 (patch-decode-dimms) = a64426b096120f225a55793afde9ef720fd8b15b
+SHA1 (patch-decode-dimms) = 5bf374a4514927c726acfea95b7dd29beb93cfe3
 SHA1 (patch-decode-dimms.1) = c1c1444a73fa848eda0223e2c176819d4ded6641
diff -r 1d6ac6cc0a61 -r 16be5f82d233 sysutils/decode-dimms/patches/patch-decode-dimms
--- a/sysutils/decode-dimms/patches/patch-decode-dimms  Wed Jul 25 02:11:40 2018 +0000
+++ b/sysutils/decode-dimms/patches/patch-decode-dimms  Wed Jul 25 02:36:08 2018 +0000
@@ -1,141 +1,133 @@
-$NetBSD: patch-decode-dimms,v 1.4 2018/07/25 02:05:26 pgoyette Exp $
+$NetBSD: patch-decode-dimms,v 1.5 2018/07/25 02:36:08 pgoyette Exp $
 
 Add NetBSD-specific ability to use spdmem(4)'s sysctl values as
 input.
 
---- eeprom/decode-dimms.orig   2018-05-31 13:53:29.771907986 +0800
-+++ eeprom/decode-dimms        2018-03-03 13:20:15.572272632 +0800
+--- decode-dimms.after-patch   2018-07-25 10:33:01.055537617 +0800
++++ decode-dimms.master        2018-05-31 13:53:29.771907986 +0800
 @@ -1,4 +1,4 @@
--#!/usr/bin/perl -w
-+#!/usr/pkg/bin/perl -w
+-#!/usr/pkg/bin/perl -w
++#!/usr/bin/perl -w
  #
  # EEPROM data decoder for SDRAM DIMM modules
  #
-@@ -42,15 +42,14 @@
+@@ -42,9 +42,8 @@
  use Fcntl qw(:DEFAULT :seek);
  use File::Basename;
  use vars qw($opt_html $opt_bodyonly $opt_side_by_side $opt_merge
--          $opt_igncheck $use_sysfs $use_hexdump $sbs_col_width
--          @vendors %decode_callback $revision @dimm $current %hexdump_cache);
-+          $opt_igncheck $use_sysfs $use_hexdump $use_sysctl $sbs_col_width
-+          @vendors %decode_callback $revision @dimm $current %hexdump_cache
-+          %sysctl_cache);
+-          $opt_igncheck $use_sysfs $use_hexdump $use_sysctl $sbs_col_width
+-          @vendors %decode_callback $revision @dimm $current %hexdump_cache
+-          %sysctl_cache);
++          $opt_igncheck $use_sysfs $use_hexdump $sbs_col_width
++          @vendors %decode_callback $revision @dimm $current %hexdump_cache);
  
  use constant LITTLEENDIAN     => "little-endian";
  use constant BIGENDIAN                => "big-endian";
- 
--$revision = '$Revision: 1.4 $ ($Date: 2018/07/25 02:05:26 $)';
--$revision =~ s/\$\w+: (.*?) \$/$1/g;
--$revision =~ s/ \([^()]*\)//;
-+$revision = '20171205';
- 
- @vendors = (
- ["AMD", "AMI", "Fairchild", "Fujitsu",
-@@ -341,6 +340,7 @@
+@@ -342,7 +341,6 @@
  );
  
  $use_sysfs = -d '/sys/bus';
-+$use_sysctl = 0;
+-$use_sysctl = 0;
  
  # We consider that no data was written to this area of the SPD EEPROM if
  # all bytes read 0x00 or all bytes read 0xff
-@@ -2252,6 +2252,26 @@
+@@ -2254,26 +2252,6 @@
        }
  }
  
-+# read data from a NetBSD (or equivalent) sysctl variable
-+
-+sub read_sysctl($)
-+{
-+
-+      # Look in the cache first
-+      return @{$sysctl_cache{$_[0]}} if exists $sysctl_cache{$_[0]};
-+
-+      my $sysctl_var = sprintf("hw.%s.spd_data", $_[0]);
-+      open(PIPE, "-|", "sysctl -r $sysctl_var")
-+              or die "Cannot read sysctl variable $sysctl_var";
-+      sysread(PIPE, my $eeprom, 512); # XXX Assumed maximum size! XXX
-+      close PIPE or die "sysctl returned $?";
-+      my @bytes = unpack("C*", $eeprom);
-+
-+      # Cache the data for later use
-+      $hexdump_cache{$_[0]} = \@bytes;
-+      return @bytes;
-+}
-+
+-# read data from a NetBSD (or equivalent) sysctl variable
+-
+-sub read_sysctl($)
+-{
+-
+-      # Look in the cache first
+-      return @{$sysctl_cache{$_[0]}} if exists $sysctl_cache{$_[0]};
+-
+-      my $sysctl_var = sprintf("hw.%s.spd_data", $_[0]);
+-      open(PIPE, "-|", "sysctl -r $sysctl_var")
+-              or die "Cannot read sysctl variable $sysctl_var";
+-      sysread(PIPE, my $eeprom, 512); # XXX Assumed maximum size! XXX
+-      close PIPE or die "sysctl returned $?";
+-      my @bytes = unpack("C*", $eeprom);
+-
+-      # Cache the data for later use
+-      $hexdump_cache{$_[0]} = \@bytes;
+-      return @bytes;
+-}
+-
  # Read bytes from SPD-EEPROM
  # Note: offset must be a multiple of 16!
  sub readspd($$$)
-@@ -2261,6 +2281,9 @@
+@@ -2283,9 +2261,6 @@
        if ($use_hexdump) {
                @bytes = read_hexdump($dimm_i);
                return @bytes[$offset..($offset + $size - 1)];
-+      } elsif ($use_sysctl) {
-+              @bytes = read_sysctl($dimm_i);
-+              return @bytes[$offset..($offset + $size - 1)];
+-      } elsif ($use_sysctl) {
+-              @bytes = read_sysctl($dimm_i);
+-              return @bytes[$offset..($offset + $size - 1)];
        } elsif ($use_sysfs) {
                # Kernel 2.6 with sysfs
                sysopen(HANDLE, "$dimm_i/eeprom", O_RDONLY)
-@@ -2337,7 +2360,7 @@
+@@ -2362,7 +2337,7 @@
  # Parse command-line
  foreach (@ARGV) {
        if ($_ eq '-h' || $_ eq '--help') {
--              print "Usage: $0 [-c] [-f [-b]] [-x|-X file [files..]]\n",
-+              print "Usage: $0 [-c] [-f [-b]] [-x|-X|-s file [files..]]\n",
+-              print "Usage: $0 [-c] [-f [-b]] [-x|-X|-s file [files..]]\n",
++              print "Usage: $0 [-c] [-f [-b]] [-x|-X file [files..]]\n",
                        "       $0 -h\n\n",
                        "  -f, --format            Print nice html output\n",
                        "  -b, --bodyonly          Don't print html header\n",
-@@ -2351,6 +2374,8 @@
+@@ -2376,8 +2351,6 @@
                        "  -x,                     Read data from hexdump files\n",
                        "  -X,                     Same as -x except treat multibyte hex\n",
                        "                          data as little endian\n",
-+                      "  -s,                     Use NetBSD-compatible sysctl(8) to obtain\n",
-+                      "                          EEPROM data\n",
+-                      "  -s,                     Use NetBSD-compatible sysctl(8) to obtain\n",
+-                      "                          EEPROM data\n",
                        "  -h, --help              Display this usage summary\n";
                print <<"EOF";
  
-@@ -2395,13 +2420,20 @@
+@@ -2422,20 +2395,13 @@
                $use_hexdump = LITTLEENDIAN;
                next;
        }
-+      if ($_ eq '-s') {
-+              if (-x "/sbin/sysctl") {
-+                      $use_sysctl = 1;
-+              } else { die "No /sbin/sysctl available for -s"; }
-+              next;
-+      }
+-      if ($_ eq '-s') {
+-              if (-x "/sbin/sysctl") {
+-                      $use_sysctl = 1;
+-              } else { die "No /sbin/sysctl available for -s"; }
+-              next;
+-      }
  
        if (m/^-/) {
                print STDERR "Unrecognized option $_\n";
                exit;
        }
  
--      push @dimm, { eeprom => basename($_), file => $_ } if $use_hexdump;
-+      push @dimm, { eeprom => basename($_), file => $_ }
-+              if ($use_sysctl || $use_hexdump);
+-      push @dimm, { eeprom => basename($_), file => $_ }
+-              if ($use_sysctl || $use_hexdump);
++      push @dimm, { eeprom => basename($_), file => $_ } if $use_hexdump;
  }
  
  # Default values
-@@ -2479,7 +2511,7 @@
+@@ -2513,7 +2479,7 @@
  #  * chk_spd: The checksum or CRC value found in the EEPROM
  #  * chk_calc: The checksum or CRC computed from the EEPROM data
  # Keys are added over time.
--@dimm = get_dimm_list() unless $use_hexdump;
-+@dimm = get_dimm_list() unless ($use_sysctl || $use_hexdump);
+-@dimm = get_dimm_list() unless ($use_sysctl || $use_hexdump);
++@dimm = get_dimm_list() unless $use_hexdump;
  
  for my $i (0 .. $#dimm) {
        my @bytes = readspd(0, 128, $dimm[$i]->{file});
-@@ -2531,7 +2563,7 @@
+@@ -2565,7 +2531,7 @@
                printl("Decoding EEPROM", $dimm[$current]->{eeprom});
        }
  
--      if (!$use_hexdump) {
-+      if (!$use_hexdump && !$use_sysctl) {
+-      if (!$use_hexdump && !$use_sysctl) {
++      if (!$use_hexdump) {
                if ($dimm[$current]->{file} =~ /-([\da-f]+)$/i) {
                        my $dimm_num = hex($1) - 0x50 + 1;
                        if ($dimm_num >= 1 && $dimm_num <= 8) {
-@@ -2737,3 +2769,4 @@
+@@ -2771,4 +2737,3 @@
  printl2("\n\nNumber of SDRAM DIMMs detected and decoded", scalar @dimm);
  
  print "</body></html>\n" if ($opt_html && !$opt_bodyonly);
-+
+-



Home | Main Index | Thread Index | Old Index