示例#1
0
    def download_package_source( self, package_name, filenames_lst = None ):
        logme( 'ArchlinuxDistro - download_package_source() - starting' )
#        self.update_status(( [ "Downloading %s package into %s OS" % ( package_name, self.name ) ] )
        system_or_die( 'mkdir -p %s/%s/%s' % ( self.mountpoint, self.sources_basedir, package_name ) )
        os.chdir( '%s/%s/%s' % ( self.mountpoint, self.sources_basedir, package_name ) )
        if os.path.isfile( '%s/%s/%s/PKGBUILD' % ( self.mountpoint, self.sources_basedir, package_name ) ):
            self.update_status( '' )  # += "."  # ..Still working"  # No need to download anything. We have PKGBUILD already.
        elif filenames_lst in ( None, [] ):
            url = 'aur.archlinux.org/packages/%s/%s/%s.tar.gz' % ( package_name[:2], package_name, package_name )
            wget( url = url, extract_to_path = '%s/%s' % ( self.mountpoint, self.sources_basedir ), quiet = True , title_str = self.title_str, status_lst = self.status_lst )
        else:
            for fname in filenames_lst:
                file_to_download = '%s/%s/%s/%s' % ( self.mountpoint, self.sources_basedir, package_name, fname )
                try:
                    os.unlink( file_to_download )
                except IOError:
                    pass
                wget( url = 'http://projects.archlinux.org/svntogit/packages.git/plain/trunk/%s?h=packages/%s' \
                                 % ( fname, package_name ), save_as_file = file_to_download, attempts = 20,
                                 quiet = True, title_str = self.title_str, status_lst = self.status_lst )
        system_or_die( 'mv PKGBUILD PKGBUILD.ori' )
        system_or_die( r"cat PKGBUILD.ori | sed s/march/phr34k/ | sed s/\'libutil-linux\'// | sed s/\'java-service-wrapper\'// | sed s/arch=\(.*/arch=\(\'%s\'\)/ | sed s/phr34k/march/ > PKGBUILD" % ( self.architecture ) )
        chroot_this( self.mountpoint, 'chown -R guest %s/%s' % ( self.sources_basedir, package_name ) )
        call_makepkg_or_die( mountpoint = self.mountpoint, \
                            package_path = '%s/%s' % ( self.sources_basedir, package_name ), \
                            cmd = 'cd %s/%s && makepkg --skipchecksums --nobuild -f' % ( self.sources_basedir, package_name ),
                            errtxt = 'Failed to download %s' % ( package_name ) )
        return 0
示例#2
0
 def download_package_source(self, package_name, filenames_lst=None):
     logme('ArchlinuxDistro - download_package_source() - starting')
     #        self.update_status(( [ "Downloading %s package into %s OS" % ( package_name, self.name ) ] )
     system_or_die('mkdir -p %s/%s/%s' %
                   (self.mountpoint, self.sources_basedir, package_name))
     os.chdir('%s/%s/%s' %
              (self.mountpoint, self.sources_basedir, package_name))
     if os.path.isfile(
             '%s/%s/%s/PKGBUILD' %
         (self.mountpoint, self.sources_basedir, package_name)):
         self.update_status(
             ''
         )  # += "."  # ..Still working"  # No need to download anything. We have PKGBUILD already.
     elif filenames_lst in (None, []):
         url = 'aur.archlinux.org/packages/%s/%s/%s.tar.gz' % (
             package_name[:2], package_name, package_name)
         wget(url=url,
              extract_to_path='%s/%s' %
              (self.mountpoint, self.sources_basedir),
              quiet=True,
              title_str=self.title_str,
              status_lst=self.status_lst)
     else:
         for fname in filenames_lst:
             file_to_download = '%s/%s/%s/%s' % (
                 self.mountpoint, self.sources_basedir, package_name, fname)
             try:
                 os.unlink(file_to_download)
             except IOError:
                 pass
             wget( url = 'http://projects.archlinux.org/svntogit/packages.git/plain/trunk/%s?h=packages/%s' \
                              % ( fname, package_name ), save_as_file = file_to_download, attempts = 20,
                              quiet = True, title_str = self.title_str, status_lst = self.status_lst )
     system_or_die('mv PKGBUILD PKGBUILD.ori')
     system_or_die(
         r"cat PKGBUILD.ori | sed s/march/phr34k/ | sed s/\'libutil-linux\'// | sed s/\'java-service-wrapper\'// | sed s/arch=\(.*/arch=\(\'%s\'\)/ | sed s/phr34k/march/ > PKGBUILD"
         % (self.architecture))
     chroot_this(
         self.mountpoint,
         'chown -R guest %s/%s' % (self.sources_basedir, package_name))
     call_makepkg_or_die( mountpoint = self.mountpoint, \
                         package_path = '%s/%s' % ( self.sources_basedir, package_name ), \
                         cmd = 'cd %s/%s && makepkg --skipchecksums --nobuild -f' % ( self.sources_basedir, package_name ),
                         errtxt = 'Failed to download %s' % ( package_name ) )
     return 0
