mirror of
https://github.com/archlinuxarm/PKGBUILDs.git
synced 2024-11-28 22:57:37 +00:00
38 lines
777 B
Text
38 lines
777 B
Text
|
#!/bin/bash
|
||
|
# rfs-pacman
|
||
|
# simplified rootfs manipulation with pacman.
|
||
|
##
|
||
|
|
||
|
# current directory
|
||
|
PWD=`pwd`
|
||
|
|
||
|
# does this directory have etc/pacman.conf?
|
||
|
if [ -f $PWD/etc/pacman.conf ]; then
|
||
|
|
||
|
SHORT=`echo $PWD | sed 's/.*\///'`
|
||
|
ARCH=`grep 'Architecture =' etc/pacman.conf | sed 's/Architecture = //'`
|
||
|
echo "Calling pacman:"
|
||
|
echo " -root: $PWD"
|
||
|
echo " -arch: $ARCH"
|
||
|
|
||
|
SEDPWD=`echo $PWD | sed 's/\\//\\\\\//g'`
|
||
|
sed "s/\/etc\/pacman.d/$SEDPWD\/etc\/pacman.d/" \
|
||
|
$PWD/etc/pacman.conf > etc/pacman.conf.rfs
|
||
|
|
||
|
pacman \
|
||
|
-r $PWD \
|
||
|
-b $PWD/var/lib/pacman \
|
||
|
--arch $ARCH \
|
||
|
--cachedir $PWD/var/cache/pacman/pkg \
|
||
|
--config $PWD/etc/pacman.conf.rfs \
|
||
|
--logfile $PWD/../$SHORT.pacman.log \
|
||
|
$@
|
||
|
|
||
|
rm $PWD/etc/pacman.conf.rfs
|
||
|
|
||
|
else
|
||
|
echo "'$PWD' doesn't appear to be a rootfs."
|
||
|
fi
|
||
|
|
||
|
|