Subject: Re: huge ABI_DEPENDS patch (was Re: BUILDLINK_DEPENDS.expat)
To: Todd Vierling <tv@duh.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 04/04/2006 21:23:20
On Tue, 4 Apr 2006, Todd Vierling wrote:

> This plan sounds fine to me personally, so long as you provide a
> compatibility definition for IGNORE_RECOMMENDED until the next branch.
> (obsolete.mk checking for IGNORE_RECOMMENDED defined and matching
> [Yy][Ee][Ss] should suffice; if it's undef or any other value,
> USE_ABI_DEPENDS can take over).

Okay. I added those few lines and tested some. (I am not adding obsolete 
checking for the other changed parts as I will have to duplicate code or 
have to keep old code in place in bsd.buildlink3.mk for example.)

> The diffis too big to browse intelligently by me right now, so I trust your
> judgment that the above changes were done right.  :)

Yes, it is too big. (Just if anyone is concerned -- no package versions 
are getting bumped :)

> > Note that if you use wip, it will fail! I have patched wip too but need to
> > do again on a clean tree.
> 
> And the sf.net CVS servers have been up and down for a while due to major
> disk failures.  Once it's back up, I'm sure this change will be just the
> same to apply across wip as well.

I just switched RECOMMENDED to ABI_DEPENDS and BUILDLINK_DEPENDS\. (with 
the period) to BUILDLINK_API_DEPENDS\..

For mk files and for pkgtools that actually deal with this I manually 
updated. The pkg_install patch as I provide at that URL was broken -- it 
is fixed and tested now. The patch is below, but was against pkgsrc so I 
need to do for NetBSD src/usr.sbin/pkg_install instead. (Note I also 
patched the cat man page manually for the footer and header. Also in a 
warnx output I removed a leading space so message could fit on a standard 
console.)

(By the way, I don't recall any use of a "RECOMMENDED" by itself, although 
it is possible and I didn't check.)

Thanks for having a quick look at this.

I will probably starting do the commits Wednesday late in evening PST.

 Jeremy C. Reed

Index: pkgtools/pkg_install/files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.39
diff -u -r1.39 perform.c
--- pkgtools/pkg_install/files/add/perform.c	4 Apr 2006 06:24:39 -0000	1.39
+++ pkgtools/pkg_install/files/add/perform.c	5 Apr 2006 04:17:37 -0000
@@ -157,6 +157,8 @@
 			    buildinfo[BI_MACHINE_ARCH] = strdup(line);
 			else if (strcmp(key, "IGNORE_RECOMMENDED") == 0)
 			    buildinfo[BI_IGNORE_RECOMMENDED] = strdup(line);
+			else if (strcmp(key, "USE_ABI_DEPENDS") == 0)
+			    buildinfo[BI_USE_ABI_DEPENDS] = strdup(line);
 		}
 	}
 	(void) fclose(fp);
@@ -471,12 +473,15 @@
 		}
 	}
 
-	/* Check if IGNORE_RECOMMENDED was set when this package was built. */
+	/* Check if USE_ABI_DEPENDS or IGNORE_RECOMMENDED was set
+	 * when this package was built. IGNORE_RECOMMENDED is historical. */
 
-	if (buildinfo[BI_IGNORE_RECOMMENDED] != NULL &&
-	    strcasecmp(buildinfo[BI_IGNORE_RECOMMENDED], "NO") != 0) {
+	if ((buildinfo[BI_USE_ABI_DEPENDS] != NULL &&
+	    strcasecmp(buildinfo[BI_USE_ABI_DEPENDS], "YES") != 0) ||
+	    (buildinfo[BI_IGNORE_RECOMMENDED] != NULL &&
+	    strcasecmp(buildinfo[BI_IGNORE_RECOMMENDED], "NO") != 0)) {
 		warnx("%s was built", pkg);
-		warnx("\t to ignore recommended dependencies, this may cause problems!\n");
+		warnx("\tto ignore recommended ABI dependencies, this may cause problems!\n");
 	}
 
 	/*
Index: pkgtools/pkg_install/files/add/pkg_add.1
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/pkg_add.1,v
retrieving revision 1.16
diff -u -r1.16 pkg_add.1
--- pkgtools/pkg_install/files/add/pkg_add.1	5 Nov 2005 13:20:09 -0000	1.16
+++ pkgtools/pkg_install/files/add/pkg_add.1	5 Apr 2006 04:17:38 -0000
@@ -17,7 +17,7 @@
 .\"
 .\"     @(#)pkg_add.1
 .\"
-.Dd November 1, 2005
+.Dd April 3, 2006
 .Dt PKG_ADD 1
 .Os
 .Sh NAME
@@ -401,8 +401,10 @@
 The package build information from
 .Pa +BUILD_INFO
 is then checked for
-.Ev IGNORE_RECOMMENDED .
-If the package was built with dependency recommendations ignored,
+.Ev USE_ABI_DEPENDS=NO
+(or
+.Ev IGNORE_RECOMMENDED).
+If the package was built with ABI dependency recommendations ignored,
 a warning will be issued.
 .It
 If the package contains a
Index: pkgtools/pkg_install/files/add/pkg_add.cat1
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/pkg_add.cat1,v
retrieving revision 1.15
diff -u -r1.15 pkg_add.cat1
--- pkgtools/pkg_install/files/add/pkg_add.cat1	5 Nov 2005 13:20:09 -0000	1.15
+++ pkgtools/pkg_install/files/add/pkg_add.cat1	5 Apr 2006 04:17:38 -0000
@@ -1,4 +1,4 @@
-PKG_ADD(1)              NetBSD General Commands Manual              PKG_ADD(1)
+PKG_ADD(1)                   General Commands Manual                PKG_ADD(1)
 
 N^HNA^HAM^HME^HE
      p^Hpk^Hkg^Hg_^H_a^Had^Hdd^Hd -- a utility for installing and upgrading software package dis-
@@ -222,8 +222,9 @@
                 is overridable with the -^H-f^Hf flag.
 
            7.   The package build information from _^H+_^HB_^HU_^HI_^HL_^HD_^H__^HI_^HN_^HF_^HO is then checked
-                for IGNORE_RECOMMENDED.  If the package was built with depen-
-                dency recommendations ignored, a warning will be issued.
+                for USE_ABI_DEPENDS=NO (or IGNORE_RECOMMENDED). If the package
+                was built with ABI dependency recommendations ignored, a warn-
+                ing will be issued.
 
            8.   If the package contains a _^Hr_^He_^Hq_^Hu_^Hi_^Hr_^He script (see pkg_create(1)),
                 it is executed with the following arguments:
@@ -387,4 +388,4 @@
 
      Sure to be others.
 
-NetBSD 3.0                     November 1, 2005                     NetBSD 3.0
+pkgsrc                           April 3, 2006                          pkgsrc
Index: pkgtools/pkg_install/files/lib/lib.h
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/lib/lib.h,v
retrieving revision 1.22
diff -u -r1.22 lib.h
--- pkgtools/pkg_install/files/lib/lib.h	4 Apr 2006 06:32:59 -0000	1.22
+++ pkgtools/pkg_install/files/lib/lib.h	5 Apr 2006 04:17:38 -0000
@@ -229,7 +229,8 @@
 	BI_OS_VERSION,		/*  1 */
 	BI_MACHINE_ARCH,	/*  2 */
 	BI_IGNORE_RECOMMENDED,	/*  3 */
-	BI_ENUM_COUNT		/*  4 */
+	BI_USE_ABI_DEPENDS,	/*  4 */
+	BI_ENUM_COUNT		/*  5 */
 }	bi_ent_t;
 
 /* Types */