From 63f8d6fd765b80abca682dfd6b3b80050bf76b3e Mon Sep 17 00:00:00 2001 From: Luke Shumaker Date: Tue, 7 May 2013 11:00:02 -0400 Subject: have `librechroot install-file` add the packages to the local repo. --- src/chroot-tools/librechroot | 5 ++++- src/chroot-tools/libremakepkg | 4 ++-- src/devtools/lib/makechrootpkg.sh.patch | 8 ++++---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/chroot-tools/librechroot b/src/chroot-tools/librechroot index a10734b..d5b677c 100755 --- a/src/chroot-tools/librechroot +++ b/src/chroot-tools/librechroot @@ -200,7 +200,10 @@ main() { ;; # Dealing with packages - install-file) normshell chroot_install_pkgs "$copydir" "$@";; + install-file) + normshell chroot_install_pkgs "$copydir" "$@" + normshell chroot_add_to_local_repo "$copydir" "$@" + ;; install-name) archroot -r "$copydir" pacman -Sy "$@";; update) archroot -u "$copydir";; clean-pkgs) diff --git a/src/chroot-tools/libremakepkg b/src/chroot-tools/libremakepkg index 9267496..b01976d 100755 --- a/src/chroot-tools/libremakepkg +++ b/src/chroot-tools/libremakepkg @@ -73,7 +73,7 @@ EOF fi } -# Usage: add_to_local_repo $copydir +# Usage: add_to_local_repo $copydir $pkgfiles... add_to_local_repo() ( set +euE . /usr/share/devtools/makechrootpkg.sh @@ -304,7 +304,7 @@ main() { build check_pkg - add_to_local_repo "$copydir" + add_to_local_repo "$copydir" "$copydir"/pkgdest/*.pkg.tar* $INCHROOT || chroot_copy_out "$copydir" "$LIBREUSER" } diff --git a/src/devtools/lib/makechrootpkg.sh.patch b/src/devtools/lib/makechrootpkg.sh.patch index 6016ba4..13a9ff1 100644 --- a/src/devtools/lib/makechrootpkg.sh.patch +++ b/src/devtools/lib/makechrootpkg.sh.patch @@ -143,10 +143,10 @@ -if archroot -r "$copydir" "/chrootbuild"; then - for pkgfile in "$copydir"/pkgdest/*.pkg.tar.?z; do - if $add_to_db; then -+# Usage: chroot_add_to_local_repo $copydir ++# Usage: chroot_add_to_local_repo $copydir $pkgfiles... +chroot_add_to_local_repo() { -+ local copydir=$1 -+ for pkgfile in "$copydir"/pkgdest/*.pkg.tar*; do ++ local copydir=$1; shift ++ for pkgfile in "$@"; do mkdir -p "$copydir/repo" pushd "$copydir/repo" >/dev/null cp "$pkgfile" . @@ -236,7 +236,7 @@ + chroot_build "$copydir" "$makepkg_args" "$run_namcap" + func2 + if chroot_build; then -+ chroot_add_to_local_repo "$copydir" ++ chroot_add_to_local_repo "$copydir" "$copydir"/pkgdest/*.pkg.tar* + chroot_copy_out_pkgs "$copydir" "$src_owner" + chroot_copy_out_logs "$copydir" "$src_owner" + else -- cgit v1.2.3-54-g00ecf