[Slackbuilds-users] What if we `source`d the version number

slackbuilds at ninefamily.com slackbuilds at ninefamily.com
Thu Jan 13 03:03:11 UTC 2022


I was going to say do something like Pat does with Firefox but that 
looks like it

cd $(dirname $0) ; CWD=$(pwd)

PKGNAM=mozilla-firefox
VERSION=$(basename $(ls firefox-*.tar.?z | cut -d - -f 2 | rev | cut -f 3- -d . | rev) .source)
RELEASEVER=$(echo $VERSION | cut -f 1 -d r | cut -f 1 -d b | cut -f 1 -d e)
BUILD=${BUILD:-1}

https://ftp.ussg.indiana.edu/linux/slackware/slackware64-current/source/xap/mozilla-firefox/mozilla-firefox.SlackBuild

On 1/10/22 17:17, Konrad J Hambrick wrote:
> Klaatu --
>
> That's pretty much what I do ( source $PROGRAM.info ) in my 
> do-SlackBuild.$PRGNAM scripts.
>
> But I do that in a wrapper-script that invokes the standard SlackBuild.
>
> The Code below is auto-generated by a get-SB-pkg script ( example:  
> get-SB-pkg intel-microcode )
>
> As you can see, the $PRGNAM.info File is sourced by the wrapper script 
> but I can still override the VERSION as expected:
>
>    VERSION=1.2.3.4 ./do-SlackBuild.intel-microcode
>
> One can also set TAG= to append a TAG ( like say, TAG=_kjh )
>
> As a bonus, the do-wrapper logs all the output to 
> $PRGNAM-SlackBuild-$VERSION$TAG.log
>
> Anyhow ... my $0.02 ... no need to change the SlackBuilds ( PLEASE 
> don't change the SlackBuilds :)
>
> -- kjh
>
>     #!/bin/sh
>
>     DoName="intel-microcode.SlackBuild"
>
>     MyVersion="$VERSION"
>
>     . ./intel-microcode.info <http://intel-microcode.info>
>
>     [ "$MyVersion" = "" ] && MyVersion="$VERSION"
>
>     LogNam="$DoName-$MyVersion$TAG.log"
>
>     unset PRGNAM
>     unset VERSION
>     unset HOMEPAGE
>     unset DOWNLOAD
>     unset MD5SUM
>     unset DOWNLOAD_x86_64
>     unset MD5SUM_x86_64
>     unset REQUIRES
>     unset MAINTAINER
>     unset EMAIL
>     #
>     # set and export any extra variables here
>     #
>     export TAG
>     export VERSION="$MyVersion"
>
>     # do the deed
>     #
>     echo "$DoName startup  at `date`"  |tee    $LogNam
>     ./$DoName 2>&1                     |tee -a $LogNam
>     #
>     RetCode=${PIPESTATUS[0]}
>     #
>     [ "$RetCode" = "0" ] && RetStr="complete" || RetStr="FAILED  "
>     #
>     # optional pre-installation instructions  here
>     #
>     #
>     # optional pre-installation instructions there
>     #
>     # log your results
>     #
>     echo "$DoName $RetStr at `date` ... RetCode = $RetCode" |tee -a
>     $LogNam
>     exit $RetCode
>
>
> On Tue, Jan 4, 2022 at 3:11 PM Klaatu <klaatu at mixedsignals.ml> wrote:
>
>     Why do we define the VERSION for a package in two separate files?
>
>     What if we replaced this line in foo.SlackBuild:
>
>     VERSION={VERSION:-0.0.1}
>
>     with this instead:
>
>     . ./$PRGNAM.info
>
>     The VERSION variable would get imported from a consolidated
>     location (the .info file).
>
>     It seems to make more sense to me, and it makes trivial upgrades
>     (the ones where I go in and just bump a version number to
>     something I want to build) a one-file task.
>
>     Thoughts?
>
>     _______________________________________________
>     SlackBuilds-users mailing list
>     SlackBuilds-users at slackbuilds.org
>     https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
>     Archives - https://lists.slackbuilds.org/pipermail/slackbuilds-users/
>     FAQ - https://slackbuilds.org/faq/
>
>
> _______________________________________________
> SlackBuilds-users mailing list
> SlackBuilds-users at slackbuilds.org
> https://lists.slackbuilds.org/mailman/listinfo/slackbuilds-users
> Archives -https://lists.slackbuilds.org/pipermail/slackbuilds-users/
> FAQ -https://slackbuilds.org/faq/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.slackbuilds.org/pipermail/slackbuilds-users/attachments/20220112/fb941f9c/attachment-0001.htm>


More information about the SlackBuilds-users mailing list