diff --git a/conf/slpkg.conf b/conf/slpkg.conf index 14285f80..6649b81e 100644 --- a/conf/slpkg.conf +++ b/conf/slpkg.conf @@ -29,7 +29,11 @@ RELEASE=stable # Build directory for repository "sbo" slackbuilds.org. In this # directory downloaded sources and scripts for building. BUILD_PATH=/tmp/slpkg/build/ -# + +# Alternative source downloads for the "sbo" repository. Default is "off". +SBOSRCARCH=off +SBOSRCARCH_LINK=http://slackware.uk/sbosrcarch/by-name/ + # Download directory for others repositories that use binaries files # for installation. PACKAGES=/tmp/slpkg/packages/ @@ -38,7 +42,7 @@ PACKAGES=/tmp/slpkg/packages/ PATCHES=/tmp/slpkg/patches/ # If CHECKMD5 is "on" the system will check all downloaded -# sources and Slackware packages. Default in "on". +# sources and Slackware packages. Default is "on". CHECKMD5=on # Delete all downloaded files if DEL_ALL is "on". Default is "on". @@ -116,6 +120,5 @@ EDITOR=nano # If you don't want slpkg downgrade packages, setting this variable to "on". # Warning: Possible failure building packages or running applications after -# install. -# Default is "off". +# install. Default is "off". NOT_DOWNGRADE=off diff --git a/slpkg/__metadata__.py b/slpkg/__metadata__.py index 0239e156..0db5cc14 100644 --- a/slpkg/__metadata__.py +++ b/slpkg/__metadata__.py @@ -103,6 +103,8 @@ class MetaData(object): "salix", "slackl", "rested", "msb{1.16}", "csb", "connos", "mles{desktop}"], "BUILD_PATH": "/tmp/slpkg/build/", + "SBOSRCARCH": "off", + "SBOSRCARCH_LINK": "http://slackware.uk/sbosrcarch/by-name/", "PACKAGES": "/tmp/slpkg/packages/", "PATCHES": "/tmp/slpkg/patches/", "CHECKMD5": "on", @@ -147,6 +149,8 @@ class MetaData(object): # Set values from configuration file slack_rel = _conf_slpkg["RELEASE"] build_path = _conf_slpkg["BUILD_PATH"] + sbosrcarch = _conf_slpkg["SBOSRCARCH"] + sbosrcarch_link = _conf_slpkg["SBOSRCARCH_LINK"] slpkg_tmp_packages = _conf_slpkg["PACKAGES"] slpkg_tmp_patches = _conf_slpkg["PATCHES"] checkmd5 = _conf_slpkg["CHECKMD5"] diff --git a/slpkg/sbo/slackbuild.py b/slpkg/sbo/slackbuild.py index da220b82..60dc76b6 100644 --- a/slpkg/sbo/slackbuild.py +++ b/slpkg/sbo/slackbuild.py @@ -337,6 +337,8 @@ class SBoInstall(object): sbo_url = sbo_search_pkg(pkg) sbo_link = SBoLink(sbo_url).tar_gz() script = sbo_link.split("/")[-1] + if self.meta.sbosrcarch in ["on", "ON"]: + src_link = self.sbosrcarsh(prgnam, sbo_link, src_link) Download(self.build_folder, sbo_link.split(), repo="sbo").start() Download(self._SOURCES, src_link, repo="sbo").start() @@ -378,3 +380,14 @@ class SBoInstall(object): "setting by user".format(name)) self.msg.template(78) return True + + def sbosrcarsh(self, prgnam, sbo_link, src_link): + """Alternative repository for sbo sources""" + sources = [] + name = "-".join(prgnam.split("-")[:-1]) + category = "{0}/{1}/".format(sbo_link.split("/")[-2], name) + for link in src_link: + source = link.split("/")[-1] + sources.append("{0}{1}{2}".format(self.meta.sbosrcarch_link, + category, source)) + return sources