pkgsrc-Users archive

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

[PATCH] fix OS release identification in pkg_install on aix



pkg_install doesn't correctly identify the OS release on aix, leading
to the following warning when installing a package:


===> Install binary package of tnftp-20151004
pkg_add: Warning: package `tnftp-20151004' was built for a platform:
pkg_add: AIX/powerpc 6.1 (pkg) vs. AIX/powerpc 1 (this host)


The problem is that pkg_install expects uname's release field to
contain the full OS version number, which isn't true on aix.  For
example, aix version 6.1 will have a 6 in the version field, and a 1
in the release field.  This is why the warning message above seems to
indicate that the package is being installed on aix 1 but was built on
6.1.

I've attached a patch that fixes the problem.
Index: files/add/perform.c
===================================================================
RCS file: /cvsroot/pkgsrc/pkgtools/pkg_install/files/add/perform.c,v
retrieving revision 1.108
diff -u -r1.108 perform.c
--- files/add/perform.c	27 Dec 2015 12:36:42 -0000	1.108
+++ files/add/perform.c	19 Feb 2016 06:30:33 -0000
@@ -904,6 +904,12 @@
 
 	normalise_platform(&host_uname);
 
+	if (strcmp(OPSYS_NAME, "AIX") == 0) {
+		strcat(host_uname.version, ".");
+		strcat(host_uname.version, host_uname.release);
+		strcpy(host_uname.release, host_uname.version);
+	}
+
 	if (OverrideMachine != NULL)
 		effective_arch = OverrideMachine;
 	else


Home | Main Index | Thread Index | Old Index