Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildsystem: Create unpack stamps for packages without sources #1387

merged 7 commits into from Feb 28, 2017


Copy link

commented Feb 23, 2017

We have packages, such as TexturePacker and JsonSchemaBuilder that do not have their own sources tarball, but instead build using sources from within the already unpacked kodi package.

This currently means that neither TexturePacker nor JsonSchemaBuilder have an unpack stamp ($PKG_BUILD/.libreelec-unpack), as scripts/unpack will only calculate the stamp if there is something to unpack.

It is therefore impossible for the build system to determine if these packages are clean or not, and consequently they are being repeatedly cleaned during each incremental build, even when cleaning is not required (for instance, when rebuilding some other unrelated package).

In addition, the for TexturePackage and JsonSchemaBuilder includes a "manual" call to scripts/clean which is unnecessary once a stamp is available.

This PR resolves these issues, and now creates a stamp for those packages without their own sources (obviously, the packages need to be defined correctly, with a $PKG_NEED_UNPACK dependency where necessary, etc. - this happens to be missing for kodi-theme-Estuary).

The $PKG_NEED_UNPACK dependency (in thise case kodi) ensures that whenever the kodi package is changed the TexturePacker, JsonSchemaBuilder and kodi-theme-Estuary packages will be automatically cleaned. "Manual" cleaning is no longer required.


The changes to scripts/unpack look a little scary because I've moved a large chunk of code within an if..then condition, so that the code is only executed whenever a source tarball or $PKG_DIR/sources is available. Add ?w=1 to the PR url to hide the white space changes and it becomes a lot less scary.

This change to scripts/unpack allows the stamp to be calculated upon successful unpack, regardless of whether sources are available or not.

The final disk io commits are simply an optimisation - we know the name of the stamp file and build directory, there's really no need to go looking for it with a wildcard.

@MilhouseVH MilhouseVH requested a review from lrusak Feb 23, 2017

@MilhouseVH MilhouseVH force-pushed the MilhouseVH:absolute_paths_extra branch 4 times, most recently from e716b56 to 6a6add5 Feb 23, 2017


This comment has been minimized.

Copy link
Contributor Author

commented Feb 23, 2017

The last unpack commit is possibly also a bug fix as

for config in `find $BUILD/$1* -name config.guess | sed 's/config.guess//'`; do

would process config.guess for any package matching $1*, ie. kodi-<ver>, kodi-theme-Estuary-<ver>, kodi-platform-<ver> would all be processed when $1 == kodi.

Unless my understanding of this code is completely wrong, of course.

I also rearranged the logic so that we don't attempt the find unless we intend to use the results - the old version would always perform the (potentially expensive) find and then do nothing with it depending on $PKG_NAME.

@MilhouseVH MilhouseVH force-pushed the MilhouseVH:absolute_paths_extra branch from 6a6add5 to d94dace Feb 23, 2017


This comment has been minimized.

Copy link

commented Feb 27, 2017

Looks pretty good to me

If you append ?w=1 to the url it crushes the whitespace changes

lrusak approved these changes Feb 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.