[Frugalware-darcs] pacman-g2: makepkg: make -t foo,bar work

VMiklos vmiklos at frugalware.org
Sat Jan 27 15:24:21 CET 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=pacman-g2;a=darcs_commitdiff;h=20070127141948-e2957-88707e73e77c6c9e7fee7d9231049adf37add837.gz;

[makepkg: make -t foo,bar work
VMiklos <vmiklos at frugalware.org>**20070127141948
 where makepkg:
 1) copies the host pacman config
 2) deletes the "Include" lines from the config
 3) adds the /etc/pacman.d/foo, /etc/pacman.d/bar lines
 this way it should be easy to use a custom repo in a chroot
 tested with my new flac113 repo ;)
] {
hunk ./scripts/makepkg 896
-		if grep -q ^Include.*current$ /etc/pacman.conf; then
-			if [ "$TREE" = "current" ]; then
-				# host: current, chroot: current
-				cat /etc/pacman.conf >$_F_makepkg_pacconf
-			else
-				# host: current, chroot: stable
-				cat /etc/pacman.conf |sed 's|^\(Include = /etc/pacman.d/frugalware-current$\)|#\1|
-					s|^#\(Include = /etc/pacman.d/frugalware$\)|\1|'>$_F_makepkg_pacconf
-			fi
-		else
-			if [ "$TREE" = "current" ]; then
-				# host: stable, chroot: current
-				cat /etc/pacman.conf |sed 's|^#\(Include = /etc/pacman.d/frugalware-current$\)|\1|
-					s|^\(Include = /etc/pacman.d/frugalware$\)|#\1|' >$_F_makepkg_pacconf
-			else
-				# host: stable, chroot: stable
-				cat /etc/pacman.conf >$_F_makepkg_pacconf
-			fi
-		fi
-		mkdir -p "$CHROOTDIR/tmp"
+		cat /etc/pacman.conf |grep -v Include >$_F_makepkg_pacconf
+		for i in `echo $TREE|sed 's/,/ /g'`
+		do
+			repo=$(eval "echo \${${i}_fdb/.fdb}")
+			[ -z "$repo" ] && repo="$i"
+			echo "Include = /etc/pacman.d/$repo" >>$_F_makepkg_pacconf
+		done
+		mkdir -p $CHROOTDIR/{tmp,var/log}
hunk ./scripts/makepkg 912
-		rm -f $_F_makepkg_pacconf
+		mv -f $_F_makepkg_pacconf $CHROOTDIR/etc/pacman.conf
}


More information about the Frugalware-darcs mailing list