aboutsummaryrefslogtreecommitdiff
path: root/cydia/repo.sh
diff options
context:
space:
mode:
authorDylan Bolger <dylanbolger@Dylans-MacBook-Air.local>2018-03-21 12:19:35 -0500
committerDylan Bolger <dylanbolger@Dylans-MacBook-Air.local>2018-03-21 12:19:35 -0500
commitd938a333c208c67c890a9e4888d4cbabcc2b1e87 (patch)
tree4276d32ddacfffb6fb749d29e7824e17ab35f50b /cydia/repo.sh
parent44a20c7d9ecd8737baac8606f89ae68b62e05594 (diff)
downloadpersonal-website-d938a333c208c67c890a9e4888d4cbabcc2b1e87.tar.xz
personal-website-d938a333c208c67c890a9e4888d4cbabcc2b1e87.zip
working on web
Diffstat (limited to 'cydia/repo.sh')
-rwxr-xr-xcydia/repo.sh53
1 files changed, 53 insertions, 0 deletions
diff --git a/cydia/repo.sh b/cydia/repo.sh
new file mode 100755
index 0000000..e757759
--- /dev/null
+++ b/cydia/repo.sh
@@ -0,0 +1,53 @@
+#!/bin/bash
+
+script_dir=$(dirname $0)
+cur=$(pwd)
+
+cd "$script_dir"
+if [ $# -eq 0 ]; then
+ echo "Usage: $0 <command>" >&2
+ exit 1
+fi
+
+if [ "$1" == "add" ]; then
+ if [ "$#" -ne 3 ]; then
+ echo "Usage: $0 add <package> <deb file>" >&2
+ exit 1
+ fi
+ echo "Adding new package...";
+
+ cp "$3" "$script_dir/debs/$2.deb"
+
+elif [ "$1" == "update" ]; then
+ echo "Updating packaging...";
+else
+ echo "Usage: $0 <command>" >&2
+ exit 1
+fi
+
+rm Packages.bz2
+rm Packages
+
+for deb in debs/*.deb
+do
+ echo "Processing $deb...";
+ dpkg-deb -f "$deb" >> Packages
+ md5sum "$deb" | echo "MD5sum: $(awk '{ print $1 }')" >> Packages
+ wc -c "$deb" | echo "Size: $(awk '{ print $1 }')" >> Packages
+ echo "Filename: $deb" >> Packages
+ dpkg-deb -f "$deb" Package | echo "Depiction: https://$(head -n 1 CNAME)/depictions/?p=$(xargs -0)" >> Packages
+ echo "" >> Packages
+done
+
+echo "" >> Packages; ## Add extra new line
+
+bzip2 < Packages > Packages.bz2
+gzip -9c < Packages > Packages.gz
+
+git add -A
+now=$(date +"%I:%M %m-%d-%Y")
+git commit -am "Packages Update - $now"
+git push
+
+echo "Updated Github repository with latest packages";
+cd "$cur" \ No newline at end of file