* 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
This commit is contained in:
Dustin Kirkland 2016-02-28 21:01:56 -06:00
commit ad988e7dfa
6 changed files with 133 additions and 3 deletions

4
debian/changelog vendored
View file

@ -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 <kirkland@ubuntu.com> Thu, 04 Feb 2016 16:30:00 -0600

View file

@ -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

68
usr/bin/manifest Executable file
View file

@ -0,0 +1,68 @@
#!/bin/sh
#
# manifest - import/export a list of packages
# Copyright (C) 2016 Dustin Kirkland
#
# Authors: Dustin Kirkland <kirkland@byobu.co>
#
# 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 <http://www.gnu.org/licenses/>.
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 '<div class="paste"><pre>' | grep -B 999999999 "^</pre>" | sed -e "s/.*<pre>//" -e "s/^<\/pre>.*//" | base64 -d | lzma -d | grep "^ii\s" | col2)
else
sudo apt install $(cat "$OBJECT" | grep "^ii\s" | col2)
fi
}
usage() {
cat <<EOF
USAGE:
$0 export [-|URL|FILENAME]
$0 import -|URL|FILENAME
EOF
exit 0
}
if [ -n "$1" ]; then
ACTION="$1"
shift
else
usage
fi
if [ -n "$1" ]; then
OBJECT="$1"
shift
fi
if [ "$ACTION" = "import" ]; then
import_packages
elif [ "$ACTION" = "export" ]; then
[ -n "$OBJECT" ] || OBJECT="http://paste.ubuntu.com"
export_packages
else
usage
fi

31
usr/bin/tmpfsffs Executable file
View file

@ -0,0 +1,31 @@
#!/bin/sh
#
# tmpfsffs - setup /tmp on tmpfs, for faster seeks
# Copyright (C) 2016 Dustin Kirkland
#
# Authors: Dustin Kirkland <kirkland@ubuntu.com>
#
# 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 <http://www.gnu.org/licenses/>.
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

View file

@ -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

View file

@ -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 <kirkland@byobu.org> 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.