From: joey Date: Tue, 17 Aug 1999 04:53:01 +0000 (+0000) Subject: r93: Initial Import X-Git-Tag: debian_version_0_1~140 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=8dd0b78a876be37d3be52d7dc2e7eecd957064bb;p=debhelper.git r93: Initial Import --- diff --git a/debian/changelog b/debian/changelog index b2263d2..873cfa6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,11 @@ +debhelper (0.96) unstable; urgency=low + + * dh_movefiles: fixed serious breakage introduced in the last version. + * dh_movefiles: really order all symlinks last. + * some minor reorganization of the source tree. + + -- Joey Hess Sun, 28 Jun 1998 21:53:45 -0700 + debhelper (0.95) unstable; urgency=low * dh_movefiles: move even very strangly named files. (#23775) Unfortunatly, diff --git a/dh_fixperms b/dh_fixperms index b30332a..544ee9b 100755 --- a/dh_fixperms +++ b/dh_fixperms @@ -5,26 +5,11 @@ PATH=debian:$PATH:/usr/lib/debhelper . dh_lib -# Pass this a list of files, one per line, it will return the list, with -# any files that need to be excluded removed. -filelist_excluded () { - IFS=" -" - if [ "$DH_EXCLUDE_GREP" ]; then - # Use grep -F so we don't have to worry about regexp's. - echo -n "$*" | grep -v -F \ - "`echo "$DH_EXCLUDE_GREP" | tr "|" "\n"`" - else - echo -n "$*" - fi - unset IFS -} - for PACKAGE in $DH_DOPACKAGES; do TMP=`tmpdir $PACKAGE` # General permissions fixing. - if [ ! "$DH_EXCLUDE_GREP" ]; then + if [ ! "$DH_EXCLUDE_FIND" ]; then # It's much faster to do it this way, but we can only do # this if there is nothing to exclude. if [ -d $TMP ]; then @@ -32,36 +17,33 @@ for PACKAGE in $DH_DOPACKAGES; do doit "chmod -R go=rX $TMP" doit "chmod -R u+rw $TMP" fi + + FIND_OPTIONS= else # Do it the hard way. - files=`filelist_excluded \`find $TMP 2>/dev/null\` | tr "\n" " "` - if [ "$files" ]; then - doit "chown root.root $files" - doit "chmod go=rX $files" - doit "chmod u+rw $files" - fi + complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ + 2>/dev/null | xargs -0r chown root.root" + complex_doit "find $TMP ! \($DH_EXCLUDE_FIND \) -print0 \ + 2>/dev/null | xargs -0r chmod go=rX" + complex_doit "find $TMP ! \( $DH_EXCLUDE_FIND \) -print0 \ + 2>/dev/null | xargs -0r chmod u+rw" + + FIND_OPTIONS="! \( $DH_EXCLUDE_FIND \)" fi # Fix up premissions in usr/doc, setting everything to not exectable # by default, but leave examples directories alone. - files=`filelist_excluded \`find $TMP/usr/doc -type f 2>/dev/null | grep -v /examples/\` | tr "\n" " "` - if [ "$files" ]; then - doit "chmod 644 $files" - fi - files=`filelist_excluded \`find $TMP/usr/doc -type d 2>/dev/null\` | tr "\n" " "` - if [ "$files" ]; then - doit "chmod 755 $files" - fi + complex_doit "find $TMP/usr/doc -type f $FIND_OPTIONS -print0 \ + 2>/dev/null | xargs -0r chmod 644" + complex_doit "find $TMP/usr/doc -type d $FIND_OPTIONS -print0 \ + 2>/dev/null | xargs -0r chmod 755" # Executable man pages are a bad thing.. - files=`filelist_excluded \`find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f 2>/dev/null\` | tr "\n" " "` - if [ "$files" ]; then - doit "chmod 644 $files" - fi + complex_doit "find $TMP/usr/man/ $TMP/usr/X11*/man/ -type f \ + $FIND_OPTIONS -print0 2>/dev/null | xargs -0r chmod 644" # ..and so are executable shared libraries (and .la files from libtool) - files=`filelist_excluded \`find $TMP -perm -5 -type f \( -name "*.so*" -or -name "*.la" \)\` | tr "\n" " "` - if [ "$files" ]; then - doit "chmod a-X $files" - fi + complex_doit "find $TMP -perm -5 -type f \ + \( -name "*.so*" -or -name "*.la" \) $FIND_OPTIONS -print0 \ + 2>/dev/null | xargs -0r chmod a-X" done diff --git a/dh_getopt.pl b/dh_getopt.pl index b5cde77..b7a856c 100755 --- a/dh_getopt.pl +++ b/dh_getopt.pl @@ -144,6 +144,10 @@ if ($ENV{DH_NO_ACT} ne undef) { $exclude=join ' ', @exclude; $exclude_grep=join '|', @exclude; +foreach (@exclude) { + $exclude_find.="-regex .*".quotemeta($_).".* -or "; +} +$exclude_find=~s/ -or $//; # Now output everything, in a format suitable for a shell to eval it. # Note the last line sets $@ in the shell to whatever arguements remain. @@ -157,6 +161,7 @@ DH_NOSCRIPTS='$noscripts' DH_INCLUDE_CONFFILES='$include' DH_EXCLUDE='$exclude' DH_EXCLUDE_GREP='$exclude_grep' +DH_EXCLUDE_FIND='$exclude_find' DH_D_FLAG='$d_flag' DH_R_FLAG='$r_flag' DH_K_FLAG='$k_flag'