Makefile.usr: target dports-download has incorrect dependency
dports-download is supposed to be able to download a tarball of dports (in the event that git isn't available), but it has a dependency on dports-check, which has a dependency on git-check, which fails if git isn't installed.
#1 Updated by daftaupe about 2 months ago
- File patch-Makefile.usr added
Would something like this patch work for you ?
First this check for dports directory existence in dports-check, not dports/.git, which for the same reason you mention shouldn't exist. Then I removed the dependency to git-check.
Then I changed the dependency of dports-create-shallow to a new target : dports-check-shallow, that has git-check has a dependency.
I wasn't sure about the name of the new target. Let me know what do you think of that.
#5 Updated by ftigeot about 2 months ago
The latest patch is indeed an improvement for the dports-download target.
Unfortunately, it also removes the dports-create target git check.
dports-create depends on git being present.
IMHO, it would be better to add a dports-download check than to modify the existing dports-check one.
#6 Updated by daftaupe about 2 months ago
- File 0001-Add-dports-download-check-target.patch View added
- File 0002-Add-test-to-dports-download-check-target.patch View added
thanks for taking the time to review my patch.
Here is a new one that adds a dports-download check target as you suggested.
I added a second one that adds a test for /usr/DragonflyBSD-DPorts-* dirs, as I noticed that if you break dports-download during the extraction of the .tar.gz archive, you end up with a temporary dir like this, and it makes the mv command failed next time it's run. As such :
rm -f /tmp/dports.tar.gz
fetch -o /tmp/dports.tar.gz https://api.github.com/repos/DragonFlyBSD/DPorts/tarball/
fetch: https://api.github.com/repos/DragonFlyBSD/DPorts/tarball/: size of remote file is not known
/tmp/dports.tar.gz 42 MB 3535 kBps 00m13s
tar -xf /tmp/dports.tar.gz -C /usr
mv /usr/DragonFlyBSD-DPorts-* /usr/dports
usage: mv [-f | -i | -n] [-hv] source target
mv [-f | -i | -n] [-v] source ... directory