From ad988e7dfa0bc8f950785777b76baa116f4fdd09 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Sun, 28 Feb 2016 21:01:56 -0600 Subject: [PATCH] * usr/bin/Makefile.am, usr/bin/manifest, usr/bin/tmpfsffs, usr/share/man/man1/Makefile.am, usr/share/man/man1/manifest.1: - added the manifest command --- debian/changelog | 4 +- usr/bin/Makefile.am | 2 +- usr/bin/manifest | 68 ++++++++++++++++++++++++++++++++++ usr/bin/tmpfsffs | 31 ++++++++++++++++ usr/share/man/man1/Makefile.am | 2 +- usr/share/man/man1/manifest.1 | 29 +++++++++++++++ 6 files changed, 133 insertions(+), 3 deletions(-) create mode 100755 usr/bin/manifest create mode 100755 usr/bin/tmpfsffs create mode 100644 usr/share/man/man1/manifest.1 diff --git a/debian/changelog b/debian/changelog index eb60c583..f24d6a7d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,6 +1,8 @@ byobu (5.103) unreleased; urgency=medium - * UNRELEASED + * usr/bin/Makefile.am, usr/bin/manifest, usr/bin/tmpfsffs, + usr/share/man/man1/Makefile.am, usr/share/man/man1/manifest.1: + - added the manifest command -- Dustin Kirkland Thu, 04 Feb 2016 16:30:00 -0600 diff --git a/usr/bin/Makefile.am b/usr/bin/Makefile.am index 56d3faf3..2a2bd01f 100644 --- a/usr/bin/Makefile.am +++ b/usr/bin/Makefile.am @@ -1,4 +1,4 @@ -bin_SCRIPTS = byobu byobu-config byobu-ctrl-a byobu-disable byobu-disable-prompt byobu-enable byobu-enable-prompt byobu-export byobu-janitor byobu-keybindings byobu-launch byobu-launcher byobu-launcher-install byobu-launcher-uninstall byobu-layout byobu-prompt byobu-quiet byobu-reconnect-sockets byobu-select-backend byobu-select-profile byobu-select-session byobu-silent byobu-status byobu-status-detail byobu-shell byobu-ugraph byobu-ulevel col1 ctail wifi-status vigpg +bin_SCRIPTS = byobu byobu-config byobu-ctrl-a byobu-disable byobu-disable-prompt byobu-enable byobu-enable-prompt byobu-export byobu-janitor byobu-keybindings byobu-launch byobu-launcher byobu-launcher-install byobu-launcher-uninstall byobu-layout byobu-prompt byobu-quiet byobu-reconnect-sockets byobu-select-backend byobu-select-profile byobu-select-session byobu-silent byobu-status byobu-status-detail byobu-shell byobu-ugraph byobu-ulevel col1 ctail wifi-status vigpg manifest install-exec-hook: cd $(DESTDIR)$(bindir) && rm -f byobu-screen && $(LN_S) byobu byobu-screen diff --git a/usr/bin/manifest b/usr/bin/manifest new file mode 100755 index 00000000..6140aeb9 --- /dev/null +++ b/usr/bin/manifest @@ -0,0 +1,68 @@ +#!/bin/sh +# +# manifest - import/export a list of packages +# Copyright (C) 2016 Dustin Kirkland +# +# Authors: Dustin Kirkland +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, version 3 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +set -e + +export_packages() { + if [ "$OBJECT" = "-" ]; then + dpkg -l + elif echo "$OBJECT" | grep -qs ".*://.*"; then + dpkg -l | lzma -9 -f -c | base64 | pastebinit -b "$OBJECT" + else + dpkg -l > "$OBJECT" + fi +} + +import_packages() { + if [ "$OBJECT" = "-" ]; then + sudo apt install $(cat /dev/stdin | grep "^ii\s" | col2) + elif echo "$OBJECT" | grep -qs ".*://.*"; then + sudo apt install $(wget -q -O- "$OBJECT" | grep -A 999999999 '
' | grep -B 999999999 "^
" | sed -e "s/.*
//" -e "s/^<\/pre>.*//" | base64 -d | lzma -d | grep "^ii\s" | col2)
+	else
+		sudo apt install $(cat "$OBJECT" | grep "^ii\s" | col2)
+	fi
+}
+
+usage() {
+	cat <
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, version 3 of the License.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see .
+
+
+set -e
+
+if grep -qs "^tmpfs[[:space:]]/tmp[[:space:]]tmpfs" /etc/fstab; then
+	echo "SUCCESS: /tmp is already a tmpfs"
+else
+	echo "tmpfs /tmp tmpfs rw,nosuid,nodev,noexec" >> /etc/fstab
+	dir=$(mktemp -d "/dev/shm/tmp.XXXXXXXXXXXX")
+	mv /tmp/* /tmp/.* "$dir/"
+	mount -a
+	mv "$dir/"* "$dir/."* /tmp/
+fi
diff --git a/usr/share/man/man1/Makefile.am b/usr/share/man/man1/Makefile.am
index 67e4e8dd..4d2cbf48 100644
--- a/usr/share/man/man1/Makefile.am
+++ b/usr/share/man/man1/Makefile.am
@@ -1 +1 @@
-man_MANS = byobu.1 byobu-config.1 byobu-ctrl-a.1 byobu-disable.1 byobu-disable-prompt.1 byobu-enable.1 byobu-enable-prompt.1 byobu-export.1 byobu-janitor.1 byobu-keybindings.1 byobu-launch.1 byobu-launcher.1 byobu-launcher-install.1 byobu-launcher-uninstall.1 byobu-layout.1  byobu-prompt.1 byobu-quiet.1 byobu-reconnect-sockets.1 byobu-screen.1 byobu-select-backend.1 byobu-select-profile.1 byobu-select-session.1 byobu-shell.1 byobu-silent.1 byobu-status.1 byobu-status-detail.1 byobu-tmux.1 byobu-ugraph.1 byobu-ulevel.1 col1.1 ctail.1 wifi-status.1 vigpg.1
+man_MANS = byobu.1 byobu-config.1 byobu-ctrl-a.1 byobu-disable.1 byobu-disable-prompt.1 byobu-enable.1 byobu-enable-prompt.1 byobu-export.1 byobu-janitor.1 byobu-keybindings.1 byobu-launch.1 byobu-launcher.1 byobu-launcher-install.1 byobu-launcher-uninstall.1 byobu-layout.1  byobu-prompt.1 byobu-quiet.1 byobu-reconnect-sockets.1 byobu-screen.1 byobu-select-backend.1 byobu-select-profile.1 byobu-select-session.1 byobu-shell.1 byobu-silent.1 byobu-status.1 byobu-status-detail.1 byobu-tmux.1 byobu-ugraph.1 byobu-ulevel.1 col1.1 ctail.1 wifi-status.1 vigpg.1 manifest.1
diff --git a/usr/share/man/man1/manifest.1 b/usr/share/man/man1/manifest.1
new file mode 100644
index 00000000..46535d23
--- /dev/null
+++ b/usr/share/man/man1/manifest.1
@@ -0,0 +1,29 @@
+.TH manifest 1 "28 February 2016" byobu "byobu"
+.SH NAME
+manifest \- import or export a package list
+
+.SH SYNOPSIS
+\fBmanifest\fP export [-|URL|FILENAME]
+.TP
+\fBmanifest\fP import -|URL|FILENAME
+.TP
+
+.SH DESCRIPTION
+
+
+.SH "BUGS"
+
+This is currently only compatible with \fBapt(8)\fP and \fBdpkg\fP(1).
+
+.SH SEE ALSO
+.PD 0
+.TP
+\fBapt\fP(8), \fBdpkg\fP(1), \fBpastebinit\fP(1)
+.TP
+\fBhttp://byobu.org\fP
+.PD
+
+.SH AUTHOR
+This manpage and the utility were written by Dustin Kirkland  for Ubuntu systems (but may be used by others).  Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 3 published by the Free Software Foundation.
+
+The complete text of the GNU General Public License can be found in \fI/usr/share/common-licenses/GPL\fP on Debian/Ubuntu systems, or in \fI/usr/share/doc/fedora-release-*/GPL\fP on Fedora systems, or on the web at \fIhttp://www.gnu.org/licenses/gpl.txt\fP.