]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
scripts/delta: adapt to curl.h changes for the opt counter
authorDaniel Stenberg <daniel@haxx.se>
Thu, 17 Nov 2022 13:41:04 +0000 (14:41 +0100)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 17 Nov 2022 13:41:04 +0000 (14:41 +0100)
scripts/delta

index 3c6a823d354dbb28190c3213d302ed5c6ff55add..858f1610093c3020351714222d0302a51b4cd237 100755 (executable)
@@ -59,8 +59,20 @@ $bcontribs = `git show $start:docs/THANKS | grep -c '^[^ ]'`;
 $contribs = $acontribs - $bcontribs;
 
 # number of setops:
-$asetopts=`grep '^  CURLOPT(' include/curl/curl.h  | grep -cv OBSOLETE`;
-$bsetopts=`git show $start:include/curl/curl.h | grep '^  CURLOPT(' | grep -cv OBSOLETE`;
+sub setopts {
+    my ($f)=@_;
+    open(H, "$f");
+    my $opts;
+    while(<H>) {
+        if(/^  CURLOPT(|DEPRECATED)\(/ && ($_ !~ /OBSOLETE/))  {
+            $opts++;
+        }
+    }
+    close(H);
+    return $opts;
+}
+$asetopts = setopts("<include/curl/curl.h");
+$bsetopts = setopts("git show $start:include/curl/curl.h|");
 $nsetopts = $asetopts - $bsetopts;
 
 # Number of command line options: