[Frugalware-darcs] pacman-tools: repoman: git support in update()

VMiklos vmiklos at frugalware.org
Sun Jul 1 00:29:46 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=pacman-tools;a=darcs_commitdiff;h=20070630222808-e2957-1c7cebef29a0d6210526ee7cbb3be1b1ff075993.gz;

[repoman: git support in update()
VMiklos <vmiklos at frugalware.org>**20070630222808] {
hunk ./repoman 417
-		die "The rsync program is missing. Please install it with pacman -S rsync."
+		die "The rsync program is missing. Please install it with pacman-g2 -S rsync."
+	elif [ ! "`type -p git`" ]; then
+		die "The git program is missing. Please install it with pacman-g2 -S git."
hunk ./repoman 438
-			if [ "$F_makepkg_scm" = "git" ]; then
-				echo "update() not yet supported" # FIXME
-				echo "failed."
-				break
+			# check for scm
+			if rsync -q $j/.git 2>/dev/null; then
+				if [ -d $fst_root/$i ]; then
+					cmd="cd $i && git pull"
+				else
+					cmd="git clone $j/.git $i"
+				fi
+			elif rsync -q $j/_darcs 2>/dev/null; then
+				cmd="rsync -azvP $j/_darcs/current/ $i"
hunk ./repoman 448
-			server="$j/_darcs/current/"
-			mkdir -p $fst_root/$i
-			cd $fst_root/$i
+				echo "This server ($j) does not support git nor darcs."
+				continue
+			fi
+			mkdir -p $fst_root
+			cd $fst_root
hunk ./repoman 455
-				rsync -azq $server ./
+				eval $cmd &>/dev/null
hunk ./repoman 459
-				rsync -azvP $server ./
+				eval $cmd
hunk ./repoman 468
-			fi
}


More information about the Frugalware-darcs mailing list