Mailinglist Archive: opensuse-buildservice (182 mails)

< Previous Next >
Re: [opensuse-buildservice] [PATCH] Add --build-uid to osc and --uid to build
  • From: David Greaves <david@xxxxxxxxxxxx>
  • Date: Fri, 12 Feb 2010 22:11:57 +0000
  • Message-id: <4B75D22D.5080603@xxxxxxxxxxxx>
Marcus, Ludwig

So this is an old patch that I've refreshed and incorporated feedback.

Can you take a look and confirm it's OK for me to push.

build patch:
http://gitorious.org/opensuse/lbt-build/commit/613eece338ce380536f2a1aac50084a8d1745a34

osc patch:
http://gitorious.org/opensuse/lbt-osc/commit/d49c59008702edc2439a20ebd1d311db8c4350cd

Ludwig Nussel wrote:
David Greaves wrote:
When building locally in a qemu/chroot and debugging I find I want to edit
the
files in the chroot from my desktop gui editor but they're all owned by
399:399.
This pair of patches allows me to set the uid:gid to match my local user and
eases this process.

usage is:
build --build-abuild-id uid:gid

Quite long, what about just using --uid?

OK.
I'm using --uid in build and --build-uid in osc (since the config is build-uid
and the opts is --build-uid)
(I never really expect it to come from

+ --build-abuild-id)
+ ABUILD_ID="$ARG"
+ if [[ ${BASH_VERSINFO[0]} -ge 3 && ! $ABUILD_ID =~
^[0-9]{1,5}:[0-9]{1,5}$ ]] ; then

if test -n "${ABUILD_UID//[0-9]/}"; then ... works with bash2 too
OK, done

if test $BUILD_USER = abuild ; then
if ! egrep '^abuild:' >/dev/null <$BUILD_ROOT/etc/passwd ; then
- echo 'abuild::399:399:Autobuild:/home/abuild:/bin/bash'
$BUILD_ROOT/etc/passwd
+ echo
"abuild::${ABUILD_UID}:${ABUILD_GID}:Autobuild:/home/abuild:/bin/bash"
$BUILD_ROOT/etc/passwd

You should better check whether uids still match.
Done

--- osc-0.117/osc/conf.py 2009-04-22 12:16:00.000000000 +0100
+++ osc-0.117lbt/osc/conf.py 2009-05-08 20:30:51.758699798 +0100
@@ -48,6 +48,7 @@
+ 'build-abuild-id': '399:399',

osc shouldn't hard code that setting. Default should be empty ie
don't pass the uid option.
Done.

I also allowed "caller" as a value to osc --build-uid as suggested by darix.

David

--
"Don't worry, you'll be fine; I saw it work in a cartoon once..."
--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >