IzzySoft / Adebar

Android DEvice Backup And Report, using Bash and ADB. Moved to https://codeberg.org/izzy/Adebar -- this is only a mirror now.
GNU General Public License v2.0
246 stars 41 forks source link

stderr treated as app names #4

Closed tukusejssirs closed 9 years ago

tukusejssirs commented 9 years ago

I just noticed that my disable file looks like this – the error output is treated as stdout with the disabled apps. In my opinion you should work only with stdout not the whole terminal output. :)

More info on the error is here. :)

The stderr output is also visible in $backup/sysbackup file, too (pastebin),

And it also affects $backup/sysrestore (pastebin), $backup/userbackup (pastebin) and $backup/userrestore (pastebin) files.

IzzySoft commented 9 years ago

Thanks for pointing this out! I wonder why this doesn't happen here (I have Xposed installed as well on some devices). However: should be solved with 83c5286 (devel branch), could you please verify?

tukusejssirs commented 9 years ago

File sysbackup is exactly the same.

The output of of $ adb shell pm list packages -3 is here. I think grep-ing out only lines with ^package: pattern would be a solution. (Or even piping the output to sed '/^WARNING/d' - would be the solution, too.)

IzzySoft commented 9 years ago

Are you sure you've pulled the latest code _from the "devel" branch_ and used that? I cannot find a single pm list packages in the code which doesn't end with 2>/dev/null – so either those messages are not from STDERR, or you didn't update. Unfortunately I cannot test this myself, as none of the devices I have here show this behavior. If those messages are not from STDERR, I'd really have to check all places and "grep for `^package:", which I prefer to avoid if possible.

tukusejssirs commented 9 years ago

Well, I am sure. I tried even to run adb shell pm list packages -3 2>/dev/null in terminal on its own, but somehow the warnings are still there.

IzzySoft commented 9 years ago

Ah, OK – thanks for that detail; so those "warnings" are not printed to STDERR but to STDOUT. Then it seems we've got no other choice but filtering each returned line separately. I will see to that.

IzzySoft commented 9 years ago

Should be solved now with 2267b0f – could you please retry and confirm?

tukusejssirs commented 9 years ago

I confirm there are no warning now. Nice job! :)

IzzySoft commented 9 years ago

Thanks a lot! So I'm closing this now. Leaves the "some files not found" as only show-stopper for the pending v1.3.0 release – before I can go after your Dual-SIM support :)

Btw: last commit also solved the probably unwanted "progress output" for "Remove apps" :) To see those again, you've had to rise PROGRESS to at least level 4 now. I might even decide to push that up to level 5, as it's really just a "forgotten debug message" (I've never encountered any app in that section, and so left it out of curiosity)