[Slackbuilds-users] Call for Bug Fixes, Patches, etc

Martijn Dekker martijn at inlv.org
Fri Feb 5 12:48:28 UTC 2016


Willy Sudiarto Raharjo schreef op 05-02-16 om 00:27:
> There are still a lot of build failures out there and we need your help
> to make sure our repository is ready for 14.2 when it has been released.

Is this a good moment to bring up a few more general issues?

I'm thinking of two things for now:

1. That -fPIC compiler flag for x86_64. The -fPIC flag is only necessary
for shared libraries. For normal binaries, it's unnecessary and causes
binaries to be much larger. Bloat should be avoided.

Years ago it may have been convenient to add this flag explicitly
because many build systems failed to account for x86_64 -- the lack of
-fPIC in shared libraries would cause build failures. But now we're
living in 2016 and almost everyone uses x86_64, so every current build
system will know how to add the -fPIC flag itself where it is necessary.
I think it's past time to remove -fPIC from the template.

2. The following horrible, broken and obsolete eyesore:

find -L . \
 \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
  -o -perm 511 \) -exec chmod 755 {} \; -o \
 \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
  -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;

can be replaced by:

   chmod -R a-st,u+rwX,go-w+rX .

which (a) accounts for every possible case, unless the 'find' voodooa
bove; (b) is much shorter and (c) is *much* faster. (The capital X sets
+x only if at least one of the user, group or other is already set +x,
so the above will do the right thing and make all directories 755 and
all files either 755 or 664.)

Proof that this works:

   mkdir tempdir
   cd tempdir
   for M in {0..4}{0..7}{0..7}{0..7}; do touch f$M && chmod $M f$M; done
   ls -l | less  # see every possible permission
   chmod -R a-st,u+rwX,go-w+rX .
   ls -l | less  # they're all either 755 or 644

These two things have been annoying me for some time, so I hope you're
willing to consider this.

- Martijn



More information about the SlackBuilds-users mailing list