diff options
author | Joseph DiGiovanni | 2023-12-02 13:30:32 -0500 |
---|---|---|
committer | Joseph DiGiovanni | 2023-12-02 13:30:32 -0500 |
commit | a8024ec3c1588b65002a3ee1dc9ee2b942433cdf (patch) | |
tree | 10e9816064d7736454d3213546235f54db3feb7a | |
parent | 7ee1ae4939517e97a3ec5d7e714b7af08ef8f5da (diff) | |
download | aur-a8024ec3c1588b65002a3ee1dc9ee2b942433cdf.tar.gz |
Change source to github
-rw-r--r-- | .SRCINFO | 6 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rwxr-xr-x | pacdate.sh | 87 |
3 files changed, 9 insertions, 95 deletions
@@ -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 @@ -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 |