Mailinglist Archive: opensuse-buildservice (262 mails)

< Previous Next >
Re: [opensuse-buildservice] [osc] patch to support overlay filesystem - RFC
  • From: "Jan-Simon Möller" <dl9pf@xxxxxx>
  • Date: Fri, 14 Aug 2009 18:35:04 +0200
  • Message-id: <200908141835.04188.dl9pf@xxxxxx>
Am Freitag 14 August 2009 18:21:05 schrieb Luke Imhoff:
You need to do the expansions and abspathing before checking if it's a
directory as stuff like '~' will return False from isdir.
You're right x-)

Best,
Jan-Simon
Index: build.py
===================================================================
--- build.py (Revision 7876)
+++ build.py (Arbeitskopie)
@@ -502,11 +502,44 @@
vm_options+=" --memory " + config['build-memory']

print 'Running build'
- cmd = '%s --root=%s --rpmlist=%s --dist=%s --arch=%s %s %s %s' \
+ # special handling for overlay and rsync-src/dest
+ specialcmdopts = " "
+ if opts.rsyncsrc or opts.rsyncdest :
+ if not opts.rsyncsrc or not opts.rsyncdest:
+ print "When using --rsync-{src,dest} both parameters have to be
specified."
+ sys.exit(1)
+ myrsyncsrc = os.path.expanduser(os.path.expandvars(opts.rsyncsrc))
+ myrsyncdest = ""
+ if os.path.isdir(myrsyncsrc):
+ myrsyncsrc = os.path.abspath(myrsyncsrc)
+ else:
+ print "--rsync-src " + str(opts.rsyncsrc) + " is no valid
directory!"
+ sys.exit(1)
+ # can't check destination - its in the target chroot ;) - but we can
check for sanity
+ if not opts.rsyncdest.startswith("/"):
+ print "--rsync-dest " + str(opts.rsyncsrc) + " is no absolute path
(starting with '/')!"
+ sys.exit(1)
+ myrsyncdest = os.path.expandvars(opts.rsyncdest)
+ specialcmdopts += '--rsync-src=%s --rsync-dest=%s' \
+ % (myrsyncsrc,
+ myrsyncdest)
+ if opts.overlay:
+ myoverlay = os.path.expanduser(os.path.expandvars(opts.overlay))
+ if not os.path.isdir(myoverlay):
+ print "--overlay " + str(opts.overlay) + " is no valid directory!"
+ sys.exit(1)
+ myoverlay = os.path.abspath(myoverlay)
+ specialcmdopts += '--overlay=%s' \
+ % (myoverlay)
+
+
+
+ cmd = '%s --root=%s --rpmlist=%s --dist=%s %s --arch=%s %s %s %s' \
% (config['build-cmd'],
config['build-root'],
rpmlist_file.name,
bc_file.name,
+ specialcmdopts,
bi.buildarch,
vm_options,
build_descr,
< Previous Next >
Follow Ups