Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#13442 - makechrootpkg permenantly chowns local directories to nobody

Attached to Project: Arch Linux
Opened by dtw (dibblethewrecker) - Tuesday, 24 February 2009, 15:31 GMT
Last edited by Allan McRae (Allan) - Friday, 01 May 2009, 16:14 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Aaron Griffin (phrakture)
Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

The problem appears to lie here:

Line 155:

[ ! -z "$SRCDEST" ] && mount --bind "$SRCDEST" "$uniondir/srcdest"

Line 168:

chown -R nobody "$uniondir/srcdest"
This task depends upon

Closed by  Allan McRae (Allan)
Friday, 01 May 2009, 16:14 GMT
Reason for closing:  Fixed
Additional comments about closing:  In git: commit 486375ba
Comment by dtw (dibblethewrecker) - Tuesday, 24 February 2009, 15:31 GMT
Wracking brain for simple solution. The simplest thing could just be for me personally to chown 775 my srcdir so i can read and write based on the group. However, it still seems wrong that a script permenantly changes permissions!

Other options:

1) don't use mount --bind
2) chown it back
3) don't use nobody and add a new user?
4) ...
Comment by Aaron Griffin (phrakture) - Tuesday, 24 February 2009, 15:57 GMT
Hmm, I don't remember writing that chunk...
Can you use mount options to get the group when you bind the dir?
Comment by dtw (dibblethewrecker) - Tuesday, 24 February 2009, 16:26 GMT
I don't think so, --bind is pretty basic. Obviously unionfs provides much more in that way.

Although I have only mentioned the srcdest obviously the same applies to the pkgdest but the needs are different.

With the pkgdest we could forgo the bind completely and chuck in a simple mv or cp for the resulting pkg. With the srcdest another unionfs mount would make nice use of existing src downloads, but would prevent local caching of any new src downloads while in the chroot. However, we could mv or cp anything remaining in the chroot srcdest over to local srcdest once we unmount the union?

Since we're already in sudo the permissions wouldn't be a prob.

.:edit:.
s/dir/dest/
Comment by Aaron Griffin (phrakture) - Tuesday, 24 February 2009, 17:05 GMT
Yeah, this could be fixed simply by not binding, and copying the source and package to SRCDEST/PKGDEST after the build, if defined.
Comment by dtw (dibblethewrecker) - Tuesday, 24 February 2009, 17:23 GMT
I think doing a unionfs on the srcdest to use any existing src is a bloody good idea (tm) - I'm sure the whole motivation in --bind in the first place was to reduce downloads. If we don't do some sort of tranposition it'll grab the source every build won't it?
Comment by Aaron Griffin (phrakture) - Tuesday, 24 February 2009, 18:18 GMT
Well, not exactly. makechrootpkg will copy everything it finds in the local filesystem that is in the sources array. And then will move things back to the local dir.

Example:
cd svn-packages && rm -rf bash && svn up bash && cd bash/trunk
# dir is clean now, except SVN files

sudo makechrootpkg -r ~/archroot/
# this downloads all bash sources
# on completion all sources downloaded and the package file is copied locally

sudo makechrootpkg -r ~/archroot/
# local files are copied to the chroot before building - not redownloaded

Comment by dtw (dibblethewrecker) - Tuesday, 24 February 2009, 18:36 GMT
ahh the sources array, panacea of source tarball management.
Comment by dtw (dibblethewrecker) - Wednesday, 04 March 2009, 13:27 GMT
How's this? My first effort with git and my first bash for sometime...
Comment by Aaron Griffin (phrakture) - Wednesday, 04 March 2009, 22:23 GMT
Shouldn't it do the same for PKGDEST as well?

Also, I imagine there's an easier way to do the copying _to_ part:
in the existing loop, also check if [ -n "$SRCDEST" -a -e "$SRCDEST/$file" ]
Comment by Aaron Griffin (phrakture) - Wednesday, 04 March 2009, 22:25 GMT
Another note: no need to check if the item is in the source array when copying out - considering this is a clean chroot, the only things that will be in the srcdest/ dir will be from the sources array.
Comment by dtw (dibblethewrecker) - Sunday, 08 March 2009, 09:51 GMT
Still no PKGDEST but changes as suggested.
Comment by dtw (dibblethewrecker) - Sunday, 08 March 2009, 10:04 GMT
PKGDEST
Comment by Aaron Griffin (phrakture) - Monday, 09 March 2009, 19:26 GMT
Committed a reworked patch:
http://projects.archlinux.org/?p=devtools.git;a=commitdiff;h=486375ba0aedb185b369946fe565538c0f8e7949

Please check this over, I didn't test it
Comment by dtw (dibblethewrecker) - Monday, 09 March 2009, 21:28 GMT
Looks ok to me.
Comment by Allan McRae (Allan) - Sunday, 15 March 2009, 09:49 GMT
Looks good to me to. I don't use {SRC,PKG}DEST so I didn't test that but my usual usage still works...

Perhaps we should do a devtools release. There are a lot of useful new patches.
Comment by Aaron Griffin (phrakture) - Tuesday, 17 March 2009, 19:03 GMT
Hmmm hold off on the devtools release for a bit. I want to add in support for the 'any' arch (if anything is needed) once I get the dbscripts straightened out.

Also, the rebuild script needs a little bit of work to be fully usable

Loading...