if not package.name in args.packages:
continue
- package.source_donwload()
+ package.source_download()
def call_source_upload(self, args):
pass # TODO
logging.info(" %s" % self.package.summary)
logging.info("")
+ # Download the source tarballs
+ self.package.source_download()
+
# Resolve the dependencies
try:
self.dependency_set.resolve()
REPOSDIR = os.path.join(BUILDDIR, "repositories")
TOOLSDIR = os.path.join(BASEDIR, "tools")
-TARBALLDIR = os.path.join(CACHEDIR, "tarballs")
-TOOLCHAINSDIR = os.path.join(CACHEDIR, "toolchains")
-PATCHESDIR = os.path.join(CACHEDIR, "patches")
-
ARCHES_DEFAULT = os.path.join(CONFIGDIR, "architectures.conf")
CONFIGFILE = os.path.join(CONFIGDIR, "naoki.conf")
import os
import re
+import urlgrabber
+import urlgrabber.progress
+
import architectures
import dependencies
import environ
from constants import *
+
class Package(object):
def __repr__(self):
return "<%s %s:%s>" % \
return True
+ @property
+ def source_files(self):
+ return self._info.get("PKG_OBJECTS").split()
+
+ def source_download(self):
+ g = urlgrabber.grabber.URLGrabber(
+ prefix = config["sources_download_url"],
+ progress_obj = urlgrabber.progress.TextMeter(),
+ quote=0,
+ )
+
+ for file in self.source_files:
+ file = os.path.join(CACHEDIR, file)
+
+ if os.path.exists(file):
+ continue
+
+ util.mkdir(CACHEDIR)
+
+ g.urlgrab(os.path.basename(file), filename=file)
+
class BinaryPackage(Package):
def __init__(self, filename):
THISAPP = $(PKG_NAME)-$(PKG_VER)
DIR_APP = $(DIR_SRC)/$(THISAPP)
-DIR_DL = $(BASEDIR)/cache/tarballs
+DIR_DL = $(BASEDIR)/cache
DIR_PATCHES = $(DIR_SOURCE)/patches
DIR_SRC = $(ROOT)/usr/src
DIR_TMP = /tmp