Author: bdrewery
Date: Wed Aug 10 18:19:05 2016
New Revision: 303930
URL: https://svnweb.freebsd.org/changeset/base/303930

Log:
  Support -v for -l.
  
  MFC after:    1 week
  Sponsored by: EMC / Isilon Storage Division

Modified:
  head/usr.bin/xinstall/xinstall.c

Modified: head/usr.bin/xinstall/xinstall.c
==============================================================================
--- head/usr.bin/xinstall/xinstall.c    Wed Aug 10 18:19:02 2016        
(r303929)
+++ head/usr.bin/xinstall/xinstall.c    Wed Aug 10 18:19:05 2016        
(r303930)
@@ -533,6 +533,9 @@ do_link(const char *from_name, const cha
                        if (target_sb->st_flags & NOCHANGEBITS)
                                (void)chflags(to_name, target_sb->st_flags &
                                     ~NOCHANGEBITS);
+                       if (verbose)
+                               printf("install: link %s -> %s\n",
+                                   from_name, to_name);
                        unlink(to_name);
                        ret = rename(tmpl, to_name);
                        /*
@@ -543,8 +546,12 @@ do_link(const char *from_name, const cha
                        (void)unlink(tmpl);
                }
                return (ret);
-       } else
+       } else {
+               if (verbose)
+                       printf("install: link %s -> %s\n",
+                           from_name, to_name);
                return (link(from_name, to_name));
+       }
 }
 
 /*
@@ -575,12 +582,18 @@ do_symlink(const char *from_name, const 
                             ~NOCHANGEBITS);
                unlink(to_name);
 
+               if (verbose)
+                       printf("install: symlink %s -> %s\n",
+                           from_name, to_name);
                if (rename(tmpl, to_name) == -1) {
                        /* Remove temporary link before exiting. */
                        (void)unlink(tmpl);
                        err(EX_OSERR, "%s: rename", to_name);
                }
        } else {
+               if (verbose)
+                       printf("install: symlink %s -> %s\n",
+                           from_name, to_name);
                if (symlink(from_name, to_name) == -1)
                        err(EX_OSERR, "symlink %s -> %s", from_name, to_name);
        }
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to