update git
This commit is contained in:
2
Makefile
2
Makefile
@@ -11,7 +11,7 @@ all: $(BUILD)/build.ninja
|
|||||||
cp $(BUILD)/cell .
|
cp $(BUILD)/cell .
|
||||||
|
|
||||||
$(BUILD)/build.ninja:
|
$(BUILD)/build.ninja:
|
||||||
meson setup $(BUILD) -Dbuildtype=debugoptimized
|
meson setup $(BUILD) -Dbuildtype=release
|
||||||
|
|
||||||
debug: $(BUILD_DBG)/build.ninja
|
debug: $(BUILD_DBG)/build.ninja
|
||||||
meson compile -C $(BUILD_DBG)
|
meson compile -C $(BUILD_DBG)
|
||||||
|
|||||||
15
update.ce
15
update.ce
@@ -9,15 +9,18 @@
|
|||||||
// --build Run build after updating
|
// --build Run build after updating
|
||||||
// --target <triple> Target platform for build (requires --build)
|
// --target <triple> Target platform for build (requires --build)
|
||||||
// --follow-links Update link targets instead of origins
|
// --follow-links Update link targets instead of origins
|
||||||
|
// --git Run git pull on local packages before updating
|
||||||
|
|
||||||
var shop = use('internal/shop')
|
var shop = use('internal/shop')
|
||||||
var build = use('build')
|
var build = use('build')
|
||||||
var fd = use('fd')
|
var fd = use('fd')
|
||||||
|
var os = use('os')
|
||||||
|
|
||||||
var target_pkg = null
|
var target_pkg = null
|
||||||
var run_build = false
|
var run_build = false
|
||||||
var target_triple = null
|
var target_triple = null
|
||||||
var follow_links = false
|
var follow_links = false
|
||||||
|
var git_pull = false
|
||||||
var i = 0
|
var i = 0
|
||||||
var resolved = null
|
var resolved = null
|
||||||
|
|
||||||
@@ -32,6 +35,7 @@ for (i = 0; i < length(args); i++) {
|
|||||||
log.console(" --build Run build after updating")
|
log.console(" --build Run build after updating")
|
||||||
log.console(" --target <triple> Target platform for build (requires --build)")
|
log.console(" --target <triple> Target platform for build (requires --build)")
|
||||||
log.console(" --follow-links Update link targets instead of origins")
|
log.console(" --follow-links Update link targets instead of origins")
|
||||||
|
log.console(" --git Run git pull on local packages")
|
||||||
$stop()
|
$stop()
|
||||||
} else if (args[i] == '--build') {
|
} else if (args[i] == '--build') {
|
||||||
run_build = true
|
run_build = true
|
||||||
@@ -44,6 +48,8 @@ for (i = 0; i < length(args); i++) {
|
|||||||
}
|
}
|
||||||
} else if (args[i] == '--follow-links') {
|
} else if (args[i] == '--follow-links') {
|
||||||
follow_links = true
|
follow_links = true
|
||||||
|
} else if (args[i] == '--git') {
|
||||||
|
git_pull = true
|
||||||
} else if (!starts_with(args[i], '-')) {
|
} else if (!starts_with(args[i], '-')) {
|
||||||
target_pkg = args[i]
|
target_pkg = args[i]
|
||||||
// Resolve relative paths to absolute paths
|
// 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))
|
log.console(" " + effective_pkg + " " + old_str + " -> " + text(new_entry.commit, 0, 8))
|
||||||
shop.fetch(effective_pkg)
|
shop.fetch(effective_pkg)
|
||||||
} else {
|
} else {
|
||||||
// Local package - just ensure symlink is correct
|
// Local package - run git pull if requested
|
||||||
log.console(" " + effective_pkg + " (local)")
|
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.extract(effective_pkg)
|
||||||
shop.build_package_scripts(effective_pkg)
|
shop.build_package_scripts(effective_pkg)
|
||||||
|
|||||||
Reference in New Issue
Block a user