update git

This commit is contained in:
2026-02-20 08:48:34 -06:00
parent 38f368c6d6
commit 54e5be0773
2 changed files with 14 additions and 3 deletions

View File

@@ -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)

View File

@@ -9,15 +9,18 @@
// --build Run build after updating
// --target <triple> 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 <triple> 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)