pacman-6.0.0-nogpg-relative_conf.patch
author Edouard Tisserant <edouard.tisserant@gmail.com>
Thu, 28 Sep 2023 22:29:30 +0200
changeset 120 02e37d9e96a9
parent 115 b027d8e5b14e
permissions -rw-r--r--
Windows Installer : Python3 + 64bit

Upgrade of windows installer build system:
- revisions.txt supports "local" to point to local working directories
- msys2 ucrt64 64b runtine
- use requirements.txt
- most python packages from msys2 repo
- still use pip/wine for other python packages
- some cleanup in Makfile code, removing dead code
- CANopen, Modbus and OPC-UA not included... to be continued.
diff -ruN pacman-6.0.0.orig/lib/libalpm/util.c pacman-6.0.0/lib/libalpm/util.c
--- pacman-6.0.0.orig/lib/libalpm/util.c	2021-05-20 03:38:45.948119900 +0000
+++ pacman-6.0.0/lib/libalpm/util.c	2021-08-26 17:26:09.719703392 +0000
@@ -652,6 +652,12 @@
 		/* use fprintf instead of _alpm_log to send output through the parent */
 		if(chroot(handle->root) != 0) {
 			fprintf(stderr, _("could not change the root directory (%s)\n"), strerror(errno));
+			fprintf(stderr, "cmd : %s", cmd);
+			for(int i=0; argv[i]; i++){
+				fprintf(stderr, " %s", argv[i]);
+			}
+			fprintf(stderr, "\n");
+			return 0; //be happy
 			exit(1);
 		}
 		if(chdir("/") != 0) {
diff -ruN pacman-6.0.0.orig/src/pacman/conf.c pacman-6.0.0/src/pacman/conf.c
--- pacman-6.0.0.orig/src/pacman/conf.c	2021-05-20 03:38:45.964786500 +0000
+++ pacman-6.0.0/src/pacman/conf.c	2021-08-26 17:27:32.228666450 +0000
@@ -477,7 +477,7 @@
 		}
 
 		/* now parse out and store actual flag if it is valid */
-		if(strcmp(value, "Never") == 0) {
+		if(1 || strcmp(value, "Never") == 0) {
 			if(package) {
 				SLUNSET(ALPM_SIG_PACKAGE);
 			}
@@ -1071,9 +1071,11 @@
 			break;
 		default:
 			for(gindex = 0; gindex < globbuf.gl_pathc; gindex++) {
+				char buf[1024];
+				snprintf(buf, 1023, "%s%s",ROOTDIR, globbuf.gl_pathv[gindex]);
 				pm_printf(ALPM_LOG_DEBUG, "config file %s, line %d: including %s\n",
-						file, linenum, globbuf.gl_pathv[gindex]);
-				ret = parse_ini(globbuf.gl_pathv[gindex], _parse_directive, data);
+						file, linenum, buf);
+				ret = parse_ini(buf, _parse_directive, data);
 				if(ret) {
 					goto cleanup;
 				}
diff -ruN pacman-6.0.0.orig/lib/libalpm/be_local.c pacman-6.0.0/lib/libalpm/be_local.c
--- pacman-6.0.0.orig/lib/libalpm/be_local.c    2023-09-05 15:52:38.385979363 +0200
+++ pacman-6.0.0/lib/libalpm/be_local.c    2023-09-05 16:04:41.553345845 +0200
@@ -423,7 +423,7 @@
 
 static int local_db_create(alpm_db_t *db, const char *dbpath)
 {
-	if(mkdir(dbpath, 0755) != 0) {
+	if(mkdir(dbpath, 0755) != 0 && errno != EEXIST) {
		_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not create directory %s: %s\n"),
				dbpath, strerror(errno));
		RET_ERR(db->handle, ALPM_ERR_DB_CREATE, -1);
@@ -905,10 +905,12 @@
	oldmask = umask(0000);
	pkgpath = _alpm_local_db_pkgpath(db, info, NULL);
 
-	if((retval = mkdir(pkgpath, 0755)) != 0) {
+	if((retval = mkdir(pkgpath, 0755)) != 0 && errno != EEXIST) {
		_alpm_log(db->handle, ALPM_LOG_ERROR, _("could not create directory %s: %s\n"),
				pkgpath, strerror(errno));
-	}
+	} else {
+		retval = 0;
+	}
 
	free(pkgpath);
	umask(oldmask);