コード例 #1
0
ファイル: scripts.py プロジェクト: LeoIannacone/npm2deb
def create(args):
    npm2deb = get_npm2deb_instance(args)
    try:
        saved_path = _os.getcwd()
        _utils.create_dir(npm2deb.name)
        _utils.change_dir(npm2deb.name)
        npm2deb.start()
        _utils.change_dir(npm2deb.debian_name)
        npm2deb.initiate_build(saved_path)

    except OSError as os_error:
        print(str(os_error))
        exit(1)

    _show_mapper_warnings()
コード例 #2
0
def create(args):
    npm2deb = get_npm2deb_instance(args)
    try:
        saved_path = _os.getcwd()
        _utils.create_dir(npm2deb.name)
        _utils.change_dir(npm2deb.name)
        npm2deb.start()
        _utils.change_dir(npm2deb.debian_name)
        npm2deb.initiate_build(saved_path)

    except OSError as os_error:
        print(str(os_error))
        exit(1)

    _show_mapper_warnings()
コード例 #3
0
    def initiate_build(self, saved_path):
        """
        Try building deb package after creating required files using start().
        'uscan', 'uupdate' and 'dpkg-buildpackage' are run if debian/watch is OK.
        """
        uscan_info = self.test_uscan()
        if uscan_info[0] == 0:
            self.run_uscan()
            self.run_uupdate()

            new_dir = '%s-%s' % (self.debian_name, self.upstream_version)
            utils.change_dir('../%s' % new_dir)
            # copy over non-duplicated changelog
            _os.rename('../%s/debian/changelog' % self.debian_name,
                       'debian/changelog')
            _rmtree('../%s' % self.debian_name)
            self.run_buildpackage()
            self.edit_changelog()
            self.create_git_repository()

            debian_path = "%s/%s/debian" % (self.name, new_dir)
            print('\nRemember, your new source directory is %s/%s' %
                  (self.name, new_dir))

        else:
            debian_path = "%s/%s/debian" % (self.name, self.debian_name)

        print("""
This is not a crystal ball, so please take a look at auto-generated files.\n
You may want fix first these issues:\n""")

        utils.change_dir(saved_path)
        _call('/bin/grep --color=auto FIX_ME -r %s/*' % debian_path,
              shell=True)
        _call('/bin/grep --color=auto FIX_ME -r -H %s/*_itp.mail' % self.name,
              shell=True)

        if uscan_info[0] != 0:
            print(
                "\nUse uscan to get orig source files. Fix debian/watch and then run\
                    \n$ uscan --download-current-version\n")

        if self.upstream_watch:
            print("""
*** Warning ***\nUsing npmregistry to download npm dist tarballs, because upstream
git repo is missing tags. Its better to ask upstream to tag their releases
instead of using npm dist tarballs as dist tarballs may contain pre built files
and may not include tests.\n""")
コード例 #4
0
ファイル: __init__.py プロジェクト: kapouer/npm2deb
 def start(self):
     self.download()
     utils.change_dir(self.debian_name)
     self.create_base_debian()
     self.create_rules()
     self.create_changelog()
     self.create_copyright()
     self.create_control()
     self.create_docs()
     self.create_install()
     self.create_links()
     self.create_dirs()
     self.create_examples()
     self.create_watch()
     if not self.noclean:
         self.clean()
     utils.change_dir('..')
     self.create_itp_bug()
コード例 #5
0
ファイル: __init__.py プロジェクト: kapouer/npm2deb
 def start(self):
     self.download()
     utils.change_dir(self.debian_name)
     self.create_base_debian()
     self.create_rules()
     self.create_changelog()
     self.create_copyright()
     self.create_control()
     self.create_docs()
     self.create_install()
     self.create_links()
     self.create_dirs()
     self.create_examples()
     self.create_watch()
     if not self.noclean:
         self.clean()
     utils.change_dir("..")
     self.create_itp_bug()
コード例 #6
0
ファイル: __init__.py プロジェクト: LeoIannacone/npm2deb
    def initiate_build(self, saved_path):
        """
        Try building deb package after creating required files using start().
        'uscan', 'uupdate' and 'dpkg-buildpackage' are run if debian/watch is OK.
        """
        uscan_info = self.test_uscan()
        if uscan_info[0] == 0:
            self.run_uscan()
            self.run_uupdate()

            new_dir = '%s-%s' % (self.debian_name, self.upstream_version)
            utils.change_dir('../%s' % new_dir)
            self.run_buildpackage()
            self.edit_changelog()

            debian_path = "%s/%s/debian" % (self.name, new_dir)
            print('\nRemember, your new source directory is %s/%s' %
                  (self.name, new_dir))

        else:
            debian_path = "%s/%s/debian" % (self.name, self.debian_name)

        print("""
This is not a crystal ball, so please take a look at auto-generated files.\n
You may want fix first these issues:\n""")

        utils.change_dir(saved_path)
        _call(
            '/bin/grep --color=auto FIX_ME -r %s/*' % debian_path, shell=True)
        _call(
            '/bin/grep --color=auto FIX_ME -r -H %s/*_itp.mail' % self.name,
            shell=True)

        if uscan_info[0] != 0:
            print(
                "\nUse uscan to get orig source files. Fix debian/watch and then run\
                    \n$ uscan --download-current-version\n")

        if self.upstream_watch:
            print("""
*** Warning ***\nUsing npmregistry to download npm dist tarballs, because upstream
git repo is missing tags. Its better to ask upstream to tag their releases
instead of using npm dist tarballs as dist tarballs may contain pre built files
and may not include tests.\n""")
コード例 #7
0
ファイル: __init__.py プロジェクト: shanavas786/npm2deb
 def start(self):
     self.download()
     utils.change_dir(self.debian_name)
     self.create_base_debian()
     self.create_tests()
     self.create_rules()
     self.create_changelog()
     self.create_copyright()
     self.create_control()
     self.create_docs()
     self.create_links()
     self.create_dirs()
     self.create_examples()
     self.create_watch()
     self.create_upstream_metadata()
     self.create_gbp_conf()
     self.create_manpages()
     if not self.noclean:
         self.clean()
     utils.change_dir('..')
     self.create_itp_bug()
コード例 #8
0
ファイル: scripts.py プロジェクト: kapouer/npm2deb
def create(args):
    npm2deb = get_npm2deb_instance(args)
    try:
        saved_path = os.getcwd()
        utils.create_dir(npm2deb.name)
        utils.change_dir(npm2deb.name)
        npm2deb.start()
        utils.change_dir(saved_path)
    except OSError as os_error:
        print(str(os_error))
        exit(1)

    debian_path = "%s/%s/debian" % (npm2deb.name, npm2deb.debian_name)

    print("""
This is not a crystal ball, so please take a look at auto-generated files.\n
You may want fix first these issues:\n""")
    call('/bin/grep --color=auto FIX_ME -r %s/*' % debian_path, shell=True)
    print("\nUse uscan to get orig source files. Fix debian/watch and then run\
            \n$ uscan --download-current-version\n")

    _show_mapper_warnings()
コード例 #9
0
ファイル: scripts.py プロジェクト: kapouer/npm2deb
def create(args):
    npm2deb = get_npm2deb_instance(args)
    try:
        saved_path = os.getcwd()
        utils.create_dir(npm2deb.name)
        utils.change_dir(npm2deb.name)
        npm2deb.start()
        utils.change_dir(saved_path)
    except OSError as os_error:
        print(str(os_error))
        exit(1)

    debian_path = "%s/%s/debian" % (npm2deb.name, npm2deb.debian_name)

    print("""
This is not a crystal ball, so please take a look at auto-generated files.\n
You may want fix first these issues:\n""")
    call('/bin/grep --color=auto FIX_ME -r %s/*' % debian_path, shell=True)
    print ("\nUse uscan to get orig source files. Fix debian/watch and then run\
            \n$ uscan --download-current-version\n")

    _show_mapper_warnings()
コード例 #10
0
ファイル: __init__.py プロジェクト: LeoIannacone/npm2deb
 def start(self):
     self.download()
     utils.change_dir(self.debian_name)
     self.create_base_debian()
     self.create_tests()
     self.create_rules()
     self.create_changelog()
     self.create_copyright()
     self.create_control()
     self.create_docs()
     self.create_install()
     self.create_links()
     self.create_dirs()
     self.create_examples()
     self.create_watch()
     self.create_upstream_metadata()
     self.create_gbp_conf()
     self.create_manpages()
     if not self.noclean:
         self.clean()
     utils.change_dir('..')
     self.create_itp_bug()