Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#!/bin/bash #Barry Kauler Dec. 2010, license GPL v3 /usr/share/doc/legal. #based on a script by technosaurus, Dec. 2010. #Modified by s243a to work with an alternative root and for better cli support. #set -x REMOVE_BUILTIN_fixmenus=no REMOVE_BUILTIN_prompt=no CHROOT_UPDATES=no REMOVE_BUILTIN_use_gui=no CHROOT_DIR="${CHROOT_DIR:-/mnt/+aufs+devsave+test_save+ext2/Kali/kalipup_CLI.tar.gz.extracted/kalipup/puppy_upupgg+d_20.10.sfs.extracted}" #echo CHROOT_DIR="CHROOT_DIR=$CHROOT_DIR" #set +x #read -p "Press Enter to continue" #set -x [ "`whoami`" != "root" ] && exec sudo -A ${0} ${@} #110505 export TEXTDOMAIN=remove_builtin export OUTPUT_CHARSET=UTF-8 eval_gettext () { local myMESSAGE=$(gettext "$1") eval echo \"$myMESSAGE\" } Yes_lbl="$(gettext 'Yes')" No_lbl="$(gettext 'No')" MSG1="`gettext \"Simple utility to 'delete' packages that are builtin\nto the read-only .sfs file (Squashfs filesystem)\"`" FIXMENU='no' D=$CHROOT_DIR/root/.packages/builtin_files D="$(realpath "$D")" [ ! -d "$D" ] && D=$CHROOT_DIR/var/packages/builtin_files #=========================================================== process_remove_builtin_list() { # count #set -x local pkglist="$1" COUNT=$(wc -l < "$1") COUNTER=0 mkdir -p /tmp/deb-build/ #exec 15<> /tmp/deb-build/fd_15 # process while read -r p; do echo "Processing: $p" p=${p%%#*}; eval set -- $p; p="$1" [ -z $p ] && continue # commands COUNTER=$((COUNTER+1)) echo $COUNTER of $COUNT "$@" case $p in #%exit) break ;; #%dpkg) # echo Switching to dpkg # [ -z "$WITHOUT_DPKG" ] && do_install() { dpkg_install; } || # do_install() { dpkgchroot_install; } ;; #%dpkgchroot) # echo Switching to dpkgchroot # do_install() { dpkgchroot_install; } ;; #%bootstrap) # echo Switching to bootstrap # do_install() { bootstrap_install; } ;; #%bblinks) # shift # $1-nousr # echo Installing busybox symlinks ... # install_bb_links "$@" ;; #%makesfs) # set -x # #unbind_ALL # wait_until_unmounted || exit # shift # $1-output $@-squashfs params # echo Creating $1 ... # make_sfs "$@" ;; #%remove) # shift # $1-pkgname, pkgname, ... # remove_pkg "$@" ;; #%addbase) # echo Installing base rootfs ... # [ "$BASE_ARCH_PATH" ] && install_from_dir $BASE_ARCH_PATH base-arch core # install_from_dir $BASE_CODE_PATH base core ;; #%addpkg) # set -x # shift # $1-pkgname, pkgname ... # forced=0 # PKGSECTION="optional" # while [ "$1" ]; do # case "$1" in # --forced) # forced=1 # ;; # --category=*) # PKGSECTION="${1#'--category='}"; # ;; # *) # ! [ -d $EXTRAPKG_PATH/$1 ] && shift && continue # echo Installing extra package "$1" ... # if [ $forced -eq 1 ]; then # install_from_dir $EXTRAPKG_PATH/$1 $1 $PKGSECTION force # else # install_from_dir $EXTRAPKG_PATH/$1 $1 $PKGSECTION # fi # ;; # esac # shift # done # set +x # ;; #%importpkg) # shift # set -x # import_from_dir $EXTRAPKG_PATH/$1 # set +x # ;; #%dummy) # set -x # shift # $1-pkgname, pkgname ... # install_dummy "$@" # set +x # ;; #%dpkg_configure) # shift # $@-configure flags # DEBIAN_FRONTEND=noninteractive chroot $CHROOT_DIR /usr/bin/dpkg --configure "$@" ;; #%lock) # shift # $1-pkgname, pkgname ... # lock_pkg "$@" ;; #%cutdown) # set -x # shift # $@ various cutdown options # cutdown "$@" ;; #%import) # shift # $@ dirs to import # import_dir "$@" ;; # #### filesystem operations #%symlink) # shift # $1 source $2 target # rm -f $CHROOT_DIR/$2 # ln -s $1 $CHROOT_DIR/$2 # ;; #%rm) # shift # $@ files to remove # while [ "$1" ]; do # rm -rf $CHROOT_DIR/$1 # shift # done # ;; #%mkdir) # shift # $@ dirs to make # while [ "$1" ]; do # mkdir -p $CHROOT_DIR/$1 # shift # done # ;; #%touch) # shift # $@ files to create # while [ "$1" ]; do # > $CHROOT_DIR/$1 # shift # done # ;; #%chroot) # shift # $@ commands # chroot $CHROOT_DIR "$@" # ;; # # anything else - install package *) #get_pkg_info $p #[ -z "$PKG" ] && echo Cannot find ${p}. && continue #download_pkg || { echo Download $p failed. && exit 1; } #install_pkg "$2" || { echo Installation of $p failed. && exit 1; } remove_builtin_pkg "$p" ;; esac done < "$pkglist" #< $pkglist #exec 15>&- #rm /tmp/deb-build/fd_14 return 0 } function remove_builtin_pkg() { PKG="$1" local NO_PKG=false if [ -z "$PKG" ] ; then return 1 fi if [ ! -f $D/$PKG ] ; then echo "$PKG does not exist.." >&2 #return 1 #TODO: we need alternative to "return 1" here NO_PKG=true else echo "Removing $PKG" if grep -q '\.desktop$' ${D}/${PKG}; then [ "$REMOVE_BUILTIN_fixmenus" = yes ] && FIXMENU='yes' #101222 fi ( while read file do rm "$CHROOT_DIR$file" 1>&2 echo "${file%/*}" >&2 #get dir done < $D/$PKG ) > /tmp/remove_builtin_dirs$$ #-- remove empty directories sort -ur /tmp/remove_builtin_dirs$$ | \ while read dir do while [ 1 ] ; do rmdir "$dir" 2>/dev/null dir=${dir%/*} #dirname $dir if [ -z "$dir" ] ; then break fi done done #-- fi PKGFILES="$D/$PKG" if [ "$CHROOT_UPDATES" = yes ] && [ "$NO_PKG" = false ]; then if [ "`grep '/usr/share/glib-2.0/schemas' $PKGFILES`" != "" ];then [ -e /usr/bin/glib-compile-schemas ] && glib-compile-schemas /usr/share/glib-2.0/schemas fi if [ "`grep '/usr/lib/gio/modules' $PKGFILES`" != "" ];then [ -e /usr/bin/gio-querymodules ] && gio-querymodules /usr/lib/gio/modules fi if [ "`grep ''\.desktop$'' $PKGFILES`" != "" ];then rm -f "$CHROOT_DIR/usr/share/applications/mimeinfo.cache" [ -e /usr/bin/update-desktop-database ] && update-desktop-database /usr/share/applications fi if [ "`grep '/usr/share/mime' $PKGFILES`" != "" ];then [ -e /usr/bin/update-mime-database ] && update-mime-database /usr/share/mime fi if [ "`grep '/usr/share/icons/hicolor' $PKGFILES`" != "" ];then [ -e /usr/bin/gtk-update-icon-cache ] && gtk-update-icon-cache /usr/share/icons/hicolor fi if [ "`grep '/usr/lib/gdk-pixbuf' $PKGFILES`" != "" ];then gdk-pixbuf-query-loaders --update-cache fi if [ "`grep '/usr/lib/gconv' $PKGFILES`" != "" ];then iconvconfig fi if [ "`grep '/usr/lib/pango' $PKGFILES`" != "" ];then pango-querymodules --update-cache fi for gtkver in '1.0' '2.0' '3.0' do if [ "`grep "/usr/lib/gtk-$gtkver" $PKGFILES | grep "/immodules"`" != "" ];then [ -e /usr/bin/gtk-query-immodules-$gtkver ] && gtk-query-immodules-$gtkver --update-cache fi done if [ "`grep '/usr/share/fonts' $PKGFILES`" != "" ];then fc-cache -f fi KERNVER="$(uname -r)" if [ "`grep "/lib/modules/$KERNVER" $PKGFILES`" != "" ];then depmod -a fi fi [ -f $D/$PKG ] && rm $D/$PKG [ "$NO_PKG" = false ] && rm /tmp/remove_builtin_dirs$$ sed -i "\%|${PKG}|%d" "$CHROOT_DIR/root/.packages/woof-installed-packages" line="$(cat "$CHROOT_DIR/root/.packages/DISTRO_PKGS_SPECS" | grep "^yes|${PKG}|")" pkgs_str=$(echo $line | cut -d'|' -f3) pkgs=(${pkgs_str//,/" "}) for a_pkg in "${pkgs[@]}"; do sed -i "\%|${a_pkg}|%d" "$CHROOT_DIR/root/.packages/woof-installed-packages" done return 0 } fix_menus() { if [ "$FIXMENU" = "yes" ];then #101222 fixmenus if [ "$DISPLAY" ] ; then if [ "`pidof jwm`" != "" ] ; then jwm -reload || jwm -restart sleep 1 fi fi fi } #=========================================================== # COMMAND LINE #============================================================ case $1 in -l|-list|--list) ls -1 $D exit ;; --pkg-list) shift process_remove_builtin_list "$@" exit ;; esac if [ "$1" ] ; then for i in $@ do remove_builtin_pkg $i done [ "$REMOVE_BUILTIN_fixmenus" = yes ] && fix_menus exit $? fi #=========================================================== # GUI #============================================================ if [ REMOVE_BUILTIN_use_gui = yes ]; then PKGS=`ls -1 $D` DIALOG="dialog --aspect 10" MENUOPT="--checklist" REP=/tmp/$(basename $0).txt if [ "$DISPLAY" ] ; then DIALOG=Xdialog fi for i in $PKGS ; do CHOICES="$CHOICES $i . off" done PKG=`$DIALOG --stdout --backtitle "${MSG1}" --title "$(gettext 'Remove builtin packages')" --help "$(gettext "In all modes of running Puppy, other than a full hard-drive installation,\n all of the Puppy files are in a compressed read-only file named 'puppy.sfs'\n or 'wary_500.sfs' (or some similar name). So you can't actually delete these\n files. However, if you want to remaster the live-CD to create your own custom\n Puppy (see Setup menu), you can use this little program to 'pretend' to delete\n them -- and they will really be gone in the remastered CD. So, for example if\n you remove SeaMonkey, it will be gone in the remastered CD thus reducing the\n size of the .iso live-CD file.\n\n Technical note: the lists of builtin files is at /root/.packages/builtin_files,\n the list of builtin pkgs is in /root/.packages/woof-installed-packages.")" \ $MENUOPT "$(gettext 'Select packages to remove (be careful):')" 0 0 0 $CHOICES` if [ ! "$PKG" ];then exit fi PKG=$(echo "$PKG" | sed 's%/% %g') /usr/lib/gtkdialog/box_yesno --warning "Remove builtin pkg(s)" \ "Please confirm that you want to delete the following pkg(s):" "" \ "<b>$PKG</b>" "" "This can be a dangerous operation if you don't know what you're doing. However some more confirmation dialogs may appear..." if [ $? -ne 0 ] ; then exit fi #-- REMOVED_PKGS='' #-- for i in $PKG do DEP_OF=`grep "+${i}" "$CHROOT_DIR/root/.packages/woof-installed-packages" |cut -d "|" -f 2 |tr "\n" " "` if [ "$DEP_OF" ] ; then DESCR="`grep "|${i}|" "$CHROOT_DIR/root/.packages/woof-installed-packages" |cut -d "|" -f 10`" Xdialog --left --screen-center --backtitle "$(gettext 'Confirm that you want to delete') '${i}'" --title "$(gettext 'Remove builtin packages')" --ok-label "$Yes_lbl" --cancel-label "$No_lbl" --yesno "$(gettext 'Description of package:')\n ${DESCR}\n $(gettext 'For information only, these are dependencies of') '${i}':\n `grep "|${i}|" "$CHROOT_DIR/root/.packages/woof-installed-packages" |cut -d "|" -f 9 | sed -e 's%^+%%' -e 's%,+% %g'` \n `eval_gettext \"Warning, removing '\\\${i}' _may_ break the following packages:\"` $DEP_OF \n $(gettext 'Continue?')" 0 0 if ! [ $? -eq 0 ];then continue fi fi remove_builtin_pkg $i || continue REMOVED_PKGS="$REMOVED_PKGS $i" done fi [ "$REMOVE_BUILTIN_fixmenus" = yes ] && fix_menus if [ "$REMOVE_BUILTIN_use_gui" = yes ]; then if [ "${REMOVED_PKGS}" ] ; then /usr/lib/gtkdialog/box_ok "Remove builtin pkg(s)" info \ "The following packages were removed:" "" "<b>${REMOVED_PKGS}</b>" fi fi ### END ###
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
⭐⭐ Crypto Swap Glitch ✅ Easy money ⭐⭐
JavaScript | 5 min ago | 0.67 KB
⭐⭐ Free Crypto Method ⭐⭐ ✅
JavaScript | 15 min ago | 0.67 KB
Nano_button_led_hc05
C++ | 23 min ago | 1.50 KB
Infinite Money Glitch
JavaScript | 25 min ago | 0.67 KB
🔥🔥🔥 Swapzone Trading Glitch 🔥🔥🔥
JavaScript | 35 min ago | 0.67 KB
⭐⭐ Instant Money Method ⭐⭐ ✅
JavaScript | 46 min ago | 0.67 KB
⭐⭐ FREE BTC GUIDE ✅ Working ⭐⭐
JavaScript | 56 min ago | 0.67 KB
VanillaAmmoCraftsRecipes.json
JSON | 59 min ago | 78.72 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!