Hi Sashank999
... I don't know what other unwanted file extensions (or names with no extensions) could pop up, do you?
We want 2 types of ELF files, so that's what it makes sense to search for.
Well, look at the object we are grepping - '\.o$' - I don't think any others will pop up because we are
- adding \ to that special . to make it an ordinary one
- using $ to designate the end of line
- using single quotes so that $ doesn't get substituted ...
I guess my wording wasn't clear. I wasn't questioning your syntax. I was questioning your assumption that all object files
would always have a .o extension. The -o (output) option lets you specify any name and extension you want:
gcc -c xyz.c -o abc.obj
... Yes. As we have dependency chaining system (I don't remember what it is called), I think direct deps check is enough.
I don't think we need to check for entire dependency tree. ...
Since submitqc is intended to check the extension being submitted, checking direct dependencies to make sure the .dep
file is OK makes sense. Since binutils is a dependency of submitqc , readelf is already present anyway.
... I also got this command working on creating .tcz.list without unsquashing it. Any suggestions on it ?
unsquashfs -ll ${F} | grep -v '^l' | tee /tmp/submitqc/.${F}.list # For checking with the given one
if diff -u /tmp/submitqc/.${F}.list ${F}.list ; then
echo -en "${RED}${F}.tcz.list is incorrect. ${GREEN}Corrected.${NORMAL}"
cp -f /tmp/submitqc/.${F}.list ./${F}.list
fi
Only one. Just create the list automatically and skip the remaining steps since that's what the list has to look like anyway.
The script is already quite long. The conditional logic to fix and spit out a message saying "you did it wrong and i fixed it"
adds no value. It simply adds noise to an already lengthy script.
I would suggest the same holds true of other items that are automatically fixed, such as MD5s, permissions, etc.