From 5c2dd97a91421e6e5f7e920579fcb88bb71e7fa7 Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Sun, 13 Jan 2013 18:41:31 -0500 Subject: use /usr/share/devtools/makechrootpkg.sh instead of *.gpl2 --- src/chroot-tools/librechroot | 11 +--- src/chroot-tools/librechroot.gpl2 | 41 ------------- src/chroot-tools/libremakepkg | 21 +------ src/chroot-tools/libremakepkg.gpl2 | 115 ------------------------------------- 4 files changed, 4 insertions(+), 184 deletions(-) delete mode 100755 src/chroot-tools/librechroot.gpl2 delete mode 100755 src/chroot-tools/libremakepkg.gpl2 (limited to 'src/chroot-tools') diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index 89fb644..7f113f5 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -24,12 +24,7 @@ load_conf_libretools_chroot . "$(which libremessages)" - -# This file (librechroot) is GPLv3+, but I would like to use some code -# modified from devtools' "makechrootpkg", which is GPLv2. -. "$(dirname "$0")/librechroot.gpl2" -# This gives us the functions: -# - sync +. /usr/share/devtools/makechrootpkg.sh cleanup=(':'); cleanup() { @@ -120,7 +115,7 @@ main() { fi if [[ ! -d $copydir ]] && [[ $mode != sync ]]; then - sync + chroot_sync fi mkdir -p $copydir/etc/libretools.d @@ -160,7 +155,7 @@ main() { install_pkg) archroot "${archroot_args[@]}" "${copydir}" -i $ARG ;; noop) :;; run) archroot "${archroot_args[@]}" "${copydir}" -r "$ARG" ;; - sync) sync;; + sync) chroot_sync;; update) archroot "${archroot_args[@]}" "${copydir}" -u ;; enter) archroot "${archroot_args[@]}" "${copydir}" -r bash ;; esac diff --git a/src/chroot-tools/librechroot.gpl2 b/src/chroot-tools/librechroot.gpl2 deleted file mode 100755 index 1b5d90a..0000000 --- a/src/chroot-tools/librechroot.gpl2 +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash -# Contains code derived from devtools' "makechrootpkg" - -# Copyright 2011-2012 The Arch Linux Development Team -# Copyright 2012 Luke Shumaker -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -sync() { - if [[ $CHROOTCOPY = root ]]; then - error "Cannot sync the root copy with itself" - exit 1 - fi - - lock_open_read 8 "$rootdir" \ - "Waiting for existing lock on \`$rootdir' to be released" - - stat_busy 'Creating clean working copy' - local use_rsync=false - if type -P btrfs >/dev/null; then - [[ -d $copydir ]] && btrfs subvolume delete "$copydir" &>/dev/null - btrfs subvolume snapshot "$rootdir" "$copydir" &>/dev/null || use_rsync=true - else - use_rsync=true - fi - - if $use_rsync; then - mkdir -p "$copydir" - rsync -a --delete -q -W -x "$rootdir/" "$copydir" - fi - stat_done - - lock_close 8 -} diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 2901b0d..a9e1fb7 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -24,31 +24,12 @@ load_conf_libretools_chroot . "$(which libremessages)" +. /usr/share/devtools/makechrootpkg.sh shopt -s nullglob -# This file (libremakepkg) is GPLv3+, but I would like to use some code -# modified from devtools' "makechrootpkg", which is GPLv2. -. "$(dirname "$0")/libremakepkg.gpl2" -# This gives us the functions: -# - chroot_init -# - chroot_exec -# - chroot_copy_in -# - chroot_copy_out -# - add_to_local_repo - # Boring functions ############################################################# -## -# copy logs if they exist -## -copy_logs() { - for l in "$copydir"/build/*.log; do - chown "$LIBREUSER" "$l" - mv "$l" . - done -} - ## # End inmediately but print a useful message ## diff --git a/src/chroot-tools/libremakepkg.gpl2 b/src/chroot-tools/libremakepkg.gpl2 deleted file mode 100755 index 6b7180b..0000000 --- a/src/chroot-tools/libremakepkg.gpl2 +++ /dev/null @@ -1,115 +0,0 @@ -#!/bin/bash -# Contains code derived from devtools' "makechrootpkg" - -# Copyright 2011-2012 The Arch Linux Development Team -# Copyright 2012 Luke Shumaker -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. - -chroot_init() { - # make sure the chroot exists - librechroot -n "$CHROOT" -l "$CHROOTCOPY" -m - - if [[ -r "$LIBREHOME/.gnupg/pubring.gpg" ]]; then - install -D "$LIBREHOME/.gnupg/pubring.gpg" "$copydir/build/.gnupg/pubring.gpg" - fi - rm -f "$copydir/build/.makepkg.conf" - - mkdir -p "$copydir/pkgdest" - mkdir -p "$copydir/srcdest" - - MAKEPKG_CONF=$copydir/etc/makepkg.conf set_conf_makepkg PKGDEST /pkgdest - MAKEPKG_CONF=$copydir/etc/makepkg.conf set_conf_makepkg SRCDEST /srcdest - - cat > "$copydir/etc/sudoers.d/nobody-pacman" <"$copydir/chrootexec" </dev/null - cp "$pkgfile" . - repo-add repo.db.tar.gz "${pkgfile##*/}" - popd >/dev/null - done -} -chroot_copy_out() { - for pkgfile in "$copydir"/pkgdest/*.pkg.tar*; do - chown "$LIBREUSER" "$pkgfile" - mv "$pkgfile" "$PKGDEST" - if [[ $PKGDEST != . ]]; then - ln -s "$PKGDEST/${pkgfile##*/}" . - fi - done - copy_logs -} -- cgit v1.2.3-54-g00ecf