]> begriffs open source - repo-ui/blob - imprison-perl-modules
How to host gitweb
[repo-ui] / imprison-perl-modules
1 #!/bin/sh
2
3 if [ "$#" -ne 1 ]; then
4     echo "Usage: $0 <chroot_destination>"
5     exit 1
6 fi
7
8 CHROOT_PATH="$1"
9
10 if [ ! -d "$CHROOT_PATH" ]; then
11     echo "Error: Destination path '$CHROOT_PATH' does not exist."
12     exit 1
13 fi
14
15 # Get the @INC paths from Perl
16 INC_PATHS=$(perl -e 'print join("\n", @INC)')
17
18 # Loop through each path and copy it to the destination
19 for isrc in $INC_PATHS; do
20         idst=$(dirname "$CHROOT_PATH$isrc")
21         mkdir -p "$idst"
22         cp -R "$isrc" "$idst"
23 done
24
25 echo "Copy completed."