summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoseph DiGiovanni2023-12-02 13:30:32 -0500
committerJoseph DiGiovanni2023-12-02 13:30:32 -0500
commita8024ec3c1588b65002a3ee1dc9ee2b942433cdf (patch)
tree10e9816064d7736454d3213546235f54db3feb7a
parent7ee1ae4939517e97a3ec5d7e714b7af08ef8f5da (diff)
downloadaur-a8024ec3c1588b65002a3ee1dc9ee2b942433cdf.tar.gz
Change source to github
-rw-r--r--.SRCINFO6
-rw-r--r--PKGBUILD11
-rwxr-xr-xpacdate.sh87
3 files changed, 9 insertions, 95 deletions
diff --git a/.SRCINFO b/.SRCINFO
index f1b6478fe730..d7ad0f806c97 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,11 +1,11 @@
pkgbase = pacdate
pkgdesc = Automates downgrading packages to a specific date
pkgver = 1.0.0
- pkgrel = 1
+ pkgrel = 2
arch = any
license = none
depends = pacman
- source = pacdate.sh
- sha256sums = SKIP
+ source = https://github.com/Joseph-DiGiovanni/pacdate/archive/refs/tags/v1.0.0.tar.gz
+ sha256sums = 0c401b6bb6cc09f2334edfa554ded1449f8ef32691f6f642f75aa2754fc9e775
pkgname = pacdate
diff --git a/PKGBUILD b/PKGBUILD
index b6ce58e14144..1b297ee0e143 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -2,15 +2,16 @@
pkgname=pacdate
pkgver=1.0.0
-pkgrel=1
+pkgrel=2
pkgdesc='Automates downgrading packages to a specific date'
arch=('any')
-license=('none')
+license=('GPL3')
depends=('pacman')
-source=("pacdate.sh")
+source=("https://github.com/Joseph-DiGiovanni/pacdate/archive/refs/tags/v1.0.0.tar.gz")
-sha256sums=('SKIP')
+sha256sums=('0c401b6bb6cc09f2334edfa554ded1449f8ef32691f6f642f75aa2754fc9e775')
package() {
- install -Dm755 "pacdate.sh" "${pkgdir}/usr/bin/pacdate"
+ install -Dm755 "${srcdir}/${pkgname}-${pkgver}/pacdate.sh" "${pkgdir}/usr/bin/pacdate"
+ install -Dm644 "${srcdir}/${pkgname}-${pkgver}/LICENSE" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
}
diff --git a/pacdate.sh b/pacdate.sh
deleted file mode 100755
index df53be2e87c7..000000000000
--- a/pacdate.sh
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-
-PACDATE=""
-PACDATE_LIST=""
-PACDATE_DEPS=""
-
-# Function to display help/usage information
-function show_usage() {
- echo ""
- echo "Usage: $0 <YYYY/MM/DD> <package package2 ...>"
- echo ""
-}
-
-# Function to check the input date format is correct
-function is_valid_date_format() {
- local regex="^[0-9]{4}/(0[1-9]|1[0-2])/(0[1-9]|[1-2][0-9]|3[0-1])$"
-
- if [[ $1 =~ $regex ]]; then
- return 0
- else
- return 1
- fi
-}
-
-if ! is_valid_date_format "$1"; then
- echo "Date is invalid: $1"
-else
- PACDATE=$1
- PACDATE_LIST="${*:2}"
-fi
-
-if [ -z $PACDATE ]; then
- echo "No date option provided."
- show_usage
- exit 1
-fi
-
-echo "Packages will be updated to the archived version from $PACDATE."
-echo " "
-
-if [ -f /etc/pacman.d/mirrorlist.pacdate_backup ]; then
- echo "Mirrorlist already backed up."
-else
- echo "Backing up mirrorlist..."
- # Make backup of mirror list
- sudo mv /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.pacdate_backup
- # Create new mirror list
- sudo sh -c "echo 'Server=https://archive.archlinux.org/repos/$PACDATE/\$repo/os/\$arch' > /etc/pacman.d/mirrorlist"
- echo "Done."
-fi
-
-echo " "
-
-if [ -z "$PACDATE_LIST" ]; then
- # Update all
- sudo pacman -Syyuu
-else
- # Update selected packages
- sudo pacman -Syy $PACDATE_LIST
-
- # Create dependency list
- IFS=' ' read -ra PACKAGE_ARRAY <<< "$PACDATE_LIST"
- for CURRENT_PKG in "${PACKAGE_ARRAY[@]}"; do
- PACDATE_DEPS="$PACDATE_DEPS $(pacman -Qi $CURRENT_PKG|grep "Depends On"|cut -d: -f2|awk '{$1=$1};1'|tr -s ' '|tr -d '\n')"
- done
-
- if [ -n "$PACDATE_DEPS" ]; then
- # List dependencies
- echo " "
- echo "The downgraded packages have these dependencies:"
- echo $PACDATE_DEPS
- echo " "
- read -p "Do you want to downgrade these as well? (y/N) " choice
- if [[ "$choice" =~ ^[Yy]$ ]]; then
- $0 "$PACDATE" "$PACDATE_DEPS"
- fi
- fi
-fi
-
-if [ -f /etc/pacman.d/mirrorlist.pacdate_backup ]; then
- echo " "
- echo "Restoring mirrorlist from backup..."
- sudo cp /etc/pacman.d/mirrorlist.pacdate_backup /etc/pacman.d/mirrorlist
- sudo rm /etc/pacman.d/mirrorlist.pacdate_backup
- echo "Done."
-fi
-exit 0