File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22
33set -eu
44
5+ . ./lib.sh
6+
7+ PROGNAME=$( basename " $0 " )
58ARCH=$( uname -m)
69IMAGES=" base enlightenment xfce mate cinnamon gnome kde lxde lxqt"
710REPO=
811DATE=$( date +%Y%m%d)
912
1013help () {
11- echo " ${0 #/* } : [-a arch] [-b base|enlightenment|xfce|mate|cinnamon|gnome|kde|lxde|lxqt] [-r repo]" >&2
14+ echo " $PROGNAME : [-a arch] [-b base|enlightenment|xfce|mate|cinnamon|gnome|kde|lxde|lxqt] [-r repo]" >&2
1215}
1316
14- while getopts " a:b:hr:" opt; do
17+ while getopts " a:b:hr:V " opt; do
1518case $opt in
1619 a) ARCH=" $OPTARG " ;;
1720 b) IMAGES=" $OPTARG " ;;
1821 h) help ; exit 0;;
1922 r) REPO=" -r $OPTARG $REPO " ;;
23+ V) version; exit 0;;
2024 * ) help ; exit 1;;
2125esac
2226done
@@ -90,7 +94,7 @@ if [ ! -x mklive.sh ]; then
9094fi
9195
9296if [ -x installer.sh ]; then
93- . ./ version.sh
97+ MKLIVE_VERSION= " $( PROGNAME= ' ' version) "
9498 installer=$( mktemp)
9599 sed " s/@@MKLIVE_VERSION@@/${MKLIVE_VERSION} /" installer.sh > " $installer "
96100 install -Dm755 " $installer " " $INCLUDEDIR " /usr/bin/void-installer
Original file line number Diff line number Diff line change @@ -33,6 +33,12 @@ is_target_native() {
3333 return $?
3434}
3535
36+ version () (
37+ set +u
38+ [ -n " $PROGNAME " ] && printf " %s " " $PROGNAME "
39+ echo " $( cat ./version) ${MKLIVE_REV:- " $( git -c safe.directory=" $( pwd) " rev-parse --short HEAD 2> /dev/null) " } "
40+ )
41+
3642info_msg () {
3743 # This function handles the printing that is bold within all
3844 # scripts. This is a convenience function so that the rather ugly
Original file line number Diff line number Diff line change 2525# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626# -
2727
28- . ./version.sh
29-
3028readonly PROGNAME=$( basename " $0 " )
3129readonly ARCH=$( uname -m)
3230
@@ -96,8 +94,8 @@ while getopts "b:B:o:r:s:x:h:V" opt; do
9694 r) ROOT_FSTYPE=" $OPTARG " ;;
9795 s) IMGSIZE=" $OPTARG " ;;
9896 x) COMPRESSOR_THREADS=" $OPTARG " ;;
99- V) echo " $PROGNAME $MKLIVE_VERSION " ; exit 0;;
100- h ) usage;;
97+ V) version ; exit 0;;
98+ * ) usage;;
10199 esac
102100done
103101shift $(( OPTIND - 1 ))
Original file line number Diff line number Diff line change 2929trap ' error_out $? $LINENO' INT TERM 0
3030umask 022
3131
32- . ./version .sh
32+ . ./lib .sh
3333
3434readonly REQUIRED_PKGS=" base-files libgcc dash coreutils sed tar gawk syslinux grub-i386-efi grub-x86_64-efi squashfs-tools xorriso"
3535readonly INITRAMFS_PKGS=" binutils xz device-mapper dhclient dracut-network openresolv"
@@ -312,9 +312,8 @@ while getopts "a:b:r:c:C:T:Kk:l:i:I:S:s:o:p:v:Vh" opt; do
312312 C) BOOT_CMDLINE=" $OPTARG " ;;
313313 T) BOOT_TITLE=" $OPTARG " ;;
314314 v) LINUX_VERSION=" $OPTARG " ;;
315- V) echo " $PROGNAME $MKLIVE_VERSION " ; exit 0 ;;
316- h) usage;;
317- * ) usage;;
315+ V) version; exit 0;;
316+ * ) usage;;
318317 esac
319318done
320319shift $(( OPTIND - 1 ))
Original file line number Diff line number Diff line change 2727# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828# -
2929
30- . ./version.sh
31-
3230readonly PROGNAME=$( basename " $0 " )
3331readonly REQTOOLS=" xbps-install tar"
3432
@@ -91,8 +89,8 @@ while getopts "r:c:C:T:K:i:o:k:l:Vh" opt; do
9189 C) BOOT_CMDLINE=" $OPTARG " ;;
9290 T) BOOT_TITLE=" $OPTARG " ;;
9391 S) SPLASH_IMAGE=" OPTARG" ;;
94- V) echo " $PROGNAME $MKLIVE_VERSION " ; exit 0 ;;
95- h ) usage;;
92+ V) version ; exit 0;;
93+ * ) usage;;
9694 esac
9795done
9896shift $(( OPTIND - 1 ))
Original file line number Diff line number Diff line change 2424# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525# -
2626
27- . ./version.sh
28-
2927readonly PROGNAME=$( basename " $0 " )
3028readonly ARCH=$( uname -m)
3129readonly REQTOOLS=" xbps-install xbps-reconfigure tar xz"
@@ -88,8 +86,8 @@ while getopts "b:p:k:c:C:r:x:o:nhV" opt; do
8886 x) COMPRESSOR_THREADS=" $OPTARG " ;;
8987 o) FILENAME=" $OPTARG " ;;
9088 n) COMPRESSION=" n" ;;
91- h) usage ; exit 0 ;;
92- V) echo " $PROGNAME $MKLIVE_VERSION " ; exit 0 ;;
89+ V) version ; exit 0;;
90+ * ) usage ; exit 0 ;;
9391 esac
9492done
9593shift $(( OPTIND - 1 ))
Original file line number Diff line number Diff line change 2525# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2626# -
2727
28- . ./version.sh
29-
3028readonly PROGNAME=$( basename " $0 " )
3129readonly ARCH=$( uname -m)
3230readonly REQTOOLS=" xbps-install xbps-reconfigure tar xz"
@@ -85,11 +83,11 @@ while getopts "b:C:c:hr:x:o:V" opt; do
8583 b) SYSPKG=" $OPTARG " ;;
8684 C) XBPS_CONFFILE=" -C $OPTARG " ;;
8785 c) XBPS_CACHEDIR=" --cachedir=$OPTARG " ;;
88- h) usage; exit 0;;
8986 r) XBPS_REPOSITORY=" $XBPS_REPOSITORY --repository=$OPTARG " ;;
9087 x) COMPRESSOR_THREADS=" $OPTARG " ;;
9188 o) FILENAME=" $OPTARG " ;;
92- V) echo " $PROGNAME $MKLIVE_VERSION " ; exit 0;;
89+ V) version; exit 0;;
90+ * ) usage; exit 0;;
9391 esac
9492done
9593shift $(( OPTIND - 1 ))
Original file line number Diff line number Diff line change 1+ 0.23
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments