[pacman-dev] [PATCH] add makedepends to package and database

Pierre Schmitz pierre at archlinux.de
Sun Jun 14 04:12:41 EDT 2009


Am Sonntag 14 Juni 2009 10:08:27 schrieb Pierre Schmitz:
> Hi,
>
> I think it would be nice to have information about makedepnds available in
> each pacakge and the pacakge database. Think about rebuilds (statically
> linked) or the question if a certain package can be (re)moved.

Let's try it inline this time...


From 7d3392a930a995c34e641f77a1936eedd3fff1c3 Mon Sep 17 00:00:00 2001
From: Pierre Schmitz <pierre at archlinux.de>
Date: Sun, 14 Jun 2009 09:51:52 +0200
Subject: [PATCH 2/2] add makedepends to package and database

This information makes it possible to create a complete build time
dependency tree from a package itself or even the db file.
---
 scripts/makepkg.sh.in  |    3 +++
 scripts/repo-add.sh.in |    4 +++-
 2 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 8e7d535..c59dbcc 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -927,6 +927,9 @@ create_package() {
 	for it in "${groups[@]}"; do
 		echo "group = $it" >>.PKGINFO
 	done
+	for it in "${makedepends[@]}"; do
+		echo "makedepend = $it" >>.PKGINFO
+	done
 	for it in "${depends[@]}"; do
 		echo "depend = $it" >>.PKGINFO
 	done
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index ccb4dda..5455290 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -184,7 +184,7 @@ db_write_entry()
 	# blank out all variables
 	local pkgfile="$1"
 	local pkgname pkgver pkgdesc csize size md5sum url arch builddate packager 
force \
-		_groups _licenses _replaces _depends _conflicts _provides _optdepends
+		_groups _licenses _replaces _makedepends _depends _conflicts _provides 
_optdepends
 
 	local OLDIFS="$IFS"
 	# IFS (field separator) is only the newline character
@@ -203,6 +203,7 @@ db_write_entry()
 			group)    _groups="$_groups$group\n" ;;
 			license)  _licenses="$_licenses$license\n" ;;
 			replaces) _replaces="$_replaces$replaces\n" ;;
+			makedepend)   _makedepends="$_makedepends$makedepend\n" ;;
 			depend)   _depends="$_depends$depend\n" ;;
 			conflict) _conflicts="$_conflicts$conflict\n" ;;
 			provides) _provides="$_provides$provides\n" ;;
@@ -265,6 +266,7 @@ db_write_entry()
 	msg2 "$(gettext "Creating 'depends' db entry...")"
 	# create the file even if it will remain empty
 	touch "depends"
+	write_list_entry "MAKEDEPENDS" "$_makedepends" "depends"
 	write_list_entry "DEPENDS" "$_depends" "depends"
 	write_list_entry "CONFLICTS" "$_conflicts" "depends"
 	write_list_entry "PROVIDES" "$_provides" "depends"
-- 
1.6.3.2


-- 

Pierre Schmitz


Clemens-August-Straße 76
53115 Bonn

Telefon		0228 9716608
Mobil		0160 95269831
Jabber		pierre at jabber.archlinux.de
WWW		http://www.archlinux.de



More information about the pacman-dev mailing list