From 54e5be0773b918b1f5aa49cd769279a6fa7477d2 Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Fri, 20 Feb 2026 08:48:34 -0600 Subject: [PATCH] update git --- Makefile | 2 +- update.ce | 15 +++++++++++++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 772eaaa9..6a1bbdbe 100755 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ all: $(BUILD)/build.ninja cp $(BUILD)/cell . $(BUILD)/build.ninja: - meson setup $(BUILD) -Dbuildtype=debugoptimized + meson setup $(BUILD) -Dbuildtype=release debug: $(BUILD_DBG)/build.ninja meson compile -C $(BUILD_DBG) diff --git a/update.ce b/update.ce index 8b94c87c..3c40e2f7 100644 --- a/update.ce +++ b/update.ce @@ -9,15 +9,18 @@ // --build Run build after updating // --target Target platform for build (requires --build) // --follow-links Update link targets instead of origins +// --git Run git pull on local packages before updating var shop = use('internal/shop') var build = use('build') var fd = use('fd') +var os = use('os') var target_pkg = null var run_build = false var target_triple = null var follow_links = false +var git_pull = false var i = 0 var resolved = null @@ -32,6 +35,7 @@ for (i = 0; i < length(args); i++) { log.console(" --build Run build after updating") log.console(" --target Target platform for build (requires --build)") log.console(" --follow-links Update link targets instead of origins") + log.console(" --git Run git pull on local packages") $stop() } else if (args[i] == '--build') { run_build = true @@ -44,6 +48,8 @@ for (i = 0; i < length(args); i++) { } } else if (args[i] == '--follow-links') { follow_links = true + } else if (args[i] == '--git') { + git_pull = true } else if (!starts_with(args[i], '-')) { target_pkg = args[i] // Resolve relative paths to absolute paths @@ -89,8 +95,13 @@ function update_and_fetch(pkg) { log.console(" " + effective_pkg + " " + old_str + " -> " + text(new_entry.commit, 0, 8)) shop.fetch(effective_pkg) } else { - // Local package - just ensure symlink is correct - log.console(" " + effective_pkg + " (local)") + // Local package - run git pull if requested + if (git_pull && fd.is_dir(effective_pkg + '/.git')) { + log.console(" " + effective_pkg + " (git pull)") + os.system('git -C "' + effective_pkg + '" pull') + } else { + log.console(" " + effective_pkg + " (local)") + } } shop.extract(effective_pkg) shop.build_package_scripts(effective_pkg)