Browse Source

Enhancements to building. Config updates. More package commands

Nathaniel van Diepen 10 years ago
parent
commit
b7f0784e06
4 changed files with 78 additions and 1 deletions
  1. 18 0
      bin/package-info
  2. 55 0
      bin/package-mod
  3. 4 0
      bin/repo-build
  4. 1 1
      configure.sh

+ 18 - 0
bin/package-info

@@ -0,0 +1,18 @@
+#!/bin/bash
+root="$(readlink -f $(dirname $BASH_SOURCE)/..)";
+. $root/etc/packages.conf
+unset package;
+for val in "${packages[@]}"; do
+	unset p;
+	declare -A p;
+	eval "p=($val)";
+	if [[ "${p[name]}" == "$1" ]];then
+		echo "${p[name]}";
+		for i in "${!p[@]}";do
+			echo -e "\t$i: ${p[$i]}";
+		done;
+		exit 0;
+	fi;
+done;
+echo "Package $1 does not exist";
+exit 1;

+ 55 - 0
bin/package-mod

@@ -0,0 +1,55 @@
+#!/bin/bash
+root="$(readlink -f $(dirname $BASH_SOURCE)/..)";
+. $root/etc/packages.conf
+this="";
+package(){
+	for val in "${packages[@]}"; do
+		unset p;
+		declare -A p;
+		eval "p=($val)";
+		if [[ "${p[name]}" == "$1" ]];then
+			echo $val;
+		fi;
+	done;
+}
+save(){
+	local file="packages+=(\"";
+	for i in "${!this[@]}"; do
+		file="$file [$i]='${this[$i]}'";
+	done;
+	file="$file\")";
+	echo $file>$root/etc/packages.d/${this[name]};
+	exit 0;
+}
+case $1 in
+	ignore)
+		if [[ "$2" != "" ]];then
+			unset this;
+			declare -A this;
+			p=$(package $2);
+			eval "this=($p)";
+			if [[ $p != "" ]];then
+				this[ignore]="true";
+				echo ${this};
+				save;
+			fi;
+		fi;
+		echo "Usage $0 ignore <package>";
+	;;
+	unignore)
+		if [[ "$2" != "" ]];then
+			unset this;
+			declare -A this;
+			p=$(package $2);
+			eval "this=($p)";
+			if [[ $p != "" ]];then
+				this[ignore]="";
+				save;
+			fi;
+		fi;
+		echo "Usage $0 unignore <package>";
+	;;
+	*)
+		echo "Usage: $0 <command>";
+	;;
+esac;

+ 4 - 0
bin/repo-build

@@ -109,4 +109,8 @@ ls -l $root/repo/latest/ | egrep '^d' | awk '{print $9}' | while read arch; do
 		rm -f $reponame.db.tar.gz.old;
 	fi;
 done;
+ls -l $root/repo/latest/ | egrep '^d' | awk '{print $9}' | while read arch; do
+	rm -f $reponame.db;
+	ln -s $reponame.db.tar.gz $reponame.db;
+done;
 cd $root;

+ 1 - 1
configure.sh

@@ -16,4 +16,4 @@ done;
 echo "Check done, entering install shell.";
 echo -n "Available install commands: ";
 ls $(dirname $BASH_SOURCE)/bin/;
-bin/install-shell;
+$(dirname $BASH_SOURCE)/bin/install-shell;