summarylogtreecommitdiffstats
path: root/updater.pl
blob: 1dc84d30d94568834b1ed86cab3dc6d7504b55fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#! /usr/bin/perl -w

################################################################################
# Replacement updater script for AUR package
################################################################################
use strict;
use Getopt::Long;

my $installer = "";

GetOptions("installer=s" => \$installer);

unless ($installer =~ /(Atelier_Photo_Fnac|Mon_LIVRE_PHOTO_CEWE)/){
	print "\033[1;31mNo AUR package available for this update ('$installer').\033[0m"
}else{

	my $pkgName = $1 eq 'Atelier_Photo_Fnac' ? 'cewe-monlivrephoto-fnac';

	chdir('/tmp');
	system("wget https://aur.archlinux.org/cgit/aur.git/snapshot/$pkgName.tar.gz -O $pkgName.tar.gz");
	system("tar -xvf $pkgName.tar.gz");

	chdir($pkgName);
	system("mv '$installer' ./");
	system('_UPDATING=1 makepkg --install --clean --skipchecksums');
}

print "\nNow you can close this window\n";
my $input = <STDIN>;