Set export variable TAG #126

Signed-off-by: Dimitris Zlatanidis <d.zlatanidis@gmail.com>
This commit is contained in:
Dimitris Zlatanidis 2020-03-05 16:49:52 +01:00
parent 5f4251c321
commit 661e5bf418
2 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,7 @@
3.8.5 - 5/03/2020
Added:
- set export variable $TAG #126
3.8.4 - 25/02/2020
BugFix:
- Grab MD5SUM from wrong info file return None

View file

@ -22,6 +22,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import os
from pkg_resources import parse_version
from slpkg.messages import Msg
@ -34,16 +35,26 @@ def slack_package(prgnam):
"""Return maximum binary Slackware package from output directory
"""
msg = Msg()
TAG, binaries, cache, binary = "_SBo", [], "0", ""
for tags in os.environ.keys():
if tags == "TAG":
TAG = os.environ['TAG']
break
binaries, cache, binary = [], "0", ""
for pkg in find_package(prgnam, _meta_.output):
if pkg.startswith(prgnam) and pkg[:-4].endswith("_SBo"):
if pkg.startswith(prgnam) and pkg[:-4].endswith(TAG):
binaries.append(pkg)
for bins in binaries:
binary = bins
if parse_version(bins) > parse_version(cache):
binary = bins
cache = binary
if not binary:
msg.build_FAILED(prgnam)
raise SystemExit(1)
return ["".join(_meta_.output + binary)]