Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#3175 - srcpac modifies PKGBUILD when using -o and requires root

Attached to Project: Arch Linux
Opened by Darin Manica (manica) - Wednesday, 14 September 2005, 13:39 GMT
Last edited by Jason Chu (jason) - Tuesday, 01 May 2007, 03:30 GMT
Task Type Feature Request
Category Packages: Extra
Status Closed
Assigned To Jason Chu (jason)
Architecture not specified
Severity Low
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

srcpac -So <package> modifies the PKGBUILD file. Since the user just wants to see the modifications, without installing them, it would be better to not modify the PKGBUILD. Additionally, this requires root permission which doesn't make sense because nothing is being installed.

The following patch allows srcpac to display the modifications without altering the PKGBUILD file and does not require root access when using the -o option.

--- srcpac 2005-09-13 21:10:23.000000000 +0000
+++ srcpac.patched 2005-09-13 21:10:23.000000000 +0000
@@ -72,6 +72,19 @@
fi
}

+output_confs()
+{
+ varname=`echo $1 | sed 's#-#X#g'`
+ eval num_conf=\$\{\#conf_$varname[@]\}
+ if [ $num_conf -gt 0 ]; then
+ sedvar=""
+ eval "for (( j = 0 ; j < $num_conf ; j++ )); do
+ sedvar=\"\${sedvar}s\${conf_$varname[\$j]};\"
+ done"
+ eval sed \"$sedvar\" $2/PKGBUILD
+ fi
+}
+
build_packages()
{
action="build"
@@ -426,8 +439,7 @@
for pkgdir in $candidates; do
if [ -f $pkgdir/PKGBUILD ]; then
# Look for config options and apply them
- do_confs $i $pkgdir
- less $pkgdir/PKGBUILD
+ output_confs $i $pkgdir | less
success=1
break
fi
This task depends upon

Closed by  Jason Chu (jason)
Tuesday, 01 May 2007, 03:30 GMT
Reason for closing:  Fixed

Loading...