[Frugalware-darcs] pacman-tools: syncpkg: git support

VMiklos vmiklos at frugalware.org
Sun Jul 1 01:50:55 CEST 2007


Darcsweb-Url: http://darcs.frugalware.org/darcsweb/darcsweb.cgi?r=pacman-tools;a=darcs_commitdiff;h=20070630234907-e2957-92c87f51103c213fa50ead575c5e0e67507f0f61.gz;

[syncpkg: git support
VMiklos <vmiklos at frugalware.org>**20070630234907] {
hunk ./syncpkg 5
-#   Copyright (c) 2005-2006 by Miklos Vajna <vmiklos at frugalware.org>
+#   Copyright (c) 2005-2007 by Miklos Vajna <vmiklos at frugalware.org>
hunk ./syncpkg 48
-if [ ! -d ~/darcs ]; then
-	mkdir ~/darcs
+if [ ! -d ~/repos ]; then
+	mkdir ~/repos
hunk ./syncpkg 51
-cd ~/darcs
+cd ~/repos
hunk ./syncpkg 60
+if ssh genesis.frugalware.org ls /home/ftp/pub/frugalware/frugalware-$tree/.git &>/dev/null
+	scm=git
+else
+	scm=darcs
+fi
+
hunk ./syncpkg 67
-	darcs get --partial syncpkgd at darcs.frugalware.org:/home/ftp/pub/frugalware/frugalware-$tree >>$blogfile 2>&1
+	if [ "$scm" = "git" ]; then
+		git clone syncpkgd at genesis.frugalware.org:/home/ftp/pub/frugalware/frugalware-$tree >>$blogfile 2>&1
+	else
+		darcs get --partial syncpkgd at genesis.frugalware.org:/home/ftp/pub/frugalware/frugalware-$tree >>$blogfile 2>&1
+	fi
hunk ./syncpkg 76
-	darcs pull -a >>$blogfile 2>&1
-	# revert changes if there are any
-	darcs revert -a >>$blogfile 2>&1
+	if [ "$scm" = "git" ]; then
+		git pull >>$blogfile 2>&1
+		# revert changes if there are any
+		git checkout -f
+	else
+		darcs pull -a >>$blogfile 2>&1
+		# revert changes if there are any
+		darcs revert -a >>$blogfile 2>&1
+	fi
}


More information about the Frugalware-darcs mailing list