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:14:48 +0200
  • Message-id: <200908141814.48955.dl9pf@xxxxxx>
Am Freitag 14 August 2009 17:54:42 schrieb Luke Imhoff:
For the paths, before passing to os.path.abspath, you probably want to
run it through the expansion os.path.expanduser() to cover ~/foo and
os.path.expandvars() to cover $DIR/foo. It's one of the annoyances of
os.path that user and environment variable expansion aren't built into
abspath.

New version of build.py

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 = ""
+ myrsyncdest = ""
+ if os.path.isdir(opts.rsyncsrc):
+ myrsyncsrc =
os.path.abspath(os.path.expanduser(os.path.expandvars(opts.rsyncsrc)))
+ 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=""
+ if not os.path.isdir(opts.overlay):
+ print "--overlay " + str(opts.overlay) + " is no valid directory!"
+ sys.exit(1)
+
myoverlay=os.path.abspath(os.path.expanduser(os.path.expandvars(opts.overlay)))
+ 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