Lines 1592-1597
Link Here
|
1592 |
if listonly or ("distlocks" not in features): |
1592 |
if listonly or ("distlocks" not in features): |
1593 |
use_locks = 0 |
1593 |
use_locks = 0 |
1594 |
|
1594 |
|
|
|
1595 |
fetch_to_ro = 0 |
1596 |
if "skiprocheck" in features: |
1597 |
fetch_to_ro = 1 |
1598 |
|
1599 |
if not os.access(mysettings["DISTDIR"],os.W_OK) and fetch_to_ro: |
1600 |
if use_locks: |
1601 |
writemsg(red("!!! You are fetching to a read-only filesystem, you should turn locking off")); |
1602 |
writemsg("!!! This can be done by adding -distlocks to FEATURES in /etc/make.conf"); |
1603 |
# use_locks = 0 |
1604 |
|
1595 |
# local mirrors are always added |
1605 |
# local mirrors are always added |
1596 |
if custommirrors.has_key("local"): |
1606 |
if custommirrors.has_key("local"): |
1597 |
mymirrors += custommirrors["local"] |
1607 |
mymirrors += custommirrors["local"] |
Lines 1721-1728
Link Here
|
1721 |
|
1731 |
|
1722 |
can_fetch=True |
1732 |
can_fetch=True |
1723 |
if not os.access(mysettings["DISTDIR"]+"/",os.W_OK): |
1733 |
if not os.access(mysettings["DISTDIR"]+"/",os.W_OK): |
1724 |
print "!!! No write access to %s" % mysettings["DISTDIR"]+"/" |
1734 |
if not fetch_to_ro: |
1725 |
can_fetch=False |
1735 |
print "!!! No write access to %s" % mysettings["DISTDIR"]+"/" |
|
|
1736 |
can_fetch=False |
1726 |
else: |
1737 |
else: |
1727 |
mystat=os.stat(mysettings["DISTDIR"]+"/") |
1738 |
mystat=os.stat(mysettings["DISTDIR"]+"/") |
1728 |
if mystat.st_gid != portage_gid: |
1739 |
if mystat.st_gid != portage_gid: |
Lines 1834-1840
Link Here
|
1834 |
|
1845 |
|
1835 |
# check if we can actually write to the directory/existing file. |
1846 |
# check if we can actually write to the directory/existing file. |
1836 |
if fetched!=2 and os.path.exists(mysettings["DISTDIR"]+"/"+myfile) != \ |
1847 |
if fetched!=2 and os.path.exists(mysettings["DISTDIR"]+"/"+myfile) != \ |
1837 |
os.access(mysettings["DISTDIR"]+"/"+myfile, os.W_OK): |
1848 |
os.access(mysettings["DISTDIR"]+"/"+myfile, os.W_OK) and not fetch_to_ro: |
1838 |
writemsg(red("***")+" Lack write access to %s, failing fetch\n" % str(mysettings["DISTDIR"]+"/"+myfile)) |
1849 |
writemsg(red("***")+" Lack write access to %s, failing fetch\n" % str(mysettings["DISTDIR"]+"/"+myfile)) |
1839 |
fetched=0 |
1850 |
fetched=0 |
1840 |
break |
1851 |
break |
Lines 1862-1868
Link Here
|
1862 |
myret=spawn(myfetch,mysettings,free=1) |
1873 |
myret=spawn(myfetch,mysettings,free=1) |
1863 |
finally: |
1874 |
finally: |
1864 |
#if root, -always- set the perms. |
1875 |
#if root, -always- set the perms. |
1865 |
if os.path.exists(mysettings["DISTDIR"]+"/"+myfile) and (fetched != 1 or os.getuid() == 0): |
1876 |
if os.path.exists(mysettings["DISTDIR"]+"/"+myfile) and (fetched != 1 or os.getuid() == 0) \ |
|
|
1877 |
and os.access(mysettings["DISTDIR"]+"/",os.W_OK): |
1866 |
if os.stat(mysettings["DISTDIR"]+"/"+myfile).st_gid != portage_gid: |
1878 |
if os.stat(mysettings["DISTDIR"]+"/"+myfile).st_gid != portage_gid: |
1867 |
try: |
1879 |
try: |
1868 |
os.chown(mysettings["DISTDIR"]+"/"+myfile,-1,portage_gid) |
1880 |
os.chown(mysettings["DISTDIR"]+"/"+myfile,-1,portage_gid) |