Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
#!/bin/bash set -x # ppa2pup # convert an Ubuntu PPA repo file, into a Puppy compatible repo file. TMPDIR=/tmp/pkg/${whoami} # @TODO1 - fix last few fields of package entries (should contain the supported ubuntu distro, not current system) if [ -z "$PGP_VERIFY_CMD" ]; then if [ ! -z `which gpgv` ]; then PGP_VERIFY_CMD="$(which gpgv)" elif [ ! -z `which gpg` ]; then PGP_VERIFY_CMD="$(which gpg) --verify" else echo "ppa2pup: No pgp verify command" 1>&2 fi fi . /etc/DISTRO_SPECS if [ -d ~/.packages/repo ]; then REPO_DIR=`realpath ~/.packages/repo` || \ REPO_DIR=`readlink ~/.packages/repo` || \ REPO_DIR=~/.packages/repo elif [ -d /var/packages/repo ]; then REPO_DIR=/var/packages/repo else REPO_DIR=~/.packages fi #if [ "$DISTRO_BINARY_COMPAT" != "ubuntu" ] && [ "$DISTRO_BINARY_COMPAT" != "debian" ];then # echo "Sorry, you must be running a .deb compatible Puppy Linux" # echo "to use this tool. Your Puppy is based on '$DISTRO_BINARY_COMPAT'" # exit 1 #fi function get_distro(){ local a_repo_url=$1 local a_distro_ver=$2 local a_stream=$3 cat /root/.pkg/sources-all | awk -v VER="$a_distro_ve" -v STREAM="$a_stream" URL="a_repo_url" \ 'AWK_PRG="BEGIN{FS=\"|\"} { if ( (index($4,URL) >0 ) and ( index($3, VER "-" STREAM) > 0 ) ) { patsplit($3, array , "-" ) print array[2] } }' } if [ ! "$1" ] || [ "$1" = "-h" ] || [ "$1" = "-help" ] then echo "This script creates a Puppy-compatible repo file from a PPA or Debian repo." echo echo "For Launchpad PPA repos:" echo echo " Usage: ppa2pup ppa:<user>/<repo> [debian|ubuntu] [bionic|stretch|artful|etc] [main|all|contrib|non-free|etc]" echo echo "Examples:" echo echo " ppa2pup ppa:team-xbmc/ppa" echo echo " ppa2pup ppa:team-xbmc/ppa ubuntu bionic" echo echo " ppa2pup ppa:team-xbmc/ppa ubuntu artful" echo echo " ppa2pup ppa:team-xbmc/ppa debian stretch" echo echo echo "For other third-party Debian repos:" echo echo " Usage: ppa2pup http://site.com/[debian|ubuntu]/ [stretch|bionic|etc] [main|contrib|non-free|etc]" echo echo "Examples:" echo echo " ppa2pup http://rpms.litespeedtech.com/debian/" echo echo " ppa2pup http://rpms.litespeedtech.com/debian/ stretch main" echo echo " ppa2pup http://repo.steampowered.com/steam/ precise steam" echo echo " ppa2pup http://http.kali.org/kali/ kali-bleeding-edge main contrib non-free" echo echo "NOTE: Any ommitted distro names or versions will be guessed." echo exit 1 fi RELEASE_DIR=/tmp/ppa_release # create a dir to work in #mkdir -p /tmp/ppa_pkgs mkdir -p "$RELEASE_DIR" # remove any old files #rm /tmp/ppa_pkgs/* 2>/dev/null #rm -rf "$RELEASE_DIR"/* 2>/dev/null # we need to find the correct Packages.gz for the distro (debian/ubuntu), # distro version (stretch/bionic/etc), and architecture (i386/amd64) if [ -z "$SOURCES_LIST_OPT__arch" ]; then arch='i386' case $(uname -m) in i*86) arch='i386' ;; *64) arch='amd64' ;; esac else arch="$SOURCES_LIST_OPT__arch" fi if [[ "$1" =~ 'ppa:' ]] then repo_type=ppa # we got a 'PPA' URL, lets parse it and get the Packages.gz ppaname="${1/*\//}" username="${1/\/*/}" username="${username//ppa:/}" ppaname="${ppaname//ppa:/}" # get username, but strip special chars PPA_NAME="${username//[-_:]/}" distro=${2:-$DISTRO_BINARY_COMPAT} distro_ver=${3:-$DISTRO_COMPAT_VERSION} #repo_name="$distro_ver-$PPA_NAME" #repo_filename="Packages-$distro-$distro_ver-${PPA_NAME}" repo_stream=${4:-main} #repo_stream2='' #repo_stream3='' #repo_stream4='' #[ "$5" != '' ] && repo_stream2=${5} #[ "$6" != '' ] && repo_stream3=${6} #[ "$7" != '' ] && repo_stream4=${7} repo_streams=( $repo_stream ${@:5} ) URL=http://ppa.launchpad.net/${username}/${ppaname}/${distro}/dists/${distro_ver}/${repo_stream}/binary-${arch}/Packages.gz repo_url=http://ppa.launchpad.net/${username}/${ppaname}/${distro}/ elif [[ "$1" =~ 'http://' ]] || [[ "$1" =~ 'https://' ]];then repo_type=debian # we got a Debian repo source URL, lets parse it and get the Packages.gz distro_ver=${2:-$DISTRO_COMPAT_VERSION} repo_url=$(echo $1 | sed -e 's#/$##g')/ repo_stream=${3:-main} distro="$(get_distro $repo_url $distro_ver $repo_stream)" distro=${distro:-$DISTRO_BINARY_COMPAT} #repo_stream2='' #repo_stream3='' #repo_stream4='' #[ "$4" != '' ] && repo_stream2=${4} #[ "$5" != '' ] && repo_stream3=${5} #[ "$6" != '' ] && repo_stream4=${6} repo_streams=( $repo_stream ${@:5} ) URL=$(echo $1 | sed -e 's#/$##g')/dists/${distro_ver}/${repo_stream}/binary-${arch}/Packages.gz ARCH_PATH="/binary-${arch}/Packages.gz" else # didnt get ppa:foo/bar, exit with usage $0 -h exit 1 fi function set_names(){ # if we didn't get the name from the ppa:foo/bar style URL if [[ ! "$1" =~ 'ppa:' ]] then # check if this repo is already installed (find its name in Pkg sources files) if [ -z "$repo_url" ]; then PPA_NAME="$(grep -m1 "^${distro_ver}-${stream:-main}|" /root/.pkg/sources-all | cut -f1 -d'|' 2>/dev/null)" else PPA_NAME="$(grep "^${distro_ver}-${stream:-main}|" /root/.pkg/sources-all | grep -m1 "$repo_url" | cut -f1 -d'|' 2>/dev/null)" if [ -z "$PPA_NAME" ]; then PPA_NAME="$(grep "^${distro_ver}-${stream:-main}-" /root/.pkg/sources-all | grep -m1 "$repo_url" | cut -f1 -d'|' 2>/dev/null)" fi fi # get repo name and filename if [ "$PPA_NAME" = "" ];then echo read -e -p "Enter a repo name, such as '${distro_ver}-${stream:-main}': " -i "${distro_ver}-${stream:-main}" PPA_NAME fi # replace any spaces or underscores with dashes, all lower case PPA_NAME="$( echo "${PPA_NAME// /-}" | tr '_' '-' | tr '[:upper:]' '[:lower:]' )" repo_name="$PPA_NAME" distro="$(get_distro $repo_url $distro_ver $repo_stream)" distro=${distro:$-DISTRO_BINARY_COMPAT} repo_filename="Packages-$distro-${PPA_NAME}" fi } #set_names $1 PACKAGES_GZ="ppa_Packages.gz" PACKAGES_GZ_PATH="$RELEASE_DIR/$PACKAGES_GZ" PACKAGES_PATH="$RELEASE_DIR/${PACKAGES_GZ%.*}" #Remove extension for stream in ${repo_streams[@]} #$repo_stream $repo_stream2 $repo_stream3 $repo_stream4 do if [ repo_type=debian ]; then distro="$(get_distro $repo_url $distro_ver $stream)" distro="$(get_distro $repo_url $distro_ver $repo_stream)" fi set_names $1 [ "$stream" = '' ] && continue rm /"$PACKAGES_PATH" "$PACKAGES_GZ_PATH" 2>/dev/null download_failed=false download_url=${URL//$repo_stream/$stream} wget --quiet $download_url -O "$PACKAGES_GZ_PATH" 1>/dev/null \ || download_failed=true if [ ! -f "$PACKAGES_GZ_PATH" ] || [ $download_failed = true ];then echo echo "ERROR: the PPA repo '$repo_name' not found for $distro $distro_ver:" echo echo " $download_url" echo echo "You could try a different version of the repo." echo $0 -h exit 1 fi gunzip "$PACKAGES_GZ_PATH" # if Packages file is empty, dont create a repo for it if [ -z "$PACKAGES_PATH" ] || [ ! -s "$PACKAGES_PATH" ];then continue fi if [ ! -z "$SOURCES_LIST_OPT__signed_by" ]; then meta_url=${download_url//$ARCH_PATH/} "$RELEASE_DIR" mkdir -p "$RELEASE_DIR/$repo_name" rm -f "$RELEASE_DIR/$repo_name/*" 2>/dev/null meta_download_failed=false wget --quiet "${meta_url}/Release" -O "$RELEASE_DIR/$repo_name/Release" 1>/dev/null && \ wget --quiet"${meta_url}/Release.gpg" -O "$RELEASE_DIR/$repo_name/Release.gpg" 1>/dev/null || \ meta_download_failed=true if [ "$meta_download_failed" = false ]; then if ( cd $RELEASE_DIR/$repo_name; $PGP_VERIFY_CMD --keyring "$SOURCES_LIST_OPT__signed_by" Release.pgp Release; ); then pgp_verified=maybe ReleaseFile="$RELEASE_DIR/$repo_name/InRelease" else pgp_verified=false fi else meta_download_failed=false wget --quiet "${meta_url}/InRelease" -O "$RELEASE_DIR/$repo_name/InRelease" 1>/dev/null \ || meta_download_failed=true if [ "$meta_download_failed" = false ]; then if ( cd $RELEASE_DIR/$repo_name; $PGP_VERIFY_CMD --keyring "$SOURCES_LIST_OPT__signed_by" InRelease ); then pgp_verified=maybe ReleaseFile="$RELEASE_DIR/$repo_name/InRelease" else pgp_verified=false fi fi fi if [ "$pgp_verified" = false ]; then if [ ! -z "$SOURCES_LIST_OPT__Trusted" ] && [ "$SOURCES_LIST_OPT__Trusted" = yes ]; then FAIL_CLASS=WARNING else FAIL_CLASS=ERROR fi echo echo "$FAIL_CLASS: could not verify pgp signature of Release/InRelease file" echo echo " ${meta_url}" if [ ! "$SOURCES_LIST_OPT__Trusted" ]; then #Maybe should exit if this exit 1 fi fi if [ ! -z "$ReleaseFile" ]; then if [ SOURCES_LIST_OPT__Allow_Insecure = yes ]; then hash_function=( sha256sum md5sum sha1sum none ) elif [ "$SOURCES_LIST_OPT__allow_weak" = yes ]; then hash_function=( sha256sum md5sum sha1sum ) else hash_function=( sha256sum ) fi for a_hash_fn in "${hash_function[@]}"; do case "$a_hash_fn" in sha256sum) fsum="$(sha256sum "$file_path" | cut -f1 -d' ')" if [ $(grep -m -c "$fsum" "$ReleaseFile" ) -gt 0 ]; then break fi ;; md5sum) fsum="$(md5sum "$file_path" | cut -f1 -d' ')" if [ $(grep -m -c "$fsum" "$ReleaseFile" ) -gt 0 ]; then echo "WARNING: weak checksum for $repo_name" break fi ;; sha1sum) fsum="$(sha1sum "$file_path" | cut -f1 -d' ')" if [ $(grep -m -c "$fsum" "$ReleaseFile" ) -gt 0 ]; then echo "WARNING: weak checksum for $repo_name" break fi ;; none) fsum="$(md5sum "$file_path" | cut -f1 -d' ')" echo "WARNING: repo metadata unverified" break ;; esac done fi fi echo echo "Found URL:" echo echo " $download_url" echo echo "Repo to create:" echo " $repo_name" echo echo "Repo file to create:" echo " $REPO_DIR/$repo_filename" echo rm /tmp/$repo_filename $REPO_DIR/$repo_filename &>/dev/null #---------------New AWK Version------------------------------------------- cat "$PACKAGES_PATH" | awk -v PKGOS="$distro" -v PKGOSVER="$distro_ver" -v REPOFNM="$repo_filename" \ 'function fixdepends(s, a,p,sout) { split(s,a,",") for (p in a) { gsub(/[ \t]*\(.*\)|[ \t]\|.*|:any/,"",a[p]) sout = sout "," a[p] } sub(/^,/,"",sout) ; return sout; } /^Package:/ { sub(/^Package: /,""); PKG=$0; } /^Version:/ { sub(/^Version: /,""); PKGVER=$0; } /^Filename:/ { sub(/^Filename: /,""); PKGPATH=$0; sub(/\/[^\/]*$/,"",PKGPATH); sub(/.*\//,""); PKGFILE=$0; } /^Priority:/ { sub(/^Priority: /,""); PKGPRIO=$0; } /^Section:/ { sub(/^Section: /,""); PKGSECTION=$0; } /^Installed-Size:/ { sub(/^Installed-Size: /,""); PKGSIZE=$0; } /^MD5sum:/ { sub(/^MD5sum: /,""); PKGMD5=$0; } /^SHA1:/ { sub(/^SHA1: /,""); SHA1=$0; } /^SHA256:/ { sub(/^SHA256: /,""); SHA256=$0; } /^Depends:/ { sub(/^Depends: /,""); PKGDEP=fixdepends($0) "," PKGDEP; } /^Pre-Depends:/ { sub(/^Pre-Depends: /,""); PKGDEP=fixdepends($0) "," PKGDEP; } /^Description:/ { sub(/^Description: /,""); PKGINFO=substr($0,1,200); } /^$/ { print PKG "_" PKGVER "|" PKG "|" PKGVER "||" PKGSECTION "|" PKGSIZE "|" PKGPATH "|" PKGFILE "|" PKGDEP "|" PKGINFO "|" PKGOS "|" PKGOSVER "|" PKGMD5 "|" SHA1 "|" SHA256 "|" PKGPRIO "|" REPOFNM ; PKG=""; PKGVER=""; PKGSECTION=""; PKGSIZE=""; PKGFILE=""; PKGPATH=""; PKGDEP=""; PKGINFO=""; PKGPRIO=""; PKGMD5=""; SHA1=""; SHA256=""; PKGDEP=""; } ' > /tmp/$repo_filename # sort & move the repo file sort -u /tmp/$repo_filename > /tmp/${repo_filename}_sorted 2>/dev/null if [ ! -f /tmp/${repo_filename}_sorted ];then echo "Error: Repo file not created!" exit 1 fi #mv /tmp/${repo_filename}_sorted $REPO_DIR/$repo_filename #set -x cut -d'|' -f1-12 /tmp/${repo_filename}_sorted > $REPO_DIR/$repo_filename [ -z "$PKGS_DIR" ] && export PKGS_DIR="$(realpath "${HOME}/.packages")" [ -z "$HASHES_DIR" ] && export HASHES_DIR="$PKGS_DIR/hashes" && mkdir -p "$HASHES_DIR" cut -d'|' -f1,2,7,8,13 /tmp/${repo_filename}_sorted > "$HASHES_DIR/${repo_filename//Packages/PKG_SUMS}" cut -d'|' -f1,2,7,8,13,14,15 /tmp/${repo_filename}_sorted | sort -d -k 4 > /tmp/${repo_filename}_sorted_md5 awk -F '|' '{print $5 "|" $3 "|" $4}' /tmp/${repo_filename}_sorted_md5 > "$HASHES_DIR/${repo_filename//Packages/MD5}" #cut -d'|' -f4,5 /tmp/${repo_filename}_sorted_md5 > "$HASHES_DIR/${repo_filename//Packages/SHA1}" cut -d'|' -f4,7 /tmp/${repo_filename}_sorted_md5 > "$HASHES_DIR/${repo_filename//Packages/SHA256}" #set +x echo "Success! File created." echo fallback_repos="$(pkg repo-list | grep -v $repo_name | tr '\n' ' ')" repo_entry="$repo_name|deb|$repo_filename|$repo_url||||$fallback_repos" # if already added to ~/.pkg/sources[-all], remove it if [ "$(cat ~/.pkg/sources | grep -m1 "^$repo_name|")" != "" ] || \ [ "$(cat ~/.pkg/sources-all | grep -m1 "^$repo_name|")" != "" ]; then cat ~/.pkg/sources | grep -v "^$repo_name|" > /tmp/pkgsources cat ~/.pkg/sources-all | grep -v "^$repo_name|" > /tmp/pkgsources-all mv /tmp/pkgsources ~/.pkg/sources mv /tmp/pkgsources-all ~/.pkg/sources-all fi # add repo entry to ~/.pkg/sources pkg add-source "$repo_entry" echo # refresh list of available repos pkg update-sources echo echo "Repo info:" pkg repo-info $repo_name echo if [ "$(cat ~/.pkg/sources | grep -m1 "^$repo_name|")" != "" ];then echo "Success! Repo added and available to use." echo echo "To use this repo, simply type the following and hit ENTER:" echo " pkg repo $repo_name" echo fi done exit 0
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
✅✅ Earn 18,000$ Monthly Leaked Guide
JavaScript | 14 sec ago | 0.67 KB
⭐⭐ Crypto Swap Glitch ✅ Easy money ⭐⭐
JavaScript | 10 min ago | 0.67 KB
⭐⭐ Free Crypto Method ⭐⭐ ✅
JavaScript | 20 min ago | 0.67 KB
Nano_button_led_hc05
C++ | 28 min ago | 1.50 KB
Infinite Money Glitch
JavaScript | 30 min ago | 0.67 KB
🔥🔥🔥 Swapzone Trading Glitch 🔥🔥🔥
JavaScript | 41 min ago | 0.67 KB
⭐⭐ Instant Money Method ⭐⭐ ✅
JavaScript | 51 min ago | 0.67 KB
⭐⭐ FREE BTC GUIDE ✅ Working ⭐⭐
JavaScript | 1 hour ago | 0.67 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!