mirror of
https://github.com/pygos/build.git
synced 2024-11-22 02:59:47 +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"
|
||||
DEPENDSLIST="$BUILDROOT/depends"
|
||||
PROVIDESLIST="$BUILDROOT/provides"
|
||||
PREFERESLIST="$BUILDROOT/preferes"
|
||||
|
||||
declare -A PREFERED_PROVIDER
|
||||
|
||||
|
@ -71,7 +72,7 @@ done
|
|||
|
||||
echo "--- resolving package dependencies ---"
|
||||
|
||||
truncate -s 0 $DEPENDSLIST $PROVIDESLIST
|
||||
truncate -s 0 "$DEPENDSLIST" "$PROVIDESLIST" "$PREFERESLIST"
|
||||
|
||||
for pkg in $SCRIPTDIR/pkg/*; do
|
||||
include_pkg $(basename $pkg)
|
||||
|
@ -84,8 +85,12 @@ for pkg in $SCRIPTDIR/pkg/*; do
|
|||
done
|
||||
done
|
||||
|
||||
pkg buildstrategy -p "$PROVIDESLIST" -d "$DEPENDSLIST" \
|
||||
"${PREFERED_PROVIDER[release]}" > "$PACKAGELIST"
|
||||
for pkg in "${!PREFERED_PROVIDER[@]}"; do
|
||||
echo "$pkg,${PREFERED_PROVIDER[$pkg]}" >> "$PREFERESLIST"
|
||||
done
|
||||
|
||||
pkg buildstrategy -p "$PROVIDESLIST" -d "$DEPENDSLIST" -P "$PREFERESLIST" \
|
||||
"release" > "$PACKAGELIST"
|
||||
cat "$PACKAGELIST"
|
||||
|
||||
echo "--- building packages ---"
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
DEPENDS="rootfs"
|
||||
SUBPKG="release"
|
||||
|
||||
build() {
|
||||
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" -R "$REPODIR" $DEPENDS
|
||||
|
@ -19,10 +20,8 @@ build() {
|
|||
}
|
||||
|
||||
deploy() {
|
||||
tar czf "$BUILDROOT/$PKGNAME.tar.gz" *
|
||||
|
||||
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
||||
touch "$PKGDEPLOYDIR/$PKGNAME.desc"
|
||||
tar czf "$BUILDROOT/release.tar.gz" *
|
||||
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
|
||||
}
|
||||
|
||||
check_update() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
DEPENDS="rootfs"
|
||||
SUBPKG="release"
|
||||
|
||||
build() {
|
||||
pkg install -om -r "$PKGBUILDDIR/$OS_RELEASE" -R "$REPODIR" $DEPENDS
|
||||
|
@ -23,10 +24,8 @@ build() {
|
|||
}
|
||||
|
||||
deploy() {
|
||||
tar czf "$BUILDROOT/$PKGNAME.tar.gz" *
|
||||
|
||||
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
||||
touch "$PKGDEPLOYDIR/$PKGNAME.desc"
|
||||
tar czf "$BUILDROOT/release.tar.gz" *
|
||||
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
|
||||
}
|
||||
|
||||
check_update() {
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
DEPENDS="rootfs boot-rpi3"
|
||||
SUBPKG="release"
|
||||
|
||||
build() {
|
||||
pkg install -om -r "$PKGBUILDDIR/boot" -R "$REPODIR" $DEPENDS
|
||||
|
@ -21,10 +22,8 @@ build() {
|
|||
}
|
||||
|
||||
deploy() {
|
||||
tar czf "$BUILDROOT/$PKGNAME.tar.gz" *
|
||||
|
||||
touch "$PKGDEPLOYDIR/$PKGNAME.files"
|
||||
touch "$PKGDEPLOYDIR/$PKGNAME.desc"
|
||||
tar czf "$BUILDROOT/release.tar.gz" *
|
||||
touch "$PKGDEPLOYDIR/release.files" "$PKGDEPLOYDIR/release.desc"
|
||||
}
|
||||
|
||||
check_update() {
|
||||
|
|
Loading…
Reference in a new issue