bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnulib-tool: new option --local-symlink


From: Bruno Haible
Subject: gnulib-tool: new option --local-symlink
Date: Mon, 13 Nov 2006 14:36:10 +0100
User-agent: KMail/1.9.1

This adds an option --local-symlink that allows to have symlinks inside a
package but avoids symlinks to outside a package.

2006-11-12  Bruno Haible  <address@hidden>

        * gnulib-tool: New option --local-symlink.
        (func_usage): Document it.
        (lsymbolic): New variable.
        (func_import, func_create_testdir): If --symlink was not specified,
        test whether --local-symlink was specified and the file comes from
        the local_gnulib_dir.

*** gnulib-20061108-modified/gnulib-tool        2006-11-13 02:37:13.000000000 
+0100
--- gnulib-20061108/gnulib-tool 2006-11-13 02:33:17.000000000 +0100
***************
*** 159,164 ****
--- 159,166 ----
  Options for --import and --update:
        --dry-run             For --import, only print what would have been 
done.
    -s, --symbolic, --symlink Make symbolic links instead of copying files.
+       --local-symlink       Make symbolic links instead of copying files, only
+                             for files from the local override directory.
  
  Report bugs to <address@hidden>."
  }
***************
*** 424,430 ****
  # - autoconf_minversion  minimum supported autoconf version
  # - do_changelog    false if --no-changelog was given, : otherwise
  # - doit            : if actions shall be executed, false if only to be 
printed
! # - symbolic        true if --symbolic was given, blank otherwise
  {
    mode=
    destdir=
--- 426,433 ----
  # - autoconf_minversion  minimum supported autoconf version
  # - do_changelog    false if --no-changelog was given, : otherwise
  # - doit            : if actions shall be executed, false if only to be 
printed
! # - symbolic        true if --symlink was given, blank otherwise
! # - lsymbolic       true if --local-symlink was given, blank otherwise
  {
    mode=
    destdir=
***************
*** 445,450 ****
--- 448,454 ----
    do_changelog=:
    doit=:
    symbolic=
+   lsymbolic=
  
    supplied_opts="$@"
  
***************
*** 608,613 ****
--- 612,620 ----
        -s | --symbolic | --symboli | --symbol | --symbo | --symb | --symlink | 
--symlin | --symli | --syml | --sym | --sy )
          symbolic=true
          shift ;;
+       --local-symlink | --local-symlin | --local-symli | --local-syml | 
--local-sym | --local-sy | --local-s )
+         lsymbolic=true
+         shift ;;
        --help | --hel | --he | --h )
          func_usage
          func_exit $? ;;
***************
*** 1450,1455 ****
--- 1457,1464 ----
  # - autoconf_minversion  minimum supported autoconf version
  # - doit            : if actions shall be executed, false if only to be 
printed
  # - symbolic        true if files should be symlinked, copied otherwise
+ # - lsymbolic       true if files from local_gnulib_dir should be symlinked,
+ #                   copied otherwise
  func_import ()
  {
    # Get the cached settings.
***************
*** 1790,1796 ****
              echo "Replacing file $g (non-gnulib code backuped in ${g}~) !!"
            fi
            mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed"
!           if test -n "$symbolic" && test -z "$lookedup_tmp" \
               && cmp "$lookedup_file" "$tmpfile" > /dev/null; then
              func_ln_if_changed "$lookedup_file" "$destdir/$g"
            else
--- 1799,1808 ----
              echo "Replacing file $g (non-gnulib code backuped in ${g}~) !!"
            fi
            mv -f "$destdir/$g" "$destdir/${g}~" || func_fatal_error "failed"
!           if { test -n "$symbolic" \
!                || { test -n "$lsymbolic" \
!                     && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \
!              && test -z "$lookedup_tmp" \
               && cmp "$lookedup_file" "$tmpfile" > /dev/null; then
              func_ln_if_changed "$lookedup_file" "$destdir/$g"
            else
***************
*** 1810,1816 ****
        # frequently that developers don't put autogenerated files into CVS.
        if $doit; then
          echo "Copying file $g"
!         if test -n "$symbolic" && test -z "$lookedup_tmp" \
             && cmp "$lookedup_file" "$tmpfile" > /dev/null; then
            func_ln_if_changed "$lookedup_file" "$destdir/$g"
          else
--- 1822,1831 ----
        # frequently that developers don't put autogenerated files into CVS.
        if $doit; then
          echo "Copying file $g"
!         if { test -n "$symbolic" \
!              || { test -n "$lsymbolic" \
!                   && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; } \
!            && test -z "$lookedup_tmp" \
             && cmp "$lookedup_file" "$tmpfile" > /dev/null; then
            func_ln_if_changed "$lookedup_file" "$destdir/$g"
          else
***************
*** 2267,2276 ****
          cp -p "$lookedup_file" "$testdir/$g"
        else
          ln "$lookedup_file" "$testdir/$g" 2>/dev/null ||
!         if test -z "$symbolic"; then
!           cp -p "$lookedup_file" "$testdir/$g"
!         else
            func_ln "$lookedup_file" "$testdir/$g"
          fi
        fi
      done
--- 2282,2293 ----
          cp -p "$lookedup_file" "$testdir/$g"
        else
          ln "$lookedup_file" "$testdir/$g" 2>/dev/null ||
!         if { test -n "$symbolic" \
!              || { test -n "$lsymbolic" \
!                   && test "$lookedup_file" = "$local_gnulib_dir/$f"; }; }; 
then
            func_ln "$lookedup_file" "$testdir/$g"
+         else
+           cp -p "$lookedup_file" "$testdir/$g"
          fi
        fi
      done




reply via email to

[Prev in Thread] Current Thread [Next in Thread]