summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-07-22 09:06:12 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-07-22 09:06:12 -0700
commit3e09b5d5080619b959f6b56f7f288cdcb39b77ab (patch)
treee9dba9baa9eba83ecc3cfd685ea8641b9f4b8cac
parentf51bc46d624373e919fd1a5de81ec80f175521e0 (diff)
downloaddotfiles-3e09b5d5080619b959f6b56f7f288cdcb39b77ab.tar.gz
make sbuild-preupload and package-plan-unpack available to Eshell
-rw-r--r--.bashrc30
-rw-r--r--.emacs.d/init-spw.el17
-rwxr-xr-xbin/sbuild-preupload35
3 files changed, 52 insertions, 30 deletions
diff --git a/.bashrc b/.bashrc
index 4986470a..10b264ba 100644
--- a/.bashrc
+++ b/.bashrc
@@ -90,36 +90,6 @@ alias spin-this-host-now='(cd /usr/local/propellor && sudo ./propellor)'
# --- more powerful aliases built with shell functions
-# run a package build and the full suite of checks that I can do
-# locally before an upload. Generally I use this on an UNRELEASED
-# package and then use `dgit push-source` for the actual upload
-sbuild-preupload() {
- local dgit=""
- local sbuild=""
- for key in "$@"; do
- case $key in
- --gbp|--dpm|--quilt=*)
- dgit="$dgit $key"
- shift
- ;;
- *)
- sbuild="$sbuild $key"
- shift
- ;;
- esac
- done
- case $(pwd) in
- *src/DHG_packages/p*)
- sbuild $sbuild \
- --no-run-lintian --run-piuparts --run-autopkgtest
- ;;
- *)
- eval dgit $dgit sbuild $sbuild \
- --no-run-lintian --run-piuparts --run-autopkgtest
- esac
- lintian
-}
-
package-plan-unpack () {
package="$1"
patches="$HOME/src/package-plan/patches/${package%-*}/${package##*-}"
diff --git a/.emacs.d/init-spw.el b/.emacs.d/init-spw.el
index 340d2bcc..07a44915 100644
--- a/.emacs.d/init-spw.el
+++ b/.emacs.d/init-spw.el
@@ -837,6 +837,23 @@ to be run by the OS shell."
(ring-ref spw/eshell-buffers i))
(message "Use <Left> and <Right> to cycle Eshells"))
+;;; my commands -- like defining functions in .bashrc where simple aliases are
+;;; not enough
+
+(defun eshell/package-plan-unpack (package)
+ (let* ((patches (progn
+ (string-match "\\(.+\\)-\\([^-]+\\)" package)
+ (expand-file-name (concat "~/src/package-plan/patches/"
+ (match-string 1 package)
+ "/"
+ (match-string 2 package))))))
+ (make-directory patches t)
+ (eshell/cd "/tmp")
+ (eshell-command (concat "cabal unpack --pristine " package))
+ (make-symbolic-link patches (concat "/tmp/" package "/patches"))
+ (eshell/cd (concat "/tmp/" package))
+ (eshell-command "ls ${readlink patches}")))
+
;;;; Miscellaneous functions
diff --git a/bin/sbuild-preupload b/bin/sbuild-preupload
new file mode 100755
index 00000000..9f6d4653
--- /dev/null
+++ b/bin/sbuild-preupload
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+# run a package build and the full suite of checks that I can do
+# locally before an upload. Generally I use this on an UNRELEASED
+# package and then use `dgit push-source` for the actual upload
+
+set -e
+
+dgit=""
+sbuild=""
+
+for key in "$@"; do
+ case $key in
+ --gbp|--dpm|--quilt=*)
+ dgit="$dgit $key"
+ shift
+ ;;
+ *)
+ sbuild="$sbuild $key"
+ shift
+ ;;
+ esac
+done
+
+case $(pwd) in
+ *src/DHG_packages/p*)
+ sbuild $sbuild \
+ --no-run-lintian --run-piuparts --run-autopkgtest
+ ;;
+ *)
+ eval dgit $dgit sbuild $sbuild \
+ --no-run-lintian --run-piuparts --run-autopkgtest
+esac
+
+lintian