Maybe this goes against the philosphy of the build script, but couldn't you use rsync instead of taring and untaring? This would help with a use case where our users are complaining about having to tar and untar big things, like the kernel-source, when doing development. We could just treat their Subversion workareas as the overlay directory and overlay it where kernel-source.tar.bz2 would be untarred normally. This would necessitate specifying the root of the overlay in the chroot though, so may make this overcomplicated. Jan-Simon Möller wrote:
Hi !
During work on openSUSE@ARM I frequently wanted to change single files or add single files to the buildroot without recompiling a dependency package or adding the files to a dummy rpm. Thus here are 2 patches for osc and build which will do this:
Take all files in the specified "overlay"-folder and copy them to the buildroot before actually starting the build. This can help especially in local development with osc build if you e.g. want to delpoy a custom debugger, a custom qemu-arm or even a patched file.
Best, Jan-Simon
Signed-off-by: Jan-Simon Möller
Index: build.py =================================================================== --- build.py (Revision 7845) +++ build.py (Arbeitskopie) @@ -511,6 +511,23 @@ vm_options, build_descr, buildargs) + # special handling for overlay + if opts.overlay: + myoverlay=os.path.abspath(opts.overlay) + if os.path.isdir(myoverlay): + cmd = '%s --root=%s --rpmlist=%s --dist=%s --overlay=%s --arch=%s %s %s %s' \ + % (config['build-cmd'], + config['build-root'], + rpmlist_file.name, + bc_file.name, + myoverlay, + bi.buildarch, + vm_options, + build_descr, + buildargs) + else: + print "ERROR: OVERLAY ("+myoverlay+") is no directory." + sys.exit(1)
if config['su-wrapper'].startswith('su '): tmpl = '%s \'%s\'' Index: commandline.py =================================================================== --- commandline.py (Revision 7845) +++ commandline.py (Arbeitskopie) @@ -2238,6 +2238,8 @@
@cmdln.option('--clean', action='store_true', help='Delete old build root before initializing it') + @cmdln.option('--overlay', metavar='OVERLAY', + help='Copy overlay filesystem to buildroot after installing all RPMs. This must be a valid directory (e.g. /tmp/overlay-root). The files are copied as-is.') @cmdln.option('--no-changelog', action='store_true', help='don\'t update the package changelog from a changes file') @cmdln.option('--noinit', '--no-init', action='store_true',
Index: build =================================================================== --- build (Revision 7845) +++ build (Arbeitskopie) @@ -63,6 +63,7 @@ INCARNATION= DISTURL= CHANGETARGET= +OVERLAY=
export PATH=$BUILD_DIR:/sbin:/usr/sbin:$PATH
@@ -157,6 +158,9 @@
--icecream N use N parallel build jobs with icecream + --overlay OVERLAY + Copy overlay filesystem to buildroot after installing + all RPMs. This must be a valid directory.
--debug enable creation of a debuginfo package @@ -664,6 +668,10 @@ *-changelog) CHANGELOG=true ;; + --overlay) + OVERLAY=$ARG + shift + ;; -*) echo Unknown Option "$PARAM". Exit. cleanup_and_exit 1 @@ -1332,6 +1340,17 @@
BUILD_SUCCEEDED=false
+ if test -n "$OVERLAY" ; then + if test -d "$OVERLAY"; then + pushd $OVERLAY + echo "Copying overlay to BUILD_ROOT" + tar -cpf - . | (cd $BUILD_ROOT ; tar -xf -) + popd + else + echo "OVERLAY ($OVERLAY) is no directory - skipping" + fi + fi + if test "$BUILDTYPE" = spec ; then test -z "$BUILD_RPM_BUILD_STAGE" && BUILD_RPM_BUILD_STAGE=-ba
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org