Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 177591

Summary: PORTAGE_RSYNC_EXTRA_OPTS with "--filter" fails with >=sys-apps/portage-2.1.2-r9
Product: Portage Development Reporter: Wicher Minnaard <wicher>
Component: Core - ConfigurationAssignee: Portage team <dev-portage>
Status: RESOLVED WORKSFORME    
Severity: normal CC: wicher
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 181949    
Attachments: do not remove quotes when expanding make.conf variables

Description Wicher Minnaard 2007-05-08 08:04:58 UTC
I use PORTAGE_RSYNC_EXTRA_OPTS='--delete-excluded --prune-empty-dirs --filter=". /etc/portage/rsync.filter"' with rsync.filter being a list of portage directories I want, like so:
+ /www-misc/***
+ /www-servers/***
+ */
- *

Works like a charm in portage-2.1.1-r2. In later versions (tested: portage-2.1.2.7) this results in:
# emerge --sync
>>> Starting rsync with rsync://212.79.254.44/gentoo-portage...
>>> Checking server timestamp ...
unexpected end of filter rule: .
rsync error: syntax or usage error (code 1) at exclude.c(846) [client=2.6.9]

!!! Rsync has reported that there is a syntax error. Please ensure
!!! that your SYNC statement is proper.
!!! SYNC=rsync://rsync5.nl.gentoo.org/gentoo-portage


Reproducible: Always

Steps to Reproduce:
1. Install >=sys-apps/portage-2.1.2-r9
2. Use PORTAGE_RSYNC_EXTRA_OPTS='--delete-excluded --prune-empty-dirs --filter=". /etc/portage/rsync.filter"' and SYNC="rsync://rsync5.nl.gentoo.org/gentoo-portage" in make.conf
3. Make file /etc/portage/rsync.filter containing

+ /www-misc/***
+ /www-servers/***
+ */
- *

5. Run 'emerge --sync'
Actual Results:  
The sync fails with:
>>> Checking server timestamp ...
unexpected end of filter rule: .
rsync error: syntax or usage error (code 1) at exclude.c(846) [client=2.6.9]

!!! Rsync has reported that there is a syntax error. Please ensure
!!! that your SYNC statement is proper.
!!! SYNC=rsync://rsync5.nl.gentoo.org/gentoo-portage

Expected Results:  
Should sync the directories listed in /etc/portage/rsync.filter .
Comment 1 Zac Medico gentoo-dev 2007-05-08 08:14:33 UTC
emerge --oneshot rsync

*** This bug has been marked as a duplicate of bug 167668 ***
Comment 2 Wicher Minnaard 2007-05-08 08:53:35 UTC
1) Remerging rsync does not solve this
2) How is this related to #167668 ?
Comment 3 Zac Medico gentoo-dev 2007-05-08 08:59:02 UTC
This is fixed in svn r6491:6493 and released in portage-2.1.2.7.  Please reopen if 2.1.2.7 doesn't work for you. 
Comment 4 Wicher Minnaard 2007-05-08 09:22:48 UTC
Reopening because 2.1.2.7 doesn't work for me ;-)
Comment 5 Zac Medico gentoo-dev 2007-05-08 17:03:42 UTC
(In reply to comment #0)
> I use PORTAGE_RSYNC_EXTRA_OPTS='--delete-excluded --prune-empty-dirs
> --filter=". /etc/portage/rsync.filter"'

At the moment, the cleanest way to do it is to use --filter=._/etc/portage/rsync.filter since rsync supports using an underscore instead of a space there.  You could use \" to escape the quotes but that's not ideal because we'd like make.conf to be a bash compatible subset of standard shell syntax.
Comment 6 Zac Medico gentoo-dev 2007-05-08 17:58:23 UTC
Created attachment 118605 [details, diff]
do not remove quotes when expanding make.conf variables

This patch will make it behave in a more shell-compatible manner.  Instead of removing quotes during variable expansion, it will preserve them.  The quotes will be removed later when the command is split into arguments for execution.
Comment 7 Wicher Minnaard 2007-05-08 19:52:06 UTC
--filter=._/etc/portage/rsync.filter works wonders. Thanks man! Didn't try the patch though.
Comment 8 Zac Medico gentoo-dev 2007-05-25 09:07:12 UTC
This has been released in 2.1.2.8.