summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-04-11 18:16:02 -0300
committerNicolás Reynolds <apoyosis@correo.inta.gob.ar>2012-04-11 18:16:02 -0300
commita9680de1b0b37d8ceba6ab90864681d0bf4d7fb4 (patch)
tree3a136b983cd1b872e8695edfaaffabbede009e44
parent51ed383ed4a3f501fb3ef458196af040559fad37 (diff)
Git-PBS forks packages from Arch svntogit/packages.git
It creates a single package git repo and tracks upstream changes. It's intended to fork upstream PKGBUILDs into their -libre versions. **STILL UNDER TEST**
-rwxr-xr-xgit-pbs44
1 files changed, 44 insertions, 0 deletions
diff --git a/git-pbs b/git-pbs
new file mode 100755
index 0000000..b815863
--- /dev/null
+++ b/git-pbs
@@ -0,0 +1,44 @@
+#!/bin/bash
+
+_pkg=$1
+
+mkdir -p $_pkg
+pushd $_pkg
+
+
+if [ ! -d .git ]; then
+# Start a git repo for the package
+# Add the remote origin
+# Pull the package branch onto an unmodified branch
+ git init
+ git remote add arch git://projects.archlinux.org/svntogit/packages.git
+
+# Export the repository
+ touch .git/git-daemon-export-ok
+
+# Pass the -b flag to checkout to create the branches
+ extra="-b"
+fi
+
+git checkout ${extra} upstream
+git pull arch packages/$_pkg
+
+# Move PKGBUILD and files to the basedir
+# Remove everything else from the repo
+git checkout ${extra} master
+
+# This produces a lot of merging conflicts
+git merge upstream
+
+# This apparently solves them
+git mv trunk/* .
+git rm -rf repos
+
+# Remove the actual files
+rm -rf trunk repos
+
+# Commit everything
+git commit -a -m "Converted to PBS"
+
+# Return to the repo
+popd >/dev/null