mirror of
https://github.com/pygos/build.git
synced 2024-11-22 11:09:46 +01:00
Integrate prefered provider mechanism of pkg utility
This commit renames the release packages so they all produce a single package named "release", creates a preference listing from the PREFERED_PROVIDER array and lets `pkg buildstrategy` decide what package to build. Signed-off-by: David Oberhollenzer <goliath@infraroot.at>
This commit is contained in:
parent
491d09f544
commit
268c0a605b
4 changed files with 17 additions and 15 deletions
11
mk.sh
11
mk.sh
|
@ -30,6 +30,7 @@ PACKAGELIST="$BUILDROOT/pkglist"
|
||||||
REPODIR="$BUILDROOT/repo"
|
REPODIR="$BUILDROOT/repo"
|
||||||
DEPENDSLIST="$BUILDROOT/depends"
|
DEPENDSLIST="$BUILDROOT/depends"
|
||||||
PROVIDESLIST="$BUILDROOT/provides"
|
PROVIDESLIST="$BUILDROOT/provides"
|
||||||
|
PREFERESLIST="$BUILDROOT/preferes"
|
||||||
|
|
||||||
declare -A PREFERED_PROVIDER
|
declare -A PREFERED_PROVIDER
|
||||||
|
|
||||||
|
@ -71,7 +72,7 @@ done
|
||||||
|
|
||||||
echo "--- resolving package dependencies ---"
|
echo "--- resolving package dependencies ---"
|
||||||
|
|
||||||
truncate -s 0 $DEPENDSLIST $PROVIDESLIST
|
truncate -s 0 "$DEPENDSLIST" "$PROVIDESLIST" "$PREFERESLIST"
|
||||||
|
|
||||||
for pkg in $SCRIPTDIR/pkg/*; do
|
for pkg in $SCRIPTDIR/pkg/*; do
|
||||||
include_pkg $(basename $pkg)
|
include_pkg $(basename $pkg)
|
||||||
|
@ -84,8 +85,12 @@ for pkg in $SCRIPTDIR/pkg/*; do
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
pkg buildstrategy -p "$PROVIDESLIST" -d "$DEPENDSLIST" \
|
for pkg in "${!PREFERED_PROVIDER[@]}"; do
|
||||||
"${PREFERED_PROVIDER[release]}" > "$PACKAGELIST"
|
echo "$pkg,${PREFERED_PROVIDER[$pkg]}" >> "$PREFERESLIST"
|
||||||
|
done
|
||||||
|
|
||||||
|
pkg buildstrategy -p "$PROVIDESLIST" -d "$DEPENDSLIST" -P "$PREFERESLIST" \
|
||||||
|
"release" > "$PACKAGELIST"
|
||||||
cat "$PACKAGELIST"
|
cat "$PACKAGELIST"
|
||||||
|
|
||||||
echo "--- building packages ---"
|
echo "--- building packages ---"
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
DEPENDS="rootfs"
|
DEPENDS="rootfs"
|
||||||
|
SUBPKG="release"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" -R "$REPODIR" $DEPENDS
|
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" -R "$REPODIR" $DEPENDS
|
||||||
|
@ -19,10 +20,8 @@ build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
tar czf "$BUILDROOT/$PKGNAME.tar.gz" *
|
tar czf "$BUILDROOT/release.tar.gz" *
|
||||||
|
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
|
||||||
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
|
||||||
touch "$PKGDEPLOYDIR/$PKGNAME.desc"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_update() {
|
check_update() {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
DEPENDS="rootfs"
|
DEPENDS="rootfs"
|
||||||
|
SUBPKG="release"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" -R "$REPODIR" $DEPENDS
|
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" -R "$REPODIR" $DEPENDS
|
||||||
|
@ -23,10 +24,8 @@ build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
tar czf "$BUILDROOT/$PKGNAME.tar.gz" *
|
tar czf "$BUILDROOT/release.tar.gz" *
|
||||||
|
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
|
||||||
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
|
||||||
touch "$PKGDEPLOYDIR/$PKGNAME.desc"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_update() {
|
check_update() {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
DEPENDS="rootfs boot-rpi3"
|
DEPENDS="rootfs boot-rpi3"
|
||||||
|
SUBPKG="release"
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
pkg install -om -r "$PKGBUILDDIR/boot" -R "$REPODIR" $DEPENDS
|
pkg install -om -r "$PKGBUILDDIR/boot" -R "$REPODIR" $DEPENDS
|
||||||
|
@ -21,10 +22,8 @@ build() {
|
||||||
}
|
}
|
||||||
|
|
||||||
deploy() {
|
deploy() {
|
||||||
tar czf "$BUILDROOT/$PKGNAME.tar.gz" *
|
tar czf "$BUILDROOT/release.tar.gz" *
|
||||||
|
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
|
||||||
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
|
||||||
touch "$PKGDEPLOYDIR/$PKGNAME.desc"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_update() {
|
check_update() {
|
||||||
|
|
Loading…
Reference in a new issue