Replace scheduled AUR imports with direct upstream watches
This commit is contained in:
1 parent
f26a60aef7
commit
b34de5c29e
115 files changed
+2155
-1242
No files matched your search
+19
-20
@@ -6,7 +6,7 @@ source "$BUILD_ROOT/helpers/message-helpers.sh"
|
||||
source "$BUILD_ROOT/helpers/paths.sh"
|
||||
|
||||
PACKAGE=""
|
||||
SOURCE="aur"
|
||||
SOURCE="local"
|
||||
SYNC="true"
|
||||
RELEASE_RING=""
|
||||
AUR_PACKAGE=""
|
||||
@@ -17,14 +17,14 @@ usage() {
|
||||
cat <<EOF
|
||||
Usage: $0 <package> [OPTIONS]
|
||||
|
||||
Create pkgbuilds/<package> with Omarchy metadata. AUR packages are synced
|
||||
immediately after metadata is written.
|
||||
Create an Omarchy-owned package. --source aur imports a starting recipe once;
|
||||
future releases must use an upstream watch, provider, or hook.
|
||||
|
||||
Options:
|
||||
--source <aur|local> Package source (default: aur)
|
||||
--source <aur|local> Initial recipe source (default: local)
|
||||
--local Shortcut for --source local
|
||||
--aur <name> AUR package name when different from local directory
|
||||
--no-sync For AUR packages, mark sync disabled after initial setup
|
||||
--no-sync Keep the imported recipe manually maintained
|
||||
--fast Put package in the fast release ring
|
||||
--release-ring <ring> Release ring (currently: fast)
|
||||
--scaffold For local packages, create a starter PKGBUILD
|
||||
@@ -32,9 +32,9 @@ Options:
|
||||
-h, --help Show this help message
|
||||
|
||||
Examples:
|
||||
$0 yay
|
||||
$0 spotify --fast
|
||||
$0 signal-desktop --no-sync
|
||||
$0 yay --source aur
|
||||
$0 spotify --source aur --fast
|
||||
$0 signal-desktop --source aur --no-sync
|
||||
$0 omarchy-zsh --local --scaffold
|
||||
EOF
|
||||
}
|
||||
@@ -97,6 +97,10 @@ if [[ -z "$PACKAGE" ]]; then
|
||||
usage
|
||||
exit 1
|
||||
fi
|
||||
if [[ ! $PACKAGE =~ ^[a-zA-Z0-9@_+][a-zA-Z0-9@._+-]*$ ]]; then
|
||||
print_error "Invalid package name: $PACKAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
case "$SOURCE" in
|
||||
aur|local) ;;
|
||||
@@ -112,6 +116,11 @@ PACKAGE_DIR="$PKGBUILDS_DIR/$PACKAGE"
|
||||
OMARCHY_DIR="$PACKAGE_DIR/.omarchy"
|
||||
METADATA_FILE="$OMARCHY_DIR/package.json"
|
||||
|
||||
if [[ "$SOURCE" == aur && -f "$PACKAGE_DIR/PKGBUILD" ]]; then
|
||||
print_error "Refusing to replace the maintained recipe for $PACKAGE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -f "$METADATA_FILE" && "$FORCE" != true ]]; then
|
||||
print_error "Package metadata already exists: $METADATA_FILE"
|
||||
print_info "Use --force to overwrite it"
|
||||
@@ -146,18 +155,8 @@ jq -n "${jq_args[@]}" "$jq_filter" > "$METADATA_FILE"
|
||||
print_success "Wrote $METADATA_FILE"
|
||||
|
||||
if [[ "$SOURCE" == "aur" ]]; then
|
||||
if [[ "$SYNC" == "false" ]]; then
|
||||
# Temporarily sync once, then restore sync=false so future automated syncs skip it.
|
||||
tmpfile=$(mktemp)
|
||||
jq 'del(.sync)' "$METADATA_FILE" > "$tmpfile"
|
||||
mv "$tmpfile" "$METADATA_FILE"
|
||||
"$BUILD_ROOT/bin/sync-aur" "$PACKAGE"
|
||||
jq '. + {sync: false}' "$METADATA_FILE" > "$tmpfile"
|
||||
mv "$tmpfile" "$METADATA_FILE"
|
||||
print_info "AUR sync disabled for future runs"
|
||||
else
|
||||
"$BUILD_ROOT/bin/sync-aur" "$PACKAGE"
|
||||
fi
|
||||
"$BUILD_ROOT/bin/import-aur" "$PACKAGE"
|
||||
|
||||
else
|
||||
if [[ "$SCAFFOLD" == true && ! -f "$PACKAGE_DIR/PKGBUILD" ]]; then
|
||||
cat > "$PACKAGE_DIR/PKGBUILD" <<EOF
|
||||
|
||||
Reference in new issue
Block a user