Merge pull request #2431 from Kwiboo/pkg-stamp

Add PKG_STAMP to trigger a package rebuild
This commit is contained in:
Christian Hewitt 2019-04-12 16:03:05 +04:00 committed by GitHub
commit 20eaca6026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 7 deletions

View File

@ -760,11 +760,16 @@ get_pkg_directory() {
} }
calculate_stamp() { calculate_stamp() {
local stamp local stamp data
stamp="$PKG_DIR $PROJECT_DIR/$PROJECT/patches/$PKG_NAME" stamp="$PKG_DIR $PROJECT_DIR/$PROJECT/patches/$PKG_NAME"
[ -n "$DEVICE" ] && stamp+=" $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME" [ -n "$DEVICE" ] && stamp+=" $PROJECT_DIR/$PROJECT/devices/$DEVICE/patches/$PKG_NAME"
[ -n "$PKG_NEED_UNPACK" ] && stamp+=" $PKG_NEED_UNPACK" [ -n "$PKG_NEED_UNPACK" ] && stamp+=" $PKG_NEED_UNPACK"
find ${stamp} -exec sha256sum {} \; 2>/dev/null | sed "s/ ${ROOT//\//\\/}\// /" | sort | sha256sum | cut -d" " -f1
data="$(find ${stamp} -exec sha256sum {} \; 2>/dev/null | sed "s/ ${ROOT//\//\\/}\// /")"
[ -n "${PKG_STAMP}" ] && data+=$'\n'"$(echo "${PKG_STAMP}" | sha256sum)"
echo "${data}" | sort | sha256sum | cut -d" " -f1
} }
target_has_feature() { target_has_feature() {

View File

@ -11,6 +11,7 @@ PKG_DEPENDS_INIT="toolchain"
PKG_NEED_UNPACK="$LINUX_DEPENDS" PKG_NEED_UNPACK="$LINUX_DEPENDS"
PKG_LONGDESC="This package contains a precompiled kernel image and the modules." PKG_LONGDESC="This package contains a precompiled kernel image and the modules."
PKG_IS_KERNEL_PKG="yes" PKG_IS_KERNEL_PKG="yes"
PKG_STAMP="$KERNEL_TARGET $KERNEL_MAKE_EXTRACMD $KERNEL_UBOOT_EXTRA_TARGET"
PKG_PATCH_DIRS="$LINUX" PKG_PATCH_DIRS="$LINUX"

View File

@ -9,6 +9,7 @@ PKG_DEPENDS_TARGET="toolchain dtc:host"
PKG_LICENSE="GPL" PKG_LICENSE="GPL"
PKG_LONGDESC="Das U-Boot is a cross-platform bootloader for embedded systems." PKG_LONGDESC="Das U-Boot is a cross-platform bootloader for embedded systems."
PKG_IS_KERNEL_PKG="yes" PKG_IS_KERNEL_PKG="yes"
PKG_STAMP="$UBOOT_SYSTEM"
PKG_NEED_UNPACK="$PROJECT_DIR/$PROJECT/bootloader" PKG_NEED_UNPACK="$PROJECT_DIR/$PROJECT/bootloader"
[ -n "$DEVICE" ] && PKG_NEED_UNPACK+=" $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader" [ -n "$DEVICE" ] && PKG_NEED_UNPACK+=" $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader"

View File

@ -49,8 +49,6 @@ if [ -f $STAMP ]; then
rm -f $STAMP rm -f $STAMP
elif [ ! "$BUILD_WITH_DEBUG" = "$STAMP_BUILD_WITH_DEBUG" ]; then elif [ ! "$BUILD_WITH_DEBUG" = "$STAMP_BUILD_WITH_DEBUG" ]; then
rm -f $STAMP rm -f $STAMP
elif [ "${PKG_NAME}" = "u-boot" -a ! "$UBOOT_SYSTEM" = "$STAMP_UBOOT_SYSTEM" ]; then
rm -f $STAMP
else else
# stamp matched: already built, do nothing # stamp matched: already built, do nothing
pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "already built" pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "already built"
@ -502,8 +500,5 @@ PKG_DEEPHASH=$(calculate_stamp)
for i in PKG_NAME PKG_DEEPHASH BUILD_WITH_DEBUG; do for i in PKG_NAME PKG_DEEPHASH BUILD_WITH_DEBUG; do
echo "STAMP_$i=\"${!i}\"" >> $STAMP echo "STAMP_$i=\"${!i}\"" >> $STAMP
done done
if [ "${PKG_NAME}" = "u-boot" ]; then
echo "STAMP_UBOOT_SYSTEM=\"${UBOOT_SYSTEM}\"" >> $STAMP
fi
pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "built" pkg_lock_status "UNLOCK" "${PKG_NAME}:${TARGET}" "build" "built"