The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 4,262 other subscribers

Delphi needs a few more wizards – verify dpr against dproj and check both against files on disk

Posted by jpluimers on 2018/05/31

There are a few experts Delphi needs for project management:

  • verify the .dproj against the .dpr as these get out of sync often, especially in multi-person or multi-branch projects
  • verify .dproj and .dpr against files on disk (often there are files on disk not in the Project Manager; Visual Studio has this nice [WayBack“Show All Files” button that helps fixing this there)

via [WayBackIs there a way to export the file structure of a Project from the Project Manager view to a txt file? – John Kouraklis – Google+

Atilla Kovaks posted a small bash script to get started: [WayBackhttp://pisil.de/prfiles.sh.txt

–jeroen

From https://pastebin.com/fcsiLc6Q :


#!/bin/bash
# !!! Be careful with scripts, always do your backup or play on a copy !!!
if [[ $# -eq 0 ]] ; then
echo 'usage: prfiles.sh project.dproj'
exit 1
fi
declare file_content=$( cat $1 | sed -nr "/DCCReference Include/I{s/(.*)\"(.*)\"(.*)/\2/g;p}" )
shopt -s nocasematch
for i in `find . -name "*.pas" -type f -printf '%f\n'`; do
[[ ! " $file_content " =~ $i ]] && echo $i "not in dproj"
done
exit

view raw

prfiles.sh

hosted with ❤ by GitHub

 

3 Responses to “Delphi needs a few more wizards – verify dpr against dproj and check both against files on disk”

  1. Attila Kovacs said

    my webserver is temporary suspended due to GDPR :P

    here is the script:

    #!/bin/bash

    !!! Be careful with scripts, always do your backup or play on a copy !!!

    if [[ $# -eq 0 ]] ; then
    echo ‘usage: prfiles.sh project.dproj’
    exit 1
    fi

    declare file_content=$( cat $1 | sed -nr “/DCCReference Include/I{s/(.)\”(.)\”(.*)/\2/g;p}” )

    shopt -s nocasematch

    for i in find . -name "*.pas" -type f -printf '%f\n'; do
    [[ ! ” $file_content ” =~ $i ]] && echo $i “not in dproj”
    done

    exit

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.