summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Stone <ahs3@redhat.com>2012-11-26 14:47:52 -0700
committerAl Stone <ahs3@redhat.com>2012-11-26 14:47:52 -0700
commit26911ff43d7e0e54c155d75bc5af6b9215617332 (patch)
treeff1a6b847d6175c1d796612aba3bd1c90f1c01cb
parent5fbab0f138e86a95dc34a273dc4a944976a70182 (diff)
downloadportdep-26911ff43d7e0e54c155d75bc5af6b9215617332.tar.gz
portdep-26911ff43d7e0e54c155d75bc5af6b9215617332.tar.xz
portdep-26911ff43d7e0e54c155d75bc5af6b9215617332.zip
packages/debian: add support for the debian distro
Signed-off-by: Al Stone <ahs3@redhat.com>
-rw-r--r--packages/debian45
1 files changed, 45 insertions, 0 deletions
diff --git a/packages/debian b/packages/debian
new file mode 100644
index 0000000..dbf056c
--- /dev/null
+++ b/packages/debian
@@ -0,0 +1,45 @@
+#!/bin/bash
+#-- make sure we know how to handle the distro
+# Each file needs to define a function called get_source that will
+# be passed the working directory and a package name, and that must
+# return the full absolute path to the source tree.
+#
+# A similar remove_source function must also be defined (same parameters)
+# that just removes everything created in the working directory for this
+# package.
+#
+
+get_source() {
+ pwd=$(pwd)
+ workdir="$1"
+ pkg="$2"
+
+ #-- set up the proper environment
+ cd "$workdir"
+ [ ! -d $pkg ] && mkdir $pkg
+ cd $pkg
+
+ #-- fetch the source package
+ res=$(apt-get source $pkg >/dev/null 2>&1)
+
+ #-- all done. as you were. and report the path.
+ path=$(ls -d ${pkg}-[0-9].* | head -1)
+ if [ ! -z $path ]
+ then
+ echo $workdir/$pkg/$path
+ else
+ echo ""
+ fi
+ cd $pwd
+}
+
+remove_source () {
+ pwd=$(pwd)
+ workdir="$1"
+ pkg="$2"
+
+ cd "$workdir"
+ rm -rf $pkg >/dev/null 2>&1
+
+ cd $pwd
+}