Skip to content
This repository has been archived by the owner on Jun 28, 2022. It is now read-only.

Allow for configurable excluded directories. #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

djnym
Copy link
Contributor

@djnym djnym commented May 8, 2017

Sometimes in RPM's you need to exclude directories from the file
lists. Before it was a hardcoded list of 3 directories. This
allows you to specify directories via a new command line option.

Sometimes in RPM's you need to exclude directories from the file
lists.  Before it was a hardcoded list of 3 directories.  This
allows you to specify directories via a new command line option.
@djnym
Copy link
Contributor Author

djnym commented May 24, 2017

Similar to other test, ran on

NAME="openSUSE Leap"
VERSION="42.2"
ID=opensuse
ID_LIKE="suse"
VERSION_ID="42.2"
PRETTY_NAME="openSUSE Leap 42.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:42.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

But with some slightly different commands

> mkdir foo && cd foo && mkdir tmp && mkdir -p etc/init.d && echo "stuff" > tmp/foo && echo '#!/bin/sh' > etc/init.d/foo && echo 'echo "hello world"' >> etc/init.d/foo ; mkdir -p usr/bin ; echo '#!/bin/sh' > usr/bin/foo.sh ; echo 'echo hello world' >> usr/bin/foo.sh
> ../epm.erl -f -t rpm -n test -v 1.1.0 -a x86_64 tmp etc usr
> rpm -qlp test-1.1.0-1.x86_64.rpm
/etc/init.d/foo
/tmp/foo
/usr/bin
/usr/bin/foo.sh

Notice /usr/bin is in the list and probably shouldn't be as that's a common shared directory. So with this patch

> mkdir foo && cd foo && mkdir tmp && mkdir -p etc/init.d && echo "stuff" > tmp/foo && echo '#!/bin/sh' > etc/init.d/foo && echo 'echo "hello world"' >> etc/init.d/foo ; mkdir -p usr/bin ; echo '#!/bin/sh' > usr/bin/foo.sh ; echo 'echo hello world' >> usr/bin/foo.sh
> ../epm.erl -f -t rpm -n test -v 1.1.0 -a x86_64 --exclude-dir tmp --exclude-dir usr --exclude-dir usr/bin --exclude-dir etc --exclude-dir etc/init.d tmp etc usr
> > rpm -qlp test-1.1.0-1.x86_64.rpm
/etc/init.d/foo
/tmp/foo
/usr/bin/foo.sh

Common directories have been excluded. The default is to use the hardcoded list you had before, so it should behave the same if you don't include any '--exclude-dir' args.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant