Browse Source

bug fixes/enhancements

Eeems 11 years ago
parent
commit
17c9b0ec23

+ 2 - 6
bin/package-add

@@ -9,10 +9,6 @@ if [[ "$1" != "" ]];then
 	else
 		mkdir -p src/$1/source;
 	fi;
-	if [[ ! -f src/$1/build.sh ]];then
-		cp etc/build.sh.in src/$1/build.sh
-	fi;
-	chmod +x src/$1/build.sh
 	echo -e "Type:\n (1) script\n (2) git\n (3) svn";
 	while [[ ! $btype =~ ^1|2|3$ ]]; do
 		read btype;
@@ -33,10 +29,10 @@ if [[ "$1" != "" ]];then
 		cp etc/PKGBUILD.in src/$1/PKGBUILD;
 		case $btype in
 			git)
-				echo -e "pkgver=0.0.0\npkgver() {\n\tcd \"$srcdir/../source\"\n\tif git describe --tags > /dev/null 2>&1;then\n\t\tgit describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g';\n\telse\n\t\tdate +%Y%m%d;\n\tfi;}"|cat - src/$1/PKGBUILD > /tmp/out && mv /tmp/out src/$1/PKGBUILD;
+				echo -e "pkgver=0.0.0\npkgver() {\n\tcd \"${srcdir%/*}/source\"\n\tif git describe --tags > /dev/null 2>&1;then\n\t\tgit describe --long | sed -E 's/([^-]*-g)/r\1/;s/-/./g';\n\telse\n\t\tdate +%Y%m%d;\n\tfi;}"|cat - src/$1/PKGBUILD > /tmp/out && mv /tmp/out src/$1/PKGBUILD;
 			;;
 			svn)
-				echo -e "pkgver=0.0.0\npkgver() {\n\tcd \"$srcdir/../source\"\n\tlocal ver="$(svnversion)"\n\tprintf \"r%s\" \"${ver//[[:alpha:]]}\"\n}"|cat - src/$1/PKGBUILD > /tmp/out && mv /tmp/out src/$1/PKGBUILD;
+				echo -e "pkgver=0.0.0\npkgver() {\n\tcd \"${srcdir%/*}/source\"\n\tlocal ver="$(svnversion)"\n\tprintf \"r%s\" \"${ver//[[:alpha:]]}\"\n}"|cat - src/$1/PKGBUILD > /tmp/out && mv /tmp/out src/$1/PKGBUILD;
 			;;
 			script)
 				echo -e "pkgver=0.0.0\npkgver() {\n  date +%Y%m%d\n}"|cat - src/$1/PKGBUILD > /tmp/out && mv /tmp/out src/$1/PKGBUILD;

+ 16 - 15
bin/repo-build

@@ -8,7 +8,7 @@ root="$(readlink -f $(dirname $BASH_SOURCE)/..)";
 . $root/etc/repo.conf
 . $root/etc/packages.conf
 rm -f $root/repo/latest/i686/*.pkg.tar.xz;
-rm -f $root/repo/latest/x86-64/*.pkg.tar.xz;
+rm -f $root/repo/latest/x86_64/*.pkg.tar.xz;
 for val in "${packages[@]}"; do
 	unset package;
 	declare -A package;
@@ -74,22 +74,23 @@ for val in "${packages[@]}"; do
 		echo -e "\tUp to Date";
 	fi;
 	cd $root/src/$name;
-	if ! ls $name-*-i686.pkg.tar.xz &> /dev/null || ! ls $name-*-x86-64.pkg.tar.xz &> /dev/null ||  $build || $override;then
+	if [ $(ls -1 $name-*-i686.pkg.tar.xz 2> /dev/null | wc -l) == 0 ] || [ $(ls -1 $name-*-x86-64.pkg.tar.xz 2> /dev/null | wc -l) == 0 ] || $build || $override;then
 		echo -e "\tBuilding";
-		./build.sh
-		ls $name-*-i686.pkg.tar.xz | while read item; do
-			cp $item $root/repo/updates/i686/$item;
-		done;
-		ls $name-*-x86-64.pkg.tar.xz | while read item; do
-			cp $item $root/repo/updates/x86-64/$item;
-		done;
+		if $build || $override;then
+			rm -f $name-*-i686.pkg.tar.xz $name-*-x86_64.pkg.tar.xz;
+		fi;
+		cd $root/src/$name/source;
+		tar -zcvf $root/src/$name/$name.tar.gz *;
+		cd $root/src/$name;
+		updpkgsums;
+		makepkg -c -f --config $root/etc/makepkg-i686.conf;
+		makepkg -c -f --config $root/etc/makepkg-x86_64.conf;
+		echo -e "\tBuilt.";
+		cp $name-*-i686.pkg.tar.xz $root/repo/updates/i686;
+		cp $name-*-x86-64.pkg.tar.xz $root/repo/updates/x86_64;
 	fi;
-	ls $name-*-i686.pkg.tar.xz | while read item; do
-		cp $item $root/repo/latest/i686/$item;
-	done;
-	ls $name-*-x86-64.pkg.tar.xz | while read item; do
-		cp $item $root/repo/latest/x86-64/$item;
-	done;
+	cp $name-*-i686.pkg.tar.xz $root/repo/latest/i686;
+	cp $name-*-x86-64.pkg.tar.xz $root/repo/latest/x86_64;
 	echo -e "\tDone"
 done;
 echo "Building Repository";

+ 1 - 1
bin/repo-update

@@ -84,7 +84,7 @@ for val in "${sites[@]}"; do
 		esac;
 	fi;
 done;
-if ! force; then
+if ! $force; then
 	ls -l $root/repo/updates/ | egrep '^d' | awk '{print $9}' | while read arch; do
 		rm -f $root/repo/updates/$arch/*.pkg.tar.xz;
 	done;

+ 1 - 1
configure.sh

@@ -1,5 +1,5 @@
 #!/bin/bash
-commands=('expect' 'ssh' 'scp' 'ftp' 'rsync' 'makepkg' 'make' 'git' 'gcc' 'g++');
+commands=('expect' 'ssh' 'scp' 'ftp' 'rsync' 'makepkg' 'make' 'git' 'gcc' 'g++' 'repo-add_and_sign');
 installed(){
 	echo -n -e "Checking for $1...";
 	command -v $1 >/dev/null 2>&1 || {

+ 0 - 13
etc/build.sh.in

@@ -1,13 +0,0 @@
-#!/bin/bash
-name=$(basename $(pwd));
-pwd=$(pwd);
-pushd $pwd;
-cd source;
-tar -zcvf $pwd/$name.tar.gz *;
-popd;
-updpkgsums;
-makepkg -f --config $pwd/../../etc/makepkg-i686.conf;
-makepkg -c;
-makepkg -f --config $pwd/../../etc/makepkg-x86-64.conf;
-makepkg -c;
-echo -e "\tBuilt.";

+ 0 - 0
etc/makepkg-x86-64.conf → etc/makepkg-x86_64.conf


+ 0 - 0
repo/latest/x86-64/.gitignore → repo/latest/x86_64/.gitignore


+ 0 - 0
repo/updates/x86-64/.gitignore → repo/updates/x86_64/.gitignore


+ 4 - 4
skel/index.php

@@ -1,14 +1,14 @@
 <?php
 	echo file_get_contents('templates/header.template');
-	$db = scandir('phar://'.getcwd().'/x86-64/omni.db');
+	$db = scandir('phar://'.getcwd().'/x86_64/omni.db');
 	$dir1 = scandir(getcwd().'/i686');
-	$dir2 = scandir(getcwd().'/x86-64');
+	$dir2 = scandir(getcwd().'/x86_64');
 	foreach($db as $file) {
-		$desc = file_get_contents('phar://'.getcwd().'/x86-64/omni.db/'.$file.'/desc');
+		$desc = file_get_contents('phar://'.getcwd().'/x86_64/omni.db/'.$file.'/desc');
 		$desc = substr($desc,strrpos($desc,'%DESC%')+7,strlen($desc)-strrpos($desc,'%DESC%')-(strlen($desc)-strpos($desc,'%CSIZE%'))-7);
 		echo "<h2>$file</h2><p><h4>{$desc}</h4> :: Downloads<br/>";
 		echo " => <a href='i686/$file-i686.pkg.tar.xz'>i686</a><br/>";
-		echo " => <a href='x86-64/$file-x86-64.pkg.tar.xz'>x86-64</a><br/>";
+		echo " => <a href='x86_64/$file-x86-64.pkg.tar.xz'>x86-64</a><br/>";
 		echo "</p>";
 	}
 	echo file_get_contents('templates/footer.template');

+ 0 - 0
skel/x86-64/.gitignore → skel/x86_64/.gitignore