FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 05-31-2008, 09:19 AM
Sebastian Nowicki
 
Default Make sure dot files don't get included in package

On BSD systems, as a super user, `ls` displays all dot files by default.
On most BSD systems -I can be used to suppress this behavior, but this
argument is not available on Mac OSX. Instead, grep is used to filter out
all dot files.

Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
---
scripts/makepkg.sh.in | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index cb55dea..f4acd50 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -849,7 +849,7 @@ create_package() {

local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"

- if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
+ if ! bsdtar -czf "$pkg_file" $comp_files $(ls | grep -v '^.'); then
error "$(gettext "Failed to create package file.")"
exit 1 # TODO: error code
fi
--
1.5.5.1


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-31-2008, 01:09 PM
"Dan McGee"
 
Default Make sure dot files don't get included in package

On Sat, May 31, 2008 at 4:19 AM, Sebastian Nowicki <sebnow@gmail.com> wrote:
> On BSD systems, as a super user, `ls` displays all dot files by default.
> On most BSD systems -I can be used to suppress this behavior, but this
> argument is not available on Mac OSX. Instead, grep is used to filter out
> all dot files.
>
> Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
> ---
> scripts/makepkg.sh.in | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index cb55dea..f4acd50 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -849,7 +849,7 @@ create_package() {
>
> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
>
> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
> + if ! bsdtar -czf "$pkg_file" $comp_files $(ls | grep -v '^.'); then
> error "$(gettext "Failed to create package file.")"
> exit 1 # TODO: error code
> fi
> --

The --hide or -I/--ignore options to ls aren't available, are they?
That would be a slightly cleaner solution, but I'm not sure if these
are in the POSIX standard or something.

-Dan

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-31-2008, 01:18 PM
Sebastian Nowicki
 
Default Make sure dot files don't get included in package

On 31/05/2008, at 9:09 PM, Dan McGee wrote:

> On Sat, May 31, 2008 at 4:19 AM, Sebastian Nowicki
> <sebnow@gmail.com> wrote:
>> On BSD systems, as a super user, `ls` displays all dot files by
>> default.
>> On most BSD systems -I can be used to suppress this behavior, but
>> this
>> argument is not available on Mac OSX. Instead, grep is used to
>> filter out
>> all dot files.
>>
>> Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
>> ---
>> scripts/makepkg.sh.in | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index cb55dea..f4acd50 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -849,7 +849,7 @@ create_package() {
>>
>> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-$
>> {CARCH}${PKGEXT}"
>>
>> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
>> + if ! bsdtar -czf "$pkg_file" $comp_files $(ls | grep -v '^
>> .'); then
>> error "$(gettext "Failed to create package file.")"
>> exit 1 # TODO: error code
>> fi
>> --
>
> The --hide or -I/--ignore options to ls aren't available, are they?
> That would be a slightly cleaner solution, but I'm not sure if these
> are in the POSIX standard or something.
>
> -Dan

-I is available on BSD, but I can't find any similar option on Mac OSX
(it's really starting to be a pain in the ass).


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 05-31-2008, 01:22 PM
"Dan McGee"
 
Default Make sure dot files don't get included in package

On Sat, May 31, 2008 at 8:18 AM, Sebastian Nowicki <sebnow@gmail.com> wrote:
>
> On 31/05/2008, at 9:09 PM, Dan McGee wrote:
>
>> On Sat, May 31, 2008 at 4:19 AM, Sebastian Nowicki
>> <sebnow@gmail.com> wrote:
>>> On BSD systems, as a super user, `ls` displays all dot files by
>>> default.
>>> On most BSD systems -I can be used to suppress this behavior, but
>>> this
>>> argument is not available on Mac OSX. Instead, grep is used to
>>> filter out
>>> all dot files.
>>>
>>> Signed-off-by: Sebastian Nowicki <sebnow@gmail.com>
>>> ---
>>> scripts/makepkg.sh.in | 2 +-
>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>> index cb55dea..f4acd50 100644
>>> --- a/scripts/makepkg.sh.in
>>> +++ b/scripts/makepkg.sh.in
>>> @@ -849,7 +849,7 @@ create_package() {
>>>
>>> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-$
>>> {CARCH}${PKGEXT}"
>>>
>>> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
>>> + if ! bsdtar -czf "$pkg_file" $comp_files $(ls | grep -v '^
>>> .'); then
>>> error "$(gettext "Failed to create package file.")"
>>> exit 1 # TODO: error code
>>> fi
>>> --
>>
>> The --hide or -I/--ignore options to ls aren't available, are they?
>> That would be a slightly cleaner solution, but I'm not sure if these
>> are in the POSIX standard or something.
>>
>> -Dan
>
> -I is available on BSD, but I can't find any similar option on Mac OSX
> (it's really starting to be a pain in the ass).

Ahh, I read your commit note as saying the letter L (but lowercase),
not I, so that is why I was confused. Sounds like Mac OSX is a piece
of shit. :P

-Dan

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 06-11-2008, 08:39 PM
"Dan McGee"
 
Default Make sure dot files don't get included in package

On Tue, Jun 10, 2008 at 4:03 PM, Xavier <shiningxc@gmail.com> wrote:
> Dan McGee wrote:
>> On Sat, May 31, 2008 at 8:18 AM, Sebastian Nowicki<sebnow@gmail.com> wrote:
>>> On 31/05/2008, at 9:09 PM, Dan McGee wrote:
>>>
>>>> On Sat, May 31, 2008 at 4:19 AM, Sebastian Nowicki
>>>> <sebnow@gmail.com> wrote:
>>>>> On BSD systems, as a super user, `ls` displays all dot files by
>>>>> default.
>>>>> On most BSD systems -I can be used to suppress this behavior, but
>>>>> this
>>>>> argument is not available on Mac OSX. Instead, grep is used to
>>>>> filter out
>>>>> all dot files.
>>>>>
>>>>> Signed-off-by: Sebastian Nowicki<sebnow@gmail.com>
>>>>> ---
>>>>> scripts/makepkg.sh.in | 2 +-
>>>>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>>>>
>>>>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>>>>> index cb55dea..f4acd50 100644
>>>>> --- a/scripts/makepkg.sh.in
>>>>> +++ b/scripts/makepkg.sh.in
>>>>> @@ -849,7 +849,7 @@ create_package() {
>>>>>
>>>>> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-$
>>>>> {CARCH}${PKGEXT}"
>>>>>
>>>>> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
>>>>> + if ! bsdtar -czf "$pkg_file" $comp_files $(ls | grep -v '^
>>>>> .'); then
>>>>> error "$(gettext "Failed to create package file.")"
>>>>> exit 1 # TODO: error code
>>>>> fi
>>>>> --
>>>> The --hide or -I/--ignore options to ls aren't available, are they?
>>>> That would be a slightly cleaner solution, but I'm not sure if these
>>>> are in the POSIX standard or something.
>>>>
>>>> -Dan
>>> -I is available on BSD, but I can't find any similar option on Mac OSX
>>> (it's really starting to be a pain in the ass).
>>
>> Ahh, I read your commit note as saying the letter L (but lowercase),
>> not I, so that is why I was confused. Sounds like Mac OSX is a piece
>> of shit. :P
>>
>
> what is that $(ls) thing? what is wrong with *?

Any objections? I can think of one issue- this would pass the literal
* on to bsdtar if no other files existed (e.g. trying to create a
no-files package).

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 457f62d..34f35f3 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -849,7 +849,7 @@ create_package() {

local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"

- if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
+ if ! bsdtar -czf "$pkg_file" $comp_files *; then
error "$(gettext "Failed to create package file.")"
exit 1 # TODO: error code
fi

So maybe something like this?

diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
index 457f62d..70d8e15 100644
--- a/scripts/makepkg.sh.in
+++ b/scripts/makepkg.sh.in
@@ -36,6 +36,10 @@ export TEXTDOMAINDIR='@localedir@'
# file -i does not work on Mac OSX unless legacy mode is set
export COMMAND_MODE='legacy'

+# when fileglobbing, we want * in an empty directory to expand to the null
+# string rather than itself
+shopt -s nullglob
+
myver='@PACKAGE_VERSION@'
confdir='@sysconfdir@'
startdir="$PWD"
@@ -849,7 +853,7 @@ create_package() {

local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"

- if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
+ if ! bsdtar -czf "$pkg_file" $comp_files *; then
error "$(gettext "Failed to create package file.")"
exit 1 # TODO: error code
fi

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 06-12-2008, 08:47 AM
"Roman Kyrylych"
 
Default Make sure dot files don't get included in package

2008/6/11 Dan McGee <dpmcgee@gmail.com>:
>
> Any objections? I can think of one issue- this would pass the literal
> * on to bsdtar if no other files existed (e.g. trying to create a
> no-files package).
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 457f62d..34f35f3 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -849,7 +849,7 @@ create_package() {
>
> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
>
> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
> + if ! bsdtar -czf "$pkg_file" $comp_files *; then
> error "$(gettext "Failed to create package file.")"
> exit 1 # TODO: error code
> fi
>
> So maybe something like this?
>
> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
> index 457f62d..70d8e15 100644
> --- a/scripts/makepkg.sh.in
> +++ b/scripts/makepkg.sh.in
> @@ -36,6 +36,10 @@ export TEXTDOMAINDIR='@localedir@'
> # file -i does not work on Mac OSX unless legacy mode is set
> export COMMAND_MODE='legacy'
>
> +# when fileglobbing, we want * in an empty directory to expand to the null
> +# string rather than itself
> +shopt -s nullglob
> +
> myver='@PACKAGE_VERSION@'
> confdir='@sysconfdir@'
> startdir="$PWD"
> @@ -849,7 +853,7 @@ create_package() {
>
> local pkg_file="$PKGDEST/${pkgname}-${pkgver}-${pkgrel}-${CARCH}${PKGEXT}"
>
> - if ! bsdtar -czf "$pkg_file" $comp_files $(ls); then
> + if ! bsdtar -czf "$pkg_file" $comp_files *; then
> error "$(gettext "Failed to create package file.")"
> exit 1 # TODO: error code
> fi

Looks good to me.

--
Roman Kyrylych (*оман Кирилич)
_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 03:20 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org