From f33f1f0ed91fb33e7681291f7f6b260447fcfb86 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sat, 30 Apr 2011 03:29:17 -0500 Subject: pkgbuild-check-nonfree can check if a nonfree has a -libre replacement --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index 8cce89d..988b6f2 100755 --- a/libremakepkg +++ b/libremakepkg @@ -27,7 +27,7 @@ fi msg "Checking PKGBUILD for non-free issues" pkgbuild-check-nonfree ||{ - if [[$?=15]]; then + if [[ $? -eq 15 ]]; then error "PKGBUILD contains non-free issues" exit 15 else -- cgit v1.2.3-2-g168b From 8fd5887191e11e0ee64272991a8c5fc6c7636524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sat, 30 Apr 2011 05:53:38 -0500 Subject: * libremakepkg optionaly uses a chroot different from $CHCOPY * libremakepkg cleaning and mkarchroot update is optional * librerepkg uses -cu flags for libremakepkg --- libremakepkg | 45 +++++++++++++++++++++++++++++++++++++-------- 1 file changed, 37 insertions(+), 8 deletions(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index 988b6f2..6b996dc 100755 --- a/libremakepkg +++ b/libremakepkg @@ -1,5 +1,6 @@ #!/bin/bash -# Copyright 2010 Nicolás Reynolds +# Copyright 2010 - 2011 Nicolás Reynolds +# Copyright 2011 Joshua Ismael Haase Hernández # ---------- GNU General Public License 3 ---------- @@ -25,26 +26,54 @@ if [ $UID -ne 0 ]; then exit 1 fi +usage() { + echo "cd to a dir containing a PKGBUILD and run:" + echo "$0 [options] [makepkg args]" + echo + echo "OPTIONS:" + echo + echo " -h : show this message" + echo " -c : cleans CHCOPY and cachedir" + echo " -u : updates before building" + echo " -n chrootname : use this dir instead of CHCOPY" +} + +CLEAN="" +update_first=0 +chrootname=${CHCOPY} + +while getopts 'hcun' arg; do + case "${arg}" in + h) usage ;; + c) CLEAN="-c" ;; + u) update_first=1 ;; + n) chrootname="$OPTARG" ;; + *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; + esac +done + msg "Checking PKGBUILD for non-free issues" pkgbuild-check-nonfree ||{ if [[ $? -eq 15 ]]; then error "PKGBUILD contains non-free issues" exit 15 else - error "Check failed, continuing" + exit $? fi } -[[ -z $1 ]] && { - CLEAN="-c" +mount -o bind ${CACHEDIR} \ + ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg || exit 1 +if [ $update_first -eq 1 ]; then msg "Updating the main chroot" - mkarchroot -c ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT} + mkarchroot $CLEAN ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT} +fi - mount -o bind ${CACHEDIR} ${CHROOTDIR}/${CHCOPY}/var/cache/pacman/pkg || exit 1 -} msg "Creating the package" -makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${CHCOPY} -- $@ +makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $MAKEPKG_ARGS + +umount ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg exit 0 -- cgit v1.2.3-2-g168b From d7e07174e2dae3d1bd9ec79c90cba9912f2cef0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 10 May 2011 17:00:22 -0500 Subject: * Clean cache option for libremakepkg --- libremakepkg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index 6b996dc..ef276f3 100755 --- a/libremakepkg +++ b/libremakepkg @@ -39,13 +39,15 @@ usage() { } CLEAN="" +CLEAN_CACHE="" update_first=0 chrootname=${CHCOPY} -while getopts 'hcun' arg; do +while getopts 'hcCun' arg; do case "${arg}" in h) usage ;; c) CLEAN="-c" ;; + C) CLEAN_CACHE="-C" u) update_first=1 ;; n) chrootname="$OPTARG" ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; @@ -62,17 +64,15 @@ pkgbuild-check-nonfree ||{ fi } -mount -o bind ${CACHEDIR} \ - ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg || exit 1 - if [ $update_first -eq 1 ]; then msg "Updating the main chroot" - mkarchroot $CLEAN ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT} + # -c option in mkarchroot indicates cache + mkarchroot -c ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT} fi msg "Creating the package" -makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $MAKEPKG_ARGS +makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $CLEAN_CACHE $MAKEPKG_ARGS umount ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg -- cgit v1.2.3-2-g168b From 79dfb33774ec1d789c6f1b306f607cf0eeea7a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 10 May 2011 17:52:19 -0500 Subject: fixed libremakepkg error --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index ef276f3..2e75288 100755 --- a/libremakepkg +++ b/libremakepkg @@ -47,7 +47,7 @@ while getopts 'hcCun' arg; do case "${arg}" in h) usage ;; c) CLEAN="-c" ;; - C) CLEAN_CACHE="-C" + C) CLEAN_CACHE="-C" ;; u) update_first=1 ;; n) chrootname="$OPTARG" ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; -- cgit v1.2.3-2-g168b From 78a08b6b6a1b7a156c998a4c6777041450d893e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 10 May 2011 21:05:43 -0500 Subject: Cleaning --- libremakepkg | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index 2e75288..556314e 100755 --- a/libremakepkg +++ b/libremakepkg @@ -40,15 +40,14 @@ usage() { CLEAN="" CLEAN_CACHE="" -update_first=0 +update_first="n" chrootname=${CHCOPY} while getopts 'hcCun' arg; do case "${arg}" in h) usage ;; c) CLEAN="-c" ;; - C) CLEAN_CACHE="-C" ;; - u) update_first=1 ;; + u) update_first="y" ;; n) chrootname="$OPTARG" ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; esac @@ -59,12 +58,11 @@ pkgbuild-check-nonfree ||{ if [[ $? -eq 15 ]]; then error "PKGBUILD contains non-free issues" exit 15 - else exit $? fi } -if [ $update_first -eq 1 ]; then +if [ $update_first = y ]; then msg "Updating the main chroot" # -c option in mkarchroot indicates cache mkarchroot -c ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT} @@ -74,6 +72,4 @@ fi msg "Creating the package" makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $CLEAN_CACHE $MAKEPKG_ARGS -umount ${CHROOTDIR}/${chrootname}/var/cache/pacman/pkg - exit 0 -- cgit v1.2.3-2-g168b From 1c4ec45a3ae479267319f72e4b5b1616ee85aa63 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Tue, 10 May 2011 21:07:35 -0500 Subject: Clean 2 --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index 556314e..c268f1f 100755 --- a/libremakepkg +++ b/libremakepkg @@ -70,6 +70,6 @@ fi msg "Creating the package" -makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $CLEAN_CACHE $MAKEPKG_ARGS +makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $MAKEPKG_ARGS exit 0 -- cgit v1.2.3-2-g168b From 4cf996cfd6dfccae0c6b36de78def6e747aae89d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Thu, 12 May 2011 12:57:10 -0500 Subject: cleaned libremakepkg --- libremakepkg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index c268f1f..aa29572 100755 --- a/libremakepkg +++ b/libremakepkg @@ -43,7 +43,7 @@ CLEAN_CACHE="" update_first="n" chrootname=${CHCOPY} -while getopts 'hcCun' arg; do +while getopts 'hcun' arg; do case "${arg}" in h) usage ;; c) CLEAN="-c" ;; -- cgit v1.2.3-2-g168b From 0fa9894cbc10f0742c3076666524956f7279e8af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Sat, 14 May 2011 20:24:53 -0500 Subject: * libremessages use chrootname optarg indeed --- libremakepkg | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index aa29572..f2b523d 100755 --- a/libremakepkg +++ b/libremakepkg @@ -43,12 +43,12 @@ CLEAN_CACHE="" update_first="n" chrootname=${CHCOPY} -while getopts 'hcun' arg; do +while getopts 'hcun:' arg; do case "${arg}" in - h) usage ;; + h) usage; exit 0 ;; c) CLEAN="-c" ;; u) update_first="y" ;; - n) chrootname="$OPTARG" ;; + n) chrootname="$OPTARG"; echo $chrootname ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; esac done @@ -60,16 +60,16 @@ pkgbuild-check-nonfree ||{ exit 15 exit $? fi -} +} if [ $update_first = y ]; then msg "Updating the main chroot" # -c option in mkarchroot indicates cache - mkarchroot -c ${CACHEDIR} -u -- ${CHROOTDIR}/${CHROOT} + mkarchroot -c ${CACHEDIR} -u "${CHROOTDIR}/${CHROOT}" fi msg "Creating the package" -makechrootpkg $CLEAN -r ${CHROOTDIR} -l ${chrootname} -- $MAKEPKG_ARGS +makechrootpkg $CLEAN -r ${CHROOTDIR} -l "${chrootname}" -- $MAKEPKG_ARGS exit 0 -- cgit v1.2.3-2-g168b From 7f118f53283d7e228c40a40076815ce94ebb94a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Mon, 16 May 2011 00:44:39 -0500 Subject: Cleaned up some things, added option parse to some scripts. --- libremakepkg | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index f2b523d..272e61d 100755 --- a/libremakepkg +++ b/libremakepkg @@ -21,47 +21,50 @@ source /etc/libretools.conf -if [ $UID -ne 0 ]; then - error "This script must be run as root" - exit 1 -fi - -usage() { +function usage { echo "cd to a dir containing a PKGBUILD and run:" echo "$0 [options] [makepkg args]" + echo "This script will build your package on a chroot." echo echo "OPTIONS:" echo - echo " -h : show this message" - echo " -c : cleans CHCOPY and cachedir" - echo " -u : updates before building" - echo " -n chrootname : use this dir instead of CHCOPY" + echo " -h : show this message." + echo " -c : cleans CHCOPY and cachedir." + echo " -u : updates before building." + echo " -n : use this dir instead of CHCOPY." + echo " -I pkgname : install this package, use it as many times needed." + echo } -CLEAN="" +_CLEAN="" CLEAN_CACHE="" update_first="n" chrootname=${CHCOPY} - -while getopts 'hcun:' arg; do +_PKGINSTALL="" +while getopts 'hcun:I:' arg; do case "${arg}" in h) usage; exit 0 ;; - c) CLEAN="-c" ;; + c) _CLEAN="-c" ;; u) update_first="y" ;; n) chrootname="$OPTARG"; echo $chrootname ;; - *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; + I) _PKGINSTALL+="-I $OPTARG " ;; + *) _MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; esac done +if [ $UID -ne 0 ]; then + error "This script must be run as root" + exit 1 +fi + msg "Checking PKGBUILD for non-free issues" pkgbuild-check-nonfree ||{ if [[ $? -eq 15 ]]; then error "PKGBUILD contains non-free issues" exit 15 - exit $? fi - } + if [ $update_first = y ]; then msg "Updating the main chroot" # -c option in mkarchroot indicates cache @@ -70,6 +73,7 @@ fi msg "Creating the package" -makechrootpkg $CLEAN -r ${CHROOTDIR} -l "${chrootname}" -- $MAKEPKG_ARGS +makechrootpkg $_CLEAN -r ${CHROOTDIR} -l "${chrootname}" $_PKGINSTALL \ + -- $_MAKEPKG_ARGS exit 0 -- cgit v1.2.3-2-g168b From 3b059a61e44fe0670b210b2f85ab1185c3102138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joshua=20Ismael=20Haase=20Hern=C3=A1ndez?= Date: Mon, 16 May 2011 10:40:45 -0500 Subject: libremakepkg to accept makepkg options --- libremakepkg | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'libremakepkg') diff --git a/libremakepkg b/libremakepkg index 272e61d..54a5578 100755 --- a/libremakepkg +++ b/libremakepkg @@ -41,7 +41,12 @@ CLEAN_CACHE="" update_first="n" chrootname=${CHCOPY} _PKGINSTALL="" -while getopts 'hcun:I:' arg; do +#libremakepkg own args +libremakepkgargs='hcun:I:' +#now makepkg args +libremakepkgargs+='ACdefiLmoprRs' + +while getopts ${libremakepkgargs} arg ; do case "${arg}" in h) usage; exit 0 ;; c) _CLEAN="-c" ;; @@ -73,7 +78,6 @@ fi msg "Creating the package" -makechrootpkg $_CLEAN -r ${CHROOTDIR} -l "${chrootname}" $_PKGINSTALL \ - -- $_MAKEPKG_ARGS +makechrootpkg $_CLEAN -r ${CHROOTDIR} -l "${chrootname}" $_PKGINSTALL -- $_MAKEPKG_ARGS exit 0 -- cgit v1.2.3-2-g168b