#36 RFE - Specify alternate location to extract sources
Closed: Fixed None Opened 12 years ago by orion.

I don't use mock locally, so I need to specify a different location to extract the sources. I also generally have the sources extracted in the current directory and so would like to be able to do that, but I don't know how common that is.

So, how to pass in a different location for extract_dir to Sources.extract()?

(looks like a 0.1.3 version is needed in trac)


I would not extract the sources in the current directory. Although an argument to do it might be interesting.

I think I would extract the sources in a temp directory, maybe a little bit like what Stanislav did for the [http://git.fedorahosted.org/git/?p=FedoraReview.git;a=blob;f=src/FedoraReview/checks/generic.py#l344 CheckSourceMD5]

So, my thought is to extract the source into a temporary directory if we cant use the mock path. The question I'm facing now is why is "extract_dir" a property of Source() rather than Sources() since it is the same every source. If it were in Sources() then we could retrieve the extract_dir for use by the checks for finding the files.

Also I note that extracting multiple sources into the same directory may not match how the rpm does it in %prep. For that reason it might make sense to always extract the sources into a temporary directory rather than the mock dir if they are not already extracted.

In my branch, yet to be published, everything is extracted in current directory, under a common root. One obvious reason is that to make teh review, you need to see the sources, unpacked and extracted.

Basically, it shouldn't be a problem to create an empty directory to make a review?!

Basically fixed in 9006a17, although this code has been heavily revised later. A review directory is created under current directory. This dir contains unpacked srpms and upstream sources. Closing, somewhat tentative - please reopen bug if current behaviour doesn't fir your needs.

With current master:

{{{
$ fedora-review -n VirtualGL -p -v
Processing local files: VirtualGL
Getting .spec and .srpm Urls from : Local files in /export/home/orion/redhat/VirtualGL-2.3.1
...
Using local rpms: /export/home/orion/redhat/VirtualGL-2.3.1/VirtualGL-2.3.1-2.fc17.src.rpm
/export/home/orion/redhat/VirtualGL-2.3.1/VirtualGL-2.3.1-2.fc17.i686.rpm
/export/home/orion/redhat/VirtualGL-2.3.1/VirtualGL-debuginfo-2.3.1-2.fc17.i686.rpm
Run command: rpm -qpl /export/home/orion/redhat/VirtualGL-2.3.1/VirtualGL-2.3.1-2.fc17.i686.rpm
Run command: rpm -qpl /export/home/orion/redhat/VirtualGL-2.3.1/VirtualGL-debuginfo-2.3.1-2.fc17.i686.rpm
...
Running check : CheckFileRequires [pass]
Exception down the road...
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 128, in run
self.__do_report()
File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 77, in __do_report
self.__run_checks(self.bug.spec_file, self.bug.srpm_file)
File "/usr/lib/python2.7/site-packages/FedoraReview/review_helper.py", line 103, in __run_checks
writedown=not Settings.no_report)
File "/usr/lib/python2.7/site-packages/FedoraReview/checks_class.py", line 185, in run_checks
test.run()
File "/usr/lib/python2.7/site-packages/FedoraReview/checks/generic.py", line 847, in run
filename = os.path.join(Mock.resultdir, 'build.log')
File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 82, in get_resultdir
return self._get_dir('result')
File "/usr/lib/python2.7/site-packages/FedoraReview/mock.py", line 70, in _get_dir
os.makedirs(p)
File "/usr/lib/python2.7/os.py", line 150, in makedirs
makedirs(head, mode)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/var/lib/mock/fedora-17-i386'
}}}

So it still seems to be wanting to access the mock dir.

Same thing here: the state of master is more or less undefined. Could you please recheck on branch release-0.2.0 and/or devel?

Looks good. Sorry for the noise.

Login to comment on this ticket.

Metadata