[PATCH] add --copyin and --copyout to mock.

Clark Williams williams at redhat.com
Thu Dec 13 20:52:07 UTC 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Attached is a patch that adds the --copyin and --copyout options to mock. These
options allow people to add to a chroot and to pull files out of a chroot, without
having to know the path to the chroot.

Usage:

	mock -r <config> --copyin foo bar baz /tmp

copies the files foo, bar and baz to the chroot /tmp directory for <config>

	mock -r <config> --copyout /tmp/result.txt /opt/mydir/something ./results

copies the files <chroot>/tmp/result.txt and <chroot>/opt/mydir/something into the
local dir ./results.

In the process of doing this I was bitten by os.path.join()'s "intelligent behavior",
in that when using it to do a copyin, it would refuse to join two absolute paths.
While coming up with a utility function to do what I wanted, Michael saw that we were
manipulating the self.rootdir a bit haphazardly and we arrived at makeChrootPath() as
a method in the Root object. I then did a first cut at replacing ad hoc usage of
self.rootdir with self.makeChrootPath().

Unless someone objects strenuously, I'll commit this tonight.

Clark
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org

iD8DBQFHYZt3Hyuj/+TTEp0RAq6hAKDkVtmPrWH3NmKGcjEI46HhM6GpCQCfY8oe
lJAtUdxKXWDS3ilnYdJR1fY=
=SNv7
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: copy-in-out.patch
URL: <http://listman.redhat.com/archives/fedora-buildsys-list/attachments/20071213/5c833944/attachment.ksh>


More information about the Fedora-buildsys-list mailing list