diff options
author | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-12-18 17:55:10 -0300 |
---|---|---|
committer | Nicolás Reynolds <fauno@kiwwwi.com.ar> | 2011-12-18 17:55:10 -0300 |
commit | cccba27ea8ec823a9768ba2cd944edab53697bb1 (patch) | |
tree | 6f5a367807d3a2e3a1a58deccbb576857aa49ce9 | |
parent | 7e8764fb315b05068fe9d704734a2a4ec8588e54 (diff) | |
parent | 54ba056b200a5ef141f8d589a2f45478c6bd8a6b (diff) |
Merge branch 'master' of ssh://gparabola/libretools
-rw-r--r-- | cleansystem | 102 | ||||
-rwxr-xr-x | fullpkg | 7 | ||||
-rwxr-xr-x | libremakepkg | 19 | ||||
-rwxr-xr-x | librerelease | 31 | ||||
-rwxr-xr-x | librerepkg | 5 | ||||
-rwxr-xr-x | librestage | 29 |
6 files changed, 77 insertions, 116 deletions
diff --git a/cleansystem b/cleansystem index 3f92b95..8da434b 100644 --- a/cleansystem +++ b/cleansystem @@ -1,119 +1,55 @@ -acl -attr -autoconf -automake +bzip2 +filesystem +initscripts +licenses-libre +linux-libre +pacman +pacman-mirrorlist-libre +your-freedom bash binutils -bison bzip2 -cloog coreutils -cracklib +cronie cryptsetup -dash -db -dbus-core -dcron device-mapper dhcpcd diffutils -distcc e2fsprogs -eventlog -expat -fakeroot file -filesystem findutils -flex gawk -gcc -gcc-fortran gcc-libs -gcc-objc -gdbm -gen-init-cpio gettext -glib2 glibc -gmp grep gzip heirloom-mailx -iana-etc -initscripts -iproute2 +inetutils iputils -isl jfsutils -kbd -kernel26-libre -keyutils -krb5 less -libarchive -libcap -libedit -libfetch -libgcrypt -libgpg-error -libgssglue -libldap -libmpc -libnl -libpcap libpipeline -libretools -libretools -libsasl -libtirpc -libtool -libusb -libusb-compat -licenses-libre -linux-api-headers logrotate lvm2 -m4 -make +man-db +man-pages mdadm -mkinitcpio -mkinitcpio-busybox -module-init-tools -mpfr nano -ncurses -net-tools -openssh -openssl -pacman -pacman-mirrorlist-libre -pam -patch pciutils pcmciautils -pcre perl -pkg-config -popt -ppl ppp procps psmisc -readline reiserfsprogs -rp-pppoe -rsync sed shadow -sudo sysfsutils syslog-ng sysvinit tar -tcp_wrappers texinfo -tzdata udev usbutils util-linux @@ -122,5 +58,15 @@ wget which wpa_supplicant xfsprogs -xz -zlib +autoconf +automake +bison +fakeroot +flex +gcc +libtool +m4 +make +patch +pkg-config +sudo @@ -348,11 +348,10 @@ if [ ${level} -eq 0 ]; then touch "${build_dir}"/{log,BUILDORDER} buildorder="${build_dir}/BUILDORDER" - if ! (( noupdate )); then + if ! noupdate; then -# Always return true - msg "Updating pacman db and packages" - sudo pacman -Syu --noconfirm || true + msg "Updating pacman db" + sudo pacman -Sy --noconfirm || true fi diff --git a/libremakepkg b/libremakepkg index bac9e30..292e4b5 100755 --- a/libremakepkg +++ b/libremakepkg @@ -22,6 +22,13 @@ source /etc/libretools.conf source /etc/makepkg.conf +# Local vars may differ from chroot's +LOCALPKGDEST=${PKGDEST} +LOCALSRCDEST=${SRCDEST} +LOCALSRCPKGDEST=${SRCPKGDEST} + +source ${CHROOTDIR}/${CHROOT}/etc/makepkg.conf + function usage { # Display message and exit echo 'cd to a dir containing a PKGBUILD and run:' @@ -42,10 +49,14 @@ function usage { # Display message and exit function buildenv { # Mounts *DEST from makepkg.conf msg "Building env" - for mp in ${SRCDEST} ${PKGDEST} ${SRCPKGDEST}; do - msg2 "binding ${mp} to ${CHROOTDIR}/${CHROOT}${mp}" - mkdir -p "${CHROOTDIR}/${CHROOT}${mp}" - mount -o bind ${mp} "${CHROOTDIR}/${CHROOT}${mp}" || exit 1 + for mp in SRCDEST PKGDEST SRCPKGDEST; do +# The host system directory + lmp=LOCAL${mp} + + msg2 "Binding ${!lmp} to ${CHROOTDIR}/${CHROOT}${!mp}" + + mkdir -p "${CHROOTDIR}/${CHROOT}${!mp}" + mount -o bind ${!lmp} "${CHROOTDIR}/${CHROOT}${!mp}" || exit 1 done } diff --git a/librerelease b/librerelease index bc765fe..c4584e1 100755 --- a/librerelease +++ b/librerelease @@ -46,6 +46,30 @@ function list_packages { unset repos } +function sign_packages { + if [ -z "${GPG_AGENT_INFO}" ]; then + warning "It's better to use gpg-agent to sign packages in batches" + fi + + packages=($(find "${WORKDIR}/staging/" -type f -iname '*.pkg.tar.?z')) + for package in ${packages[@]}; do + if [ -f "${package}${SIGEXT}" ]; then + + warning "Package signature found, verifying..." + +# Verify that the signature is correct, else remove for re-signing + if ! gpg --quiet --verify "${package}${SIGEXT}" >/dev/null 2>&1; then + error "Failed! Resigning..." + rm -f "${package}${SIGEXT}" + else + continue + fi + fi + + gpg --default-key "${SIGID}" --output "${package}${SIGEXT}" --detach-sig "${package}" + done +} + # Remove everything that's not a package or a signature function clean_non_packages { find $WORKDIR/staging/ -type f \ @@ -78,6 +102,13 @@ done [[ ! -z ${HOOKPRERELEASE} ]] && bash -c "${HOOKPRERELEASE}" clean_non_packages +if [ ! -z "${SIGID}" ]; then + sign_packages +else + error "Package signing is *required*" + exit 1 +fi + msg "Uploading packages..." rsync --recursive \ ${dryrun} \ @@ -36,7 +36,7 @@ source rePKGBUILD usage() { echo "cd to a dir with a rePKGBUILD and other file info and run" - echo "$0 " + echo "$0 [makepkg flags]" echo echo "This script will repackage an arch package without compiling" } @@ -44,6 +44,7 @@ usage() { while getopts 'h' arg; do case $arg in h) usage; exit 0 ;; + *) makepkgflags=$@ ;; esac done @@ -58,6 +59,6 @@ msg2 "Updating md5sums" makepkg -gp rePKGBUILD >> rePKGBUILD msg "Repackaging using makepkg" -makepkg -Lcdp rePKGBUILD $@ +makepkg -Lcdp rePKGBUILD ${makepkgflags} stdnull popd ${tempdir} @@ -85,17 +85,7 @@ for _arch in ${ARCHES[@]}; do pkgfile=$(basename ${pkgpath}) - if [ ! -z "${SIGID}" ]; then - sigpath=${pkgpath}${SIGEXT} - sigfile=${pkgfile}${SIGEXT} - - msg "Signing package with ID ${SIGID}" - gpg --default-key "${SIGID}" --output ${sigpath} --detach-sig ${pkgpath} || { - error "Couldn't sign ${pkgfile}, aborting..." - exit 1 - } - fi - +# TODO refactor this if [ -e "${pkgpath}" ]; then msg "Found ${pkgfile}" @@ -113,15 +103,6 @@ for _arch in ${ARCHES[@]}; do staged=true } - if [ ! -z "${SIGID}" ]; then - canonical_sig="${WORKDIR}/staging/${_repo}/${pkgfile}${SIGEXT}" - cp "${sigpath}" "${WORKDIR}/staging/${_repo}/" || { - error "Can't put ${sigfile} on [staging]" - exit 1 - } && { - msg2 "${pkg} signature on [${_repo}]" - } - fi else ln "${canonical}" "${WORKDIR}/staging/${_repo}/${pkgfile}" || { error "Can't put ${pkgfile} on [staging]" @@ -131,14 +112,6 @@ for _arch in ${ARCHES[@]}; do staged=true } - if [ ! -z "${SIGID}" ]; then - ln "${canonical_sig}" "${WORKDIR}/staging/${_repo}/${sigfile}" || { - error "Can't put ${sigfile} on [staging]" - exit 1 - } && { - msg2 "${pkg} signature on [${_repo}]" - } - fi fi done fi |