Fix some build options
This commit is contained in:
1 parent
38977211d3
commit
b32e414279
2 files changed
+72
-7
No files matched your search
+66
-3
@@ -20,7 +20,8 @@ get_local_version() {
|
|||||||
local pkg="$1"
|
local pkg="$1"
|
||||||
if [[ -f /output/omarchy.db.tar.zst ]]; then
|
if [[ -f /output/omarchy.db.tar.zst ]]; then
|
||||||
# Find the exact desc file for this package
|
# Find the exact desc file for this package
|
||||||
local desc_file=$(tar -tf /output/omarchy.db.tar.zst | grep "^${pkg}-[0-9].*/desc$" | head -1)
|
# For VCS packages, version might start with 'r' instead of a digit
|
||||||
|
local desc_file=$(tar -tf /output/omarchy.db.tar.zst | grep "^${pkg}-[0-9r].*/desc$" | head -1)
|
||||||
|
|
||||||
if [[ -n "$desc_file" ]]; then
|
if [[ -n "$desc_file" ]]; then
|
||||||
# Extract that specific file and get the version
|
# Extract that specific file and get the version
|
||||||
@@ -52,9 +53,56 @@ build_github_package() {
|
|||||||
local pkg="$repo"
|
local pkg="$repo"
|
||||||
|
|
||||||
echo " GitHub repository: https://github.com/$github_repo"
|
echo " GitHub repository: https://github.com/$github_repo"
|
||||||
echo " Note: Skipping version check for GitHub packages"
|
|
||||||
|
|
||||||
# Always fresh clone for GitHub packages
|
# Check for always-build option
|
||||||
|
if [[ "$opts" == *"always-build"* ]]; then
|
||||||
|
echo " Note: Package flagged as always-build, will use timestamp version"
|
||||||
|
# Skip version checking for always-build packages
|
||||||
|
elif [[ "$pkg" == *-git ]]; then
|
||||||
|
# For -git packages, check if we need to rebuild based on commit
|
||||||
|
# Check if a source repo is specified (for packages where PKGBUILD repo != source repo)
|
||||||
|
local source_repo=""
|
||||||
|
if [[ "$opts" =~ source:([^ ]+) ]]; then
|
||||||
|
source_repo="${BASH_REMATCH[1]}"
|
||||||
|
echo " Checking source repository: $source_repo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use source repo if specified, otherwise use the PKGBUILD repo
|
||||||
|
local check_repo="${source_repo:-$github_repo}"
|
||||||
|
local latest_commit=$(git ls-remote "https://github.com/${check_repo}.git" HEAD 2>/dev/null | cut -f1 | head -c 7)
|
||||||
|
|
||||||
|
if [[ -n "$latest_commit" ]]; then
|
||||||
|
local local_version=$(get_local_version "$pkg")
|
||||||
|
|
||||||
|
if [[ -n "$local_version" ]]; then
|
||||||
|
# Extract commit hash from version (format: r<rev>.<commit>-<pkgrel>)
|
||||||
|
local local_commit=$(echo "$local_version" | grep -oE '\.[a-f0-9]{7}' | cut -d'.' -f2)
|
||||||
|
|
||||||
|
if [[ "$local_commit" == "$latest_commit" ]]; then
|
||||||
|
echo " ✓ Up to date: commit $latest_commit - Skipping"
|
||||||
|
SKIPPED_PACKAGES="$SKIPPED_PACKAGES $github_repo"
|
||||||
|
|
||||||
|
# If install option is set, install the existing package for dependencies
|
||||||
|
if [[ "$opts" == *"install"* ]]; then
|
||||||
|
echo " Installing existing package for dependencies..."
|
||||||
|
local latest_pkg=$(ls -t /output/${pkg}-*.pkg.tar.* 2>/dev/null | grep -v '\.sig$' | head -1)
|
||||||
|
if [[ -f "$latest_pkg" ]]; then
|
||||||
|
sudo pacman -U --noconfirm --needed "$latest_pkg" 2>/dev/null || true
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
return 0
|
||||||
|
else
|
||||||
|
echo " Update available: $local_commit -> $latest_commit"
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo " New package (commit: $latest_commit)"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo " Note: Non-git GitHub package, will check PKGBUILD version"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Fresh clone for building
|
||||||
cd /src
|
cd /src
|
||||||
rm -rf "$pkg"
|
rm -rf "$pkg"
|
||||||
|
|
||||||
@@ -74,6 +122,21 @@ build_github_package() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# For always-build packages, inject timestamp into pkgver to ensure unique filename
|
||||||
|
if [[ "$opts" == *"always-build"* ]]; then
|
||||||
|
# Get current date/time as version suffix
|
||||||
|
local timestamp=$(date +%Y%m%d.%H%M%S)
|
||||||
|
echo " Injecting timestamp: $timestamp"
|
||||||
|
|
||||||
|
# Modify PKGBUILD to append timestamp to pkgver
|
||||||
|
if grep -q '^pkgver=' PKGBUILD; then
|
||||||
|
# Get current pkgver and append timestamp
|
||||||
|
local current_pkgver=$(grep '^pkgver=' PKGBUILD | cut -d'=' -f2 | tr -d "'\"")
|
||||||
|
sed -i "s/^pkgver=.*/pkgver=${current_pkgver}.${timestamp}/" PKGBUILD
|
||||||
|
echo " Modified pkgver to: ${current_pkgver}.${timestamp}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Build package with signing
|
# Build package with signing
|
||||||
MAKEPKG_FLAGS="-sc --noconfirm"
|
MAKEPKG_FLAGS="-sc --noconfirm"
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,8 @@
|
|||||||
# Options:
|
# Options:
|
||||||
# - skip-pgp: Skip PGP signature verification
|
# - skip-pgp: Skip PGP signature verification
|
||||||
# - install: Install package in container (for dependencies)
|
# - install: Install package in container (for dependencies)
|
||||||
# Note: GitHub packages skip version checking and are built every time
|
# - always-build: Always build package with timestamp version (unique filename)
|
||||||
|
# - source:owner/repo: For -git packages, specify the actual source repo to check
|
||||||
|
|
||||||
#Core Install
|
#Core Install
|
||||||
1password-beta
|
1password-beta
|
||||||
@@ -14,8 +15,8 @@
|
|||||||
limine-mkinitcpio-hook
|
limine-mkinitcpio-hook
|
||||||
limine-snapper-sync
|
limine-snapper-sync
|
||||||
localsend-bin
|
localsend-bin
|
||||||
omacom-io/asdcontrol-git
|
omacom-io/asdcontrol-git source:nikosdion/asdcontrol
|
||||||
omacom-io/omarchy-lazyvim
|
omacom-io/omarchy-lazyvim always-build
|
||||||
omarchy-chromium-bin
|
omarchy-chromium-bin
|
||||||
pinta
|
pinta
|
||||||
python-terminaltexteffects
|
python-terminaltexteffects
|
||||||
@@ -24,7 +25,7 @@ ttf-ia-writer
|
|||||||
typora
|
typora
|
||||||
tzupdate
|
tzupdate
|
||||||
ufw-docker
|
ufw-docker
|
||||||
walker-bin
|
# walker-bin # Not maintained any longer
|
||||||
wl-screenrec
|
wl-screenrec
|
||||||
yaru-icon-theme
|
yaru-icon-theme
|
||||||
yay
|
yay
|
||||||
@@ -41,3 +42,4 @@ symfony-cli
|
|||||||
dropbox install
|
dropbox install
|
||||||
dropbox-cli
|
dropbox-cli
|
||||||
nautilus-dropbox
|
nautilus-dropbox
|
||||||
|
openai-codex-bin
|
||||||
Reference in new issue
Block a user