pkgsrc/devel/py-setuptools/files/manage-eggs.py
joerg bc0554ccaa Reimport devel/py24-setuptools as devel/py-setuptools. This is in
principle usable on Python 2.3 as well, but not tested yet.
2006-11-14 13:33:29 +00:00

20 lines
532 B
Python

#!@PYTHON@
import sys
from setuptools.command.easy_install import PthDistributions
from pkg_resources import find_distributions
usage = "@PYPREFIX@-manage-eggs [ register | unregister ] egg\n"
if len(sys.argv) != 3 or sys.argv[1] not in ("register", "unregister"):
sys.stderr.write(usage)
sys.exit(1)
pth = PthDistributions("@PYSITELIB@/easy-install.pth")
distrib = find_distributions(sys.argv[2], True).next()
if sys.argv[1] == "register":
pth.add(distrib)
elif sys.argv[1] == "unregister":
pth.remove(distrib)
pth.save()