示例#3
0
        (distro.mountpoint),
        '%s/usr/local/bin/Chrubix/blobs/settings/nmgr-cfg-diff.txt.gz' %
        (distro.mountpoint))
elif argv[2] == 'makepkg':
    print('Assuming archlinux')
    distro = generate_distro_record_from_name('archlinux')
    distro.mountpoint = MYDISK_MTPT
    distro.device = '/dev/mmcblk1'
    distro.root_dev = '/dev/mmcblk1p3'
    distro.spare_dev = '/dev/mmcblk1p2'
    pkg = argv[3]
    #    sys.exit( 0 )
    print("Building %s" % (pkg))
    if pkg == 'linux-chromebook':
        call_makepkg_or_die( mountpoint = '/', \
                                package_path = '%s/%s' % ( distro.sources_basedir, pkg ), \
                                cmd = 'cd %s && makepkg --skipchecksums --nobuild -f' % ( distro.mountpoint + distro.kernel_src_basedir ),
                                errtxt = 'Failed to handle %s' % ( pkg ) )
    else:
        call_makepkg_or_die( mountpoint = '/', \
                                package_path = '%s/%s' % ( distro.sources_basedir, pkg ), \
                                cmd = 'cd %s/%s && makepkg --skipchecksums --nobuild -f' % ( distro.sources_basedir, pkg ),
                                errtxt = 'Failed to download %s' % ( pkg ) )
elif argv[2] == 'alarpy-build':
    distro = generate_distro_record_from_name('debianwheezy')
    distro.mountpoint = MYDISK_MTPT
    distro.device = '/dev/mmcblk1'
    distro.root_dev = '/dev/mmcblk1p3'
    distro.spare_dev = '/dev/mmcblk1p2'
    distro.build_and_install_package_into_alarpy_from_source(argv[3],
                                                             quiet=True)
elif argv[2] == 'install-i2p':
示例#4
0
    distro.spare_dev = '/dev/mmcblk1p2'
    patch_org_freedesktop_networkmanager_conf_file( '%s/etc/dbus-1/system.d/org.freedesktop.NetworkManager.conf' % ( distro.mountpoint ),
                                                        '%s/usr/local/bin/Chrubix/blobs/settings/nmgr-cfg-diff.txt.gz' % ( distro.mountpoint ) )
elif argv[2] == 'makepkg':
    print( 'Assuming archlinux' )
    distro = generate_distro_record_from_name( 'archlinux' )
    distro.mountpoint = MYDISK_MTPT
    distro.device = '/dev/mmcblk1'
    distro.root_dev = '/dev/mmcblk1p3'
    distro.spare_dev = '/dev/mmcblk1p2'
    pkg = argv[3]
#    sys.exit( 0 )
    print( "Building %s" % ( pkg ) )
    if pkg == 'linux-chromebook':
        call_makepkg_or_die( mountpoint = '/', \
                                package_path = '%s/%s' % ( distro.sources_basedir, pkg ), \
                                cmd = 'cd %s && makepkg --skipchecksums --nobuild -f' % ( distro.mountpoint + distro.kernel_src_basedir ),
                                errtxt = 'Failed to handle %s' % ( pkg ) )
    else:
        call_makepkg_or_die( mountpoint = '/', \
                                package_path = '%s/%s' % ( distro.sources_basedir, pkg ), \
                                cmd = 'cd %s/%s && makepkg --skipchecksums --nobuild -f' % ( distro.sources_basedir, pkg ),
                                errtxt = 'Failed to download %s' % ( pkg ) )
elif argv[2] == 'alarpy-build':
    distro = generate_distro_record_from_name( 'debianwheezy' )
    distro.mountpoint = MYDISK_MTPT
    distro.device = '/dev/mmcblk1'
    distro.root_dev = '/dev/mmcblk1p3'
    distro.spare_dev = '/dev/mmcblk1p2'
    distro.build_and_install_package_into_alarpy_from_source( argv[3], quiet = True )
elif argv[2] == 'install-i2p':
    distro = generate_distro_record_from_name( argv[3] )