def main():
    parser = OptionParser(usage=
                          'usage: %prog [options] <package_name> <mpkg_root>')
    parser.add_option("--component-directory",
                      action = 'store',
                      default = COMPONENT_DIRECTORY,
                      dest="comp_dir",
                      help="Subdirectory containing package directories; "
                      "defaults to " + COMPONENT_DIRECTORY)
    options, args = parser.parse_args()
    if len(args) != 2:
        parser.print_help()
        sys.exit(1)
    pkg_name, wd = args
    wd = abspath(wd)
    package_names = glob(pjoin(wd, COMPONENT_DIRECTORY, '*.pkg'))
    package_names = [psplit(pn)[1] for pn in package_names]
    n_pkgs = len(package_names)
    extra_plist = dict(
            IFRequirementDicts=[python_requirement(pkg_name)],
            IFPkgFlagComponentDirectory=tools.unicode_path(
                './' + COMPONENT_DIRECTORY))
    plist = mpkg_info(pkg_name, '1.7',
                      zip(package_names, ('selected',) * n_pkgs))
    plist.update(extra_plist)
    write(plist, pjoin(wd, 'Contents', 'Info.plist'))
示例#2
0
 def get_metapackage_info(self):
     return dict(
         IFRequirementDicts=[plists.python_requirement(self.get_name())],
         IFPkgFlagComponentDirectory=tools.unicode_path(
             self.component_directory
         ),
     )
示例#3
0
def main():
    try:
        wd = sys.argv[1]
    except IndexError:
        wd = os.getcwd()
    wd = abspath(wd)
    package_names = glob(pjoin(wd, COMPONENT_DIRECTORY, '*.pkg'))
    package_names = [psplit(pn)[1] for pn in package_names]
    n_pkgs = len(package_names)
    extra_plist = dict(
            IFRequirementDicts=[python_requirement(PKG_NAME)],
            IFPkgFlagComponentDirectory=tools.unicode_path(
                './' + COMPONENT_DIRECTORY))
    plist = mpkg_info(PKG_NAME, '1.7',
                      zip(package_names, ('selected',) * n_pkgs))
    plist.update(extra_plist)
    write(plist, pjoin(wd, 'Contents', 'Info.plist'